# ascca-token-client

> API client for token processing by connecting to assca

Latest version **1.2.0** (published 2018-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install ascca-token-client
pnpm add ascca-token-client
yarn add ascca-token-client
bun add ascca-token-client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2018-09-18 |
| First published | 2018-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 31.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yuta Kurotaki |
| Maintainers | kurotaky |
| Keywords | tokenization, api-client |

## Links

- npm: https://www.npmjs.com/package/ascca-token-client
- npm.io page: https://npm.io/package/ascca-token-client

## Dependencies (2)

- [es6-promise](https://npm.io/package/es6-promise.md) ^4.2.4
- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) ^2.2.1

## Recent versions

- 1.2.0 (latest) — 2018-09-18
- 1.1.5 — 2018-04-02
- 1.1.4 — 2018-03-23
- 1.1.3 — 2018-03-09
- 1.1.2 — 2018-02-26
- 1.1.1 — 2018-02-15
- 1.1.0 — 2018-02-15
- 1.0.0 — 2018-02-06

## README

# ascca-token-client

<a href="https://www.npmjs.com/package/ascca-token-client" title="npm"><img src="http://img.shields.io/npm/v/ascca-token-client.svg?style=flat-square"></a>
[![Build Status](https://travis-ci.org/kurotaky/ascca-token-client.svg?branch=master)](https://travis-ci.org/kurotaky/ascca-token-client)

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.

```js
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".

```js
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.

```js
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](https://github.com/kurotaky/ascca-token-client/blob/master/LICENSE)

---
_Source: https://npm.io/package/ascca-token-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
