1.0.1 • Published 3 years ago
cafebazaar_validation v1.0.1
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"
}
}