1.0.1 • Published 3 years ago

cafebazaar_validation v1.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

Cafebazaar Validation

A simple npm module for validate https://cafebazaar.ir/ payments

Installation

This is a Node.js module available through the npm registry. Before installing, download and install Node.js.

Installation is done using the npm install command:

$ npm install cafebazaar_validation

Instantiate module

const cafebazaar = require('cafebazaar_validation')(client_id, client_secret, refresh_token, package_name);

Example:

const cafebazaar = require('cafebazaar_validation')(
    'client_id',
    'client_secret',
    'refresh_token',
    'package_name'
);

Validate Payment

let res = await cafebazaar.validate(sku, token);

Success Example:

{
  "status": 200,
  "data": {
    "consumptionState": 0,
    "purchaseState": 0,
    "kind": "androidpublisher#inappPurchase",
    "developerPayload": "",
    "purchaseTime": 1586530039266
  }
}

Error Example:

{
  "status": 404,
  "data": {
    "error_description": "The requested purchase is not found!",
    "error": "not_found"
  }
}
1.0.1

3 years ago

1.0.0

4 years ago