ehcaning / myket_validation

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

Home Page:https://www.npmjs.com/package/myket_validation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Myekt Validation

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

Instantiate module

const myket = require('myket_validation')(access_token, package_name);

Validate Payment

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

Success Example:

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

Error Example:

{
  "status": 404,
  "data": {
    "code": 404,
    "messageCode": "SkuIdNotFound",
    "translatedMessage": "محصول درون برنامه ای یافت نشد"
  }
}

About

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

https://www.npmjs.com/package/myket_validation

License:MIT License


Languages

Language:JavaScript 100.0%