https://github.com/ehcaning/cafebazaar_validation
A simple npm module for validate https://cafebazaar.ir/ payments
https://github.com/ehcaning/cafebazaar_validation
Last synced: 4 months ago
JSON representation
A simple npm module for validate https://cafebazaar.ir/ payments
- Host: GitHub
- URL: https://github.com/ehcaning/cafebazaar_validation
- Owner: ehcaning
- License: mit
- Created: 2020-04-10T16:15:16.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-10T23:40:14.000Z (almost 2 years ago)
- Last Synced: 2025-02-04T20:06:43.518Z (4 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/cafebazaar_validation
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cafebazaar Validation
A simple npm module for validate https://cafebazaar.ir/ payments## Installation
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/).
Before installing, [download and install Node.js](https://nodejs.org/en/download/).Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):```bash
$ npm install cafebazaar_validation
```## Instantiate module
```js
const cafebazaar = require('cafebazaar_validation')(client_id, client_secret, refresh_token, package_name);
```Example:
```js
const cafebazaar = require('cafebazaar_validation')(
'client_id',
'client_secret',
'refresh_token',
'package_name'
);
```## Validate Payment
```js
let res = await cafebazaar.validate(sku, token);
```Success Example:
```json
{
"status": 200,
"data": {
"consumptionState": 0,
"purchaseState": 0,
"kind": "androidpublisher#inappPurchase",
"developerPayload": "",
"purchaseTime": 1586530039266
}
}
```Error Example:
```json
{
"status": 404,
"data": {
"error_description": "The requested purchase is not found!",
"error": "not_found"
}
}
```