npm.io
1.131.0 • Published 2 years ago

@stockpile/greendot-sdk

Licence
ISC
Version
1.131.0
Deps
1
Size
52 kB
Vulns
0
Weekly
0

Greendot SDK Package

How to use

import { getClients } from "@stockpile/greendot-sdk";

const config = {
  baseUrl: "https://aws-bass.greendot.com/baas/v1",
	username: "your-username",
	password: "your-password",
	programCode: "my-company-program-code",
	timeoutMs: 3000,
	envType: "PIE",
	spkiPublicKey: "public-key-for-encryption",
};
const clients = getClients(config);
// Ideally, store the clients object globally and initialize once on server start...
const {  baseClient,  cardClient,  accountClient,  purseClient,  transactionClient,  userClient } = clients;
// 2. use the client are per requirement
const transactions = await transactionClient.getTransactions({accountId: "123"});

Method 2

In method 1, we initialized all clients, we can initialize only the required client

import { GreendotBaseClient, GreendotTransactionClient } from "@stockpile/greendot-sdk";

const baseClient = new GreendotBaseClient(config);
const transactionClient = new GreendotTransactionClient({ baseClient })

DOCUMENTATION

Account Client
  1. searchAccounts: Search Accounts by mobile, date-of-birth, email or ssn
  2. getAccountDetails: Get details of account like accountNumber, routingNumber, accountStatus and user, Information about user includes name, last 4 digit of identity and kyc statuses
  3. getLinkedAccounts: Returns minimal information about linked accounts
    • for parent accountId - returns parent-child link for all children
    • for child accountId - returns one parent-child link
  4. getLinkedAccountsInfo: Returns information about linked accounts in detail same as getAccountDetails
    • for parent accountId - returns parent-child link for all children
    • for child accountId - returns one parent-child link
Card Client
  1. getCards: Get all cards for a given greendot accountIdentifier
  2. getCard: Get card details for given accountId and cardId(paymentInstrumentIdentifier)
  3. setPin: Set PIN for physical card ?
  4. getCardDeliveryStatus: Returns the delivery status of physical card
  5. pauseCard: Pause card to block all card actions
  6. unpauseCard: Unpause an paused card
  7. replaceCard: Replace card when the current card is stolen, lost, damaged or fraud transaction.
  8. getReplaceCardEligibility: Check if a card can be replaced
  9. activateCard: Activate a physical card
  10. validateCardCvv: Validate Card CVV ?
Enrollment Client
  1. getAccountDetailsWithCards: Returns account details like routing number, account number along with account users and their details as well as their purses and cards(payment instruments)
Purse Client
  1. getPurses: Returns all purses of a greendot account
Transaction Client
  1. getTransactions: Returns transactions for an account, this function has many filters to choose from like
    • startDate: string;
  • endDate?: string
  • limit?: number
  • purseIdentifier?: string
  • transactionType?: TransactionType
  • transactionStatus?: TransactionStatus
  1. getPaginatedTransactions: Returns transactions for an account, and following filters
    • limit: number;
  • offset?: number
  • purseIdentifier?: string
User Client
  1. getAccountUsers: Returns list of users for an account along with their details
  2. validateUserSsn: Validate account`s user SSN ?