Capture
How to Capture an Authorization?
If you want to clear previously authorized funds you have to use capture against a preauthorization payment. You can choose between full and partial capture.
The paymentID will be referred and a POST request will be send over HTTPS to the /transactionServices/REST/v1/payments/{id} endpoint.
To Capture the transaction, you have to send the paymentType as CP.
Request specification.
| Parameter | Description | Format | Required |
|---|---|---|---|
| authentication.memberId | Unique merchant member ID provided by TWPayz. | N10 [0-9]{1,10} |
Yes |
| authentication.checksum | MD5 checksum generated using merchant credentials for request authentication. | AN32 [a-fA-F0-9]{32} |
Yes |
| amount | Amount of the transaction. The dot needs to add to separate the decimal. | N13 [0-9]{1,10}\.[0-9]{2} |
Yes |
| paymentType | Request to inquire the detail information of the previously placed transaction. | A2 ((CP)) |
Yes |
| paymentId | Unique transaction reference generated by the merchant. | AN1024 [a-zA-Z0-9\\p{Space}\\-_.]{1,1024} |
Yes |
Response specification.
| Parameter | Description | Format | Required |
|---|---|---|---|
| paymentId | Unique payment identifier generated by TWPayz. | N10 [0-9] |
Yes |
| result.code | Response code indicating the transaction status. | AN11 [0-9\.]{2,11} |
Yes |
| result.description | Description corresponding to the response code. | AN255 [a-zA-Z0-9\\p{Space}\\,]+[a-zA-Z0-9\\p{Space}\\,]+ |
Yes |
| timestamp | Shows at what time the transaction has been placed. | date yyyy-MM-dd hh:mm:ss |
Yes |
Sample Request

Sample Response

Hashing Rule
TWPayz is supporting MD5 Cryptographic Hash for the authenticity of payment request send to the server.
Below are the description of fields used for generating checksum:
- memberId <Merchant ID as shared by TWPayz>
- secureKey <Secure Key that can be generated through TWPayz's dashboard>
- paymentId <Id of previous transaction>
How to generate Checksum?
Checksum has to be calculated with following combination & needs to be send along with the authentication parameters in each server-to-server request:
Capture Payment:
<memberId>|<secureKey>|<paymentId>|<amount>
Sample Code
