Credit Card
Signature
All requests to and from the Espay server require a signature parameter. All traders must validate this parameter to ensure that the request only comes from the Espay server and the Merchant server.
Transaction signatures are generated using the SHA256 hash algorithm. The following explains how to generate transaction signatures:
- Signature key: A key is used to generate a signature that is provided by the Espay Integration Team
- comm_code: Parameter dealer code provided by the Espay Integration Team
- trx_id: Transaction ID of the merchant
- amount: Amount of the dealer
The order of signature combining process is as follows:
Tokenization:
- Signature Key
- comm_code
- trx_id
- amount
Capture:
- Signature Key
- comm_code
- trx_id
- amount
Void:
- Signature Key
- comm_code
- trx_id
Refund:
- Signature Key
- comm_code
- trx_id
- amount
These fields must be arranged in the following order, separated by ##
##comm_code##trx_id##amount##
Next, the string must be converted to UPPERCASE before the hash is performed.
Example :
##SGWTEST##test001##100000##
All strings must be capitalized as follows:
##SGWTEST##TEST001##100000##
Results according to Hashes and Algorithm256
d0f8d02e651802c0c6984794adc78c9b09cd53d504ee13456d8ee2121d20
Tokenization
This process is used when the merchant already has credit card information provided by Espay and wants to make transactions with the token.
Flow Message
Merchant → Espay
Method
HTTP Post
API URL
Development : https://sandbox-api.espay.id/rest/creditcard/tokenpayment
Production : https://api.espay.id/rest/creditcard/tokenpayment
Parameter Request:
Parameter Name | Max Length | Mandatory | Description |
rq_uuid | 64 | Yes | Request ID. Unique ID to identify this message with other messages |
rq_datetime | 19 | Yes | Date and time on the partner server at which the message was sent |
comm_code | 32 | Yes | Dealer code registered at Espay |
masked_card_no | 20 | Yes | Masked credit card number |
store_card_number | 20 | Yes | Token given by Espay |
trx_id | 32 | Yes | A unique transaction ID number to identify the order / settlement / invoice. |
description | 19 | Yes | Payment Description |
cardname | 32 | Yes | Name of the credit card holder |
32 | Yes | Credit card holder's email | |
ccy | 5 | Yes | Currency |
amount | 20 | Yes | Payment amount |
call_back_url | 32 | No | Url back |
signature | 64 | Yes | The signature is created by the dealer and validated by Espay. More information can be found on this page |
After making a request using the example above, the client receives a response as follows:
Parameter Response:
Parameter Name | Max Length | Mandatory | Description |
rq_uuid | 4 | Yes | Request ID. Unique ID to identify this message and other messages |
rs_datetime | 32 | Yes | The date and time of the Espay server on which the reply message was sent |
trx_id | 32 | Yes | A unique transaction ID number to identify the order / settlement / invoice. |
error_code | 4 | Yes | Web service error code, 0000 = Successful, 9999 = Failed / timed out error_code is only used to report the success / failure of this service as the status of successful / failed payments is sent through the payment notification service |
error_message | 32 | Yes | Error description |
Capture Payment
This process is used when the trader wants to capture a transaction that is currently in progress.
Flow Message
Merchant → Espay
Method
HTTP Post
API URL
Development : https://sandbox-api.espay.id/rest/creditcard/capturepayment
Production : https://api.espay.id/rest/creditcard/capturepayment
Parameter Request:
Parameter Name | Max Length | Mandatory | Description |
rq_uuid | 64 | Yes | Request ID. Unique ID to identify this message with other messages |
rq_datetime | 19 | Yes | Date and time on the partner server at which the message was sent |
comm_code | 32 | Yes | Dealer code registered at Espay |
trx_id | 32 | Yes | A unique transaction ID number to identify the order / settlement / invoice. |
amount | 20 | Yes | Payment amount |
signature | 64 | Yes | The signature is created by the dealer and validated by Espay. More information can be found on this page |
After making a request using the example above, the client receives a response as follows:
Parameter Response:
Parameter Name | Max Length | Mandatory | Description |
rq_uuid | 4 | Yes | Request ID. Unique ID to identify this message and other messages |
rs_datetime | 32 | Yes | The date and time of the Espay server on which the reply message was sent |
trx_id | 32 | Yes | A unique transaction ID number to identify the order / settlement / invoice. |
status_transaction | 32 | Yes | Enter the current transaction status S: success Q: Failed |
error_code | 4 | Yes | Web service error code, 0000 = Successful, 9999 = Failed / timed out error_code is only used to report the success / failure of this service as the status of successful / failed payments is sent through the payment notification service |
error_message | 32 | Yes | Error description |
Void Payment
This process is used when the trader wants to cancel an ongoing transaction.
Flow Message
Merchant → Espay
Method
HTTP Post
API URL
Development : https://sandbox-api.espay.id/rest/creditcard/voidpayment
Production : https://api.espay.id/rest/creditcard/voidpayment
Parameter Request:
Parameter Name | Max Length | Mandatory | Description |
rq_uuid | 64 | Yes | Request ID. Unique ID to identify this message with other messages |
rq_datetime | 19 | Yes | Date and time on the partner server at which the message was sent |
comm_code | 32 | Yes | Dealer code registered at Espay |
trx_id | 32 | Yes | A unique transaction ID number to identify the order / settlement / invoice. |
amount | 20 | Yes | Payment amount |
signature | 64 | Yes | The signature is created by the dealer and validated by Espay. More information can be found on this page |
After making a request using the example above, the client receives a response as follows: Parameter Response:
Parameter Response:
Parameter Name | Max Length | Mandatory | Description |
rq_uuid | 4 | Yes | Request ID. Unique ID to identify this message and other messages |
rs_datetime | 32 | Yes | The date and time of the Espay server on which the reply message was sent |
trx_id | 32 | Yes | A unique transaction ID number to identify the order / settlement / invoice. |
status_transaction | 32 | Yes | Enter the current transaction status S: success Q: Failed |
error_code | 4 | Yes | Web service error code, 0000 = Successful, 9999 = Failed / timed out error_code is only used to report the success / failure of this service as the status of successful / failed payments is sent through the payment notification service |
error_message | 32 | Yes | Error message |
Refund Payment
This process is used when the merchant wants to refund a transaction that is currently in progress.
Flow Message
Merchant → Espay
Method
HTTP Post
API URL
Development : https://sandbox-api.espay.id/rest/creditcard/refundpayment
Production : https://api.espay.id/rest/creditcard/refundpayment
Parameter Request:
Parameter Name | Max Length | Mandatory | Description |
rq_uuid | 64 | Yes | Request ID. Unique ID to identify this message with other messages |
rq_datetime | 19 | Yes | Date and time on the partner server at which the message was sent |
comm_code | 32 | Yes | Dealer code registered at Espay |
trx_id | 32 | Yes | A unique transaction ID number to identify the order / settlement / invoice. |
amount | 20 | Yes | Payment amount |
signature | 64 | Yes | The signature is created by the dealer and validated by Espay. More information can be found on this page |
After making a request using the example above, the client receives a response as follows:
Parameter Response:
Parameter Name | Max Length | Mandatory | Description |
rq_uuid | 4 | Yes | Request ID. Unique ID to identify this message and other messages |
rs_datetime | 32 | Yes | The date and time of the Espay server on which the reply message was sent |
trx_id | 32 | Yes | A unique transaction ID number to identify the order / settlement / invoice. |
status_transaction | 32 | Yes | Enter the current transaction status S: success Q: Failed |
error_code | 4 | Yes | Web service error code, 0000 = Successful, 9999 = Failed / timed out error_code is only used to report the success / failure of this service as the status of successful / failed payments is sent through the payment notification service |
error_message | 32 | Yes | Error description |