npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

partner-api-sdk

v1.0.1

Published

Partner API enables prepaid virtual cards functions in the third-party application. API allows creating and managing prepaid virtual cards for corporate customers. All around card details and operations are available for BaE corporate customers who are us

Downloads

5

Readme

Partner Prepaid Cards API

Browser and node module for making API requests against Partner Prepaid Cards API.

Installation

npm install partner-prepaid-cards-api --save

Usage

var PartnerPrepaidCardsApi = require('partner-prepaid-cards-api')

var client = new PartnerPrepaidCardsApi()

Logging

This client supports logging by using the environment variable NODE_DEBUG=Partner Prepaid Cards API

Authentication

OAuth 2.0

This API supports authentication with OAuth 2.0. Initialize the OAuth2 instance with the application client id, client secret and a redirect uri to authenticate with users.

var auth = new PartnerPrepaidCardsApi.security.<method>({
  clientId:     '123',
  clientSecret: 'abc',
  redirectUri:  'http://example.com/auth/callback'
});

// Available methods for OAuth 2.0:
 - oauth_2_0

Options

You can set options when you initialize a client or at any time with the options property. You may also override options per request by passing an object as the last argument of request methods. For example:

var client = new PartnerPrepaidCardsApi({ ... })

client('GET', '/', {
  baseUri: 'http://example.com',
  headers: {
    'Content-Type': 'application/json'
  }
})

Base URI

You can override the base URI by setting the baseUri property, or initializing a client with a base URI. For example:

new PartnerPrepaidCardsApi({
  baseUri: 'https://example.com'
});

Helpers

Exports PartnerPrepaidCardsApi.form, which exposes a cross-platform FormData interface that can be used with request bodies.

Methods

All methods return a HTTP request instance of Popsicle, which allows the use of promises (and streaming in node).

customers.customerId({ customerId }).cards.post([body, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)

The method creates new prepaid virtual card and returns created card details.

it can be used to just create a card or to create and top it balance up immediatelly. Also you can control if you want to receive the full PAN and CVV code of the new card in response or you need only not sensitive card data.

Important

Card Token received in response is the safe card token you will have to provide for all subsequent action for this card. The Token can be stored on the Partner application side, because it is not sensitive data.

Create card and top up

In order to create and top up the card specify the Amount greater than 0 in CreditBalance object attributes.

Use AccountNumber that was opened and provided after successfull customer onboarding. E.g.

"CreditDetails": {
      "AccountNumber": "0010100063915101",
      "Amount": 1000.55
}

One card can have more than one wallet, each holding balance in it own currency.

Create card without top up

You can specify the Amount equal to 0 in CreditBalance object attributes,the card will be issues but without any available balance. E.g.

"CreditDetails": {
      "AccountNumber": "0010100063915101",
      "Amount": 0
}

Getting sensitive card information

If you want to receive sensitive card details in response after card is issued, you have to specify optional query parameters show_cvv and show_pan as true

In the response you will get PAN and CVV

{
	"Token": "d8605c86-d50c-4525-a9b1-81dec81304a9",
	"PAN": "4545230000007576",
	"CVV": "456",
	"ExpiryDate": "2411",
  ...
  ...
}

Getting not sensitive card information only

If you don't want to receive sensitive card details in response after card is issued, you may omit optional query parameters show_cvv and show_pan or supply them as false

In the response you will not get CVV and will get masked PAN accordingly.

{
	"Token": "d8605c86-d50c-4525-a9b1-81dec81304a9",
	"PAN": "454523******7576",
	"ExpiryDate": "2411",
  ...
  ...
}

But anyway you will be able to retrieve the sensitive information later using /pan endpoint.

client.customers.customerId({ customerId }).cards.post([body, [options]]).then(...)

customers.customerId({ customerId }).cards.get([query, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)

List cards for customer

client.customers.customerId({ customerId }).cards.get([query, [options]]).then(...)

customers.customerId({ customerId }).cards.cardToken({ cardToken }).get([query, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)
  • cardToken The token of the card returned when card was issued (type: string)

Retrieve card

client.customers.customerId({ customerId }).cards.cardToken({ cardToken }).get([query, [options]]).then(...)

customers.customerId({ customerId }).cards.cardToken({ cardToken }).patch([body, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)
  • cardToken The token of the card returned when card was issued (type: string)

Change mobile number

client.customers.customerId({ customerId }).cards.cardToken({ cardToken }).patch([body, [options]]).then(...)

customers.customerId({ customerId }).cards.cardToken({ cardToken }).status.put([body, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)
  • cardToken The token of the card returned when card was issued (type: string)

Change card status

client.customers.customerId({ customerId }).cards.cardToken({ cardToken }).status.put([body, [options]]).then(...)

customers.customerId({ customerId }).cards.cardToken({ cardToken }).pan.get([query, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)
  • cardToken The token of the card returned when card was issued (type: string)

Retrieve card PAN

client.customers.customerId({ customerId }).cards.cardToken({ cardToken }).pan.get([query, [options]]).then(...)

customers.customerId({ customerId }).cards.cardToken({ cardToken }).limits.post([body, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)
  • cardToken The token of the card returned when card was issued (type: string)

Set card limits

client.customers.customerId({ customerId }).cards.cardToken({ cardToken }).limits.post([body, [options]]).then(...)

customers.customerId({ customerId }).cards.cardToken({ cardToken }).limits.get([query, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)
  • cardToken The token of the card returned when card was issued (type: string)

Retrieve card limits

client.customers.customerId({ customerId }).cards.cardToken({ cardToken }).limits.get([query, [options]]).then(...)

customers.customerId({ customerId }).cards.cardToken({ cardToken }).transactions.get([query, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)
  • cardToken The token of the card returned when card was issued (type: string)

List transactions

client.customers.customerId({ customerId }).cards.cardToken({ cardToken }).transactions.get([query, [options]]).then(...)

customers.customerId({ customerId }).cards.cardToken({ cardToken }).balance.get([query, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)
  • cardToken The token of the card returned when card was issued (type: string)

Retrieve card balance

client.customers.customerId({ customerId }).cards.cardToken({ cardToken }).balance.get([query, [options]]).then(...)

customers.customerId({ customerId }).cards.cardToken({ cardToken }).balance.post([body, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)
  • cardToken The token of the card returned when card was issued (type: string)

Top up card from the account

client.customers.customerId({ customerId }).cards.cardToken({ cardToken }).balance.post([body, [options]]).then(...)

customers.customerId({ customerId }).cards.cardToken({ cardToken }).balance.patch([body, [options]])

  • customerId Customer ID as was provided after customer onboarding process (type: string)
  • cardToken The token of the card returned when card was issued (type: string)

Refund card to the account

client.customers.customerId({ customerId }).cards.cardToken({ cardToken }).balance.patch([body, [options]]).then(...)

health.get([query, [options]])

The healthcheck endpoint provides information about the health of API. If each of the components required by the service are healthy, then the service is considered healthy and will return a 200 OK response. If any of the components needed by the service are unhealthy, then a 503 Service Unavailable response will be provided.

client.health.get([query, [options]]).then(...)

License

Apache 2.0