1.2.0 • Published 6 years ago

ascca-token-client v1.2.0

Weekly downloads
276
License
MIT
Repository
-
Last release
6 years ago

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

1.2.0

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago