JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 54
  • Score
    100M100P100Q64920F
  • License MIT

API client for token processing by connecting to assca

Package Exports

  • ascca-token-client

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ascca-token-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ascca-token-client

Build Status

AsccaTokenClient is a JavaScript library for GMO Payment Gateway token settlement.

Installation

npm install ascca-token-client

Usage

class AsccaTokenClient

Client for tokenization. Initialization by passing shopId and options.

const AsccaTokenClient = require("ascca-token-client").AsccaTokenClient;
const asccaTokenClient = new AsccaTokenClient(shopId, options = {production: false});

getToken(cardNumber, cardExpired)

Passing cardNumber and cardExpired will return a token. The cardExpired(expiration date) format is "YYMM".

const asccaTokenClient = new AsccaTokenClient('testshopid000000');

asccaTokenClient.getToken('4111111111111111', '2210').then((value) => {
  console.log(value);
}, (error) => {
  console.error("error:", error);
});

url

The production or test URL will be returned.

const asccaTokenClient1 = new AsccaTokenClient("testshopid000000");

// test URL is returned
asccaTokenClient1.url;

const asccaTokenClient2 = new AsccaTokenClient("testshopid000000", options = {production: true});

// production URL is returned
asccaTokenClient2.url;

Sample

For browsers.

git clone git@github.com:kurotaky/ascca-token-client.git
cd ascca-token-client
npm i
npm run build
npm run webpack
open sample.html

Try putting your card number and expiration date in form.

License

MIT