new ZarinPalDriver()
Class to interact with the ZarinPal payment gateway.
- Source
Methods
(async) request(data, sandboxopt) → {Promise.<TransactionCreateResponseZp>}
Create a payment request to ZarinPal.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
data | TransactionCreateInputZp | Input data for creating the transaction. | ||
sandbox | boolean | <optional> | false | Flag to determine whether to use the sandbox environment. |
- Source
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:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
data | TransactionCreateInputZp | Input data for creating the transaction. | ||
sandbox | boolean | <optional> | false | Flag to determine whether to use the sandbox environment. |
- Source
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:
Name | Type | Description |
---|---|---|
merchant_id | string | The merchant ID to set. |
- Source
Returns:
Instance of ZarinPalDriver.
- Type:
- this
setToken(merchant_id) → {this}
Set the merchant ID for the ZarinPal driver.
Parameters:
Name | Type | Description |
---|---|---|
merchant_id | string | The merchant ID to set. |
- Source
Returns:
Instance of ZarinPalDriver.
- Type:
- this
(async) verify(data, sandboxopt) → {Promise.<TransactionVerifyResponseZp>}
Verify a payment transaction with ZarinPal.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
data | TransactionVerifyInputZp | Input data for verifying the transaction. | ||
sandbox | boolean | <optional> | false | Flag to determine whether to use the sandbox environment. |
- Source
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:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
data | TransactionVerifyInputZp | Input data for verifying the transaction. | ||
sandbox | boolean | <optional> | false | Flag to determine whether to use the sandbox environment. |
- Source
Returns:
Response from the ZarinPal API for verifying a transaction.
- Type:
- Promise.<TransactionVerifyResponseZp>