2.2.7 • Published 4 years ago

@ppay/api v2.2.7

Weekly downloads
30
License
ISC
Repository
-
Last release
4 years ago

Setup

This module is a JS wrapper for pay.expo HTTP API, for manual connection please contact our support. npm install @ppay/api

Getting started:

PPay API provides simple yet comprehensive payment gateway functionality for your online website. To start using API right away, simply import PPAY class from the module you have just installed:

import PPAY from @ppay/api

From here on, you can create instance of PPAY class:

const ppay = new PPAY({
  apiKey: PPAY_API_KEY,
  apiSecret: PPAY_API_SECRET,
  merchantName: PPAY_MERCHANT_NAME
})

You can simply define these variables as a part of your environment and they will automatically be used:

PPAY_API_KEY, PPAY_MERCHANT_NAME, PPAY_API_SECRET

Available methods:

When you have successfully created a PPay class constructor, you can use such methods to create requests to PPay API: |Name|Description|Parameters|Response| |----|-----------|----------|--------| |getWallets|GET request, returns a response object containing currently available balances at users wallets for each currency + USD equivalent and a total amount in USD.|Doesn’t take any parameters|Returns two objects, each containing a series of fields. Each field key indicates currency type, while string values resemble the available balance. toUSD object displays the prices of each currency in USD equivalent and displays total balance in USD equivalent.| |createPermanentMerchantAddress|POST request that defines a permanent address for your mechant in the EXPO Pay system database and returns a response object containing this address.|merchantName:string — defines the name of the merchant, can be found at the Merchants section of the Dashboard. currency:”BTC|ETH|USDT” — defines supported payment methods. Values for this parameter are taken automatically. meta:string — defines metadata. Optional parameter.|CreateMerchantPermanentAddressResponse — returns a string containing the Permanent merchant address in the database. Can also return optional user-defined parameters, such as: name of the merchant, supported payment methods and metadata.| |getMinerFee|GET request that returns a calculated amount of the miner's fee, based on the amount of funds to be transferred.|currency:”BTC|ETH|USDT” — currency used to commit a transaction. amount:string — amount of funds to be transferred. Note: For BTC & ETH transactions, amount must contain 6 or less digits after decimal point. For USDT, amount must contain 8 digits or less after decimal point.address:string — wallet address for the funds to be transferred to. fast: boolean — indicates, whether transaction speed is regular or high-speed.|GetMinerFeeResponse — returns a string containing the amount of miner’s fee to be paid.| |Withdraw|POST request that creates a withdrawal order within the EXPO Pay system to send money from internal balance to a specified wallet and returns a response object|description: string — optional parameter currency:”BTC|ETH|USDT” — currency used to commit a transaction. amount: string — mount of funds to be withdrawn. minerFee: string — amount of funds to be paid as a miner’s fee. to: string — destination wallet address. merchantName: string — name of the Merchant. Optional parameter. orderId: string — ID of the withdrawal order. Optional parameter. meta: string — metadata — optional parameter.|WithdrawResponse — returns an object, containing strings that specify the amount of funds withdrawn, amount of miner’s fee paid and order ID.|

2.2.7

4 years ago

2.1.6

4 years ago

2.1.5

4 years ago

2.1.4

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.3

4 years ago

2.0.8

4 years ago

2.1.0

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago