IDPayEngine

IDPayEngine

IDPay Engine Class Create a Connection between IDPay Gateway

Constructor

# new IDPayEngine(token)

Parameters:
Name Type Description
token String

IDPay API Token

Members

# Errors

All Error Codes and Their Meaning

# TransactionCodes

All Transactions Codes and their Meaning

Methods

# CreatePayment(id, amount, params) → {Promise.<any>}

Create a Payment

Parameters:
Name Type Description
id String

ID of Order/Payment - 50 Length at the Must

amount Number

Money Amount that you want in IRR (Rial)

params PaymentParams

Some Params that are optional

Returns:

Whatver the axios would return

Type
Promise.<any>

# GetError(statusCode, errorCode) → {String}

Get Error Message

Parameters:
Name Type Description
statusCode String

StatusCode that would be in the Response Header (such as 200, 404, ....)

errorCode String

Error code that you would recive in the callback from IDPay (a random number)

Returns:

Message in Persian

Type
String

# GetMessage(code) → {String}

Get Transaction Message by Code

Parameters:
Name Type Description
code String

Transaction Code

Returns:

Message in Persian

Type
String

# PaymentStatus(recivedID, createdID, sandBox) → {Promise.<any>}

Get Status of a Created Payment

Parameters:
Name Type Default Description
recivedID String

ID That you recived after Creating a payment with CreatePayment Method

createdID String

ID That you sent for Creating a Payment with CreatePayment Method

sandBox Boolean false

Send The Request as a SandBox Request

Returns:

Whatver the axios would return

Type
Promise.<any>

# Transactions(pageNumber, pageSize, sandBox) → {Promise.<any>}

Get a List of all Transactions

Parameters:
Name Type Default Description
pageNumber Number 0

Page Number to fetch the Transactions (default is 0)

pageSize Number 25

Data size that would be fetched from the Page (Default is the last 25)

sandBox Boolean false

Send The Request as a SandBox Request

Returns:

Whatver the axios would return

Type
Promise.<any>

# VerifyPayment(recivedID, createdID, sandBox) → {Promise.<any>}

Verify a Created Payment (or the Callback)

Parameters:
Name Type Default Description
recivedID String

ID That you recived after Creating a payment with CreatePayment Method

createdID String

ID That you sent for Creating a Payment with CreatePayment Method

sandBox Boolean false

Send The Request as a SandBox Request

Returns:

Whatver the axios would return

Type
Promise.<any>