1.0.1 • Published 3 years ago

iranapps_validation v1.0.1

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

Iranapps Validation

A simple npm module for validate https://iranapps.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 iranapps_validation

Instantiate module

const iranapps = require('iranapps_validation')(client_id, client_secret, refresh_token, package_name);

Example:

const iranapps = require('iranapps_validation')(
    'client_id',
    'client_secret',
    'refresh_token',
    'package_name'
);

Validate Payment

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

Success Example:

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

Error Example:

{
  "status": 200,
  "data": {
    "error_code": 404,
    "error_description": "The requested purchase was not found!"
  }
}