ZarinpalEngine

ZarinpalEngine

ZarinPal Engine Class Create a Connection between ZarinPal Gateway

Constructor

# new ZarinpalEngine(token)

Parameters:
Name Type Description
token String

API-Token of ZarinPal (Must be 36 Chars)

Members

# Errors

All Error Codes and Their Meaning

Methods

# CreatePayment(amount, callbackURL, options) → {Promise.<any>}

Create a Payment

Parameters:
Name Type Description
amount Number

Money Amount that you want in Tomans

callbackURL String

an URL that the user would be redirected after payment

options OptionalParams

Some optional stuff

Returns:

Whatver the axios would return

Type
Promise.<any>

# GetError(errorCode) → {String}

Get Error Message

Parameters:
Name Type Description
errorCode String

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

Returns:

Message in Persian

Type
String

# RefreshAuth(authCode, expireTime, sandBox) → {Promise.<any>}

Refresh an Auth Code to Work again

Parameters:
Name Type Default Description
authCode String

Authority Code that you recived after Creating a payment

expireTime Number

Amount of time that you want the authCode to work (in seconds)

sandBox Boolean false

Send the Request as a SandBox Request

Returns:

Whatver the axios would return

Type
Promise.<any>

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

Recive Failed(un-paied) Payments

Parameters:
Name Type Default Description
sandBox Boolean false

Fetch SandBox Payments

Returns:

Whatver the axios would return

Type
Promise.<any>

# VerifyPayment(amount, authCode, sandBox) → {Promise.<any>}

Verify a Created Payment

Parameters:
Name Type Default Description
amount Number

Money Amount that you want in Tomans

authCode String

Authority Code that you recived after Creating a payment

sandBox Boolean false

Send the Request as a SandBox Request

Returns:

Whatver the axios would return

Type
Promise.<any>