ZarinPalDriver

new ZarinPalDriver()

Class to interact with the ZarinPal payment gateway.

Methods

(async) request(data, sandboxopt) → {Promise.<TransactionCreateResponseZp>}

Create a payment request to ZarinPal.
Parameters:
NameTypeAttributesDefaultDescription
dataTransactionCreateInputZpInput data for creating the transaction.
sandboxboolean<optional>
falseFlag to determine whether to use the sandbox environment.
Returns:
Response from the ZarinPal API for creating a transaction.
Type: 
Promise.<TransactionCreateResponseZp>

(async) request(data, sandboxopt) → {Promise.<TransactionCreateResponseZp>}

Create a payment request to ZarinPal.
Parameters:
NameTypeAttributesDefaultDescription
dataTransactionCreateInputZpInput data for creating the transaction.
sandboxboolean<optional>
falseFlag to determine whether to use the sandbox environment.
Returns:
Response from the ZarinPal API for creating a transaction.
Type: 
Promise.<TransactionCreateResponseZp>

setToken(merchant_id) → {this}

Set the merchant ID for the ZarinPal driver.
Parameters:
NameTypeDescription
merchant_idstringThe merchant ID to set.
Returns:
Instance of ZarinPalDriver.
Type: 
this

setToken(merchant_id) → {this}

Set the merchant ID for the ZarinPal driver.
Parameters:
NameTypeDescription
merchant_idstringThe merchant ID to set.
Returns:
Instance of ZarinPalDriver.
Type: 
this

(async) verify(data, sandboxopt) → {Promise.<TransactionVerifyResponseZp>}

Verify a payment transaction with ZarinPal.
Parameters:
NameTypeAttributesDefaultDescription
dataTransactionVerifyInputZpInput data for verifying the transaction.
sandboxboolean<optional>
falseFlag to determine whether to use the sandbox environment.
Returns:
Response from the ZarinPal API for verifying a transaction.
Type: 
Promise.<TransactionVerifyResponseZp>

(async) verify(data, sandboxopt) → {Promise.<TransactionVerifyResponseZp>}

Verify a payment transaction with ZarinPal.
Parameters:
NameTypeAttributesDefaultDescription
dataTransactionVerifyInputZpInput data for verifying the transaction.
sandboxboolean<optional>
falseFlag to determine whether to use the sandbox environment.
Returns:
Response from the ZarinPal API for verifying a transaction.
Type: 
Promise.<TransactionVerifyResponseZp>