How does it work?

User will be charged for Payment Authorization by the amount set in the parameter. This transactions will be reversed back to the card. However, it may take several days for the bank to reverse back the money to the card.
The payment Authorization amount charged will be hold until it is captured. If not, it will be auto reversed to the card.
Token is obtained from previous 3D Token API

PREAUTH BY TOKEN API

Item Detail
Production URL Endpoint (POST) https://app.senangpay.my/apiv1/preauth_by_token
Sandbox URL Endpoint (POST) https://sandbox.senangpay.my/apiv1/preauth_by_token

Authorization header

Item Detail
Username < your-merchant-id >
As listed in the profile settings page.
Password None, leave empty.

Request Paramaters (all is mandatory)

Item Detail
token Token obtained from 3D Token API.
amount Exact amount to capture.
E.g. 200 (for RM 2.00)
**captured amount must be equal or less than preauth amount**

Response Parameter

Item Detail
status Your transaction status. 1 if success. 0 if failed.
order_id Merchant Reference ID
preauth_id Preauth ID. Use this to capture transaction
amount_preauth Amount transacted from the credit card in integer format.
Eg. if the amount transacted is RM 2.00, it will output 200.
msg Transaction status message. If it was successful you will receive ‘Payment was successful’. If the transaction failed, you will receive the error message in this parameter for further checking.
hash

A string hashed with your secret key (from your profile setting page) in HMAC hashing algorithm with SHA256 in the following format:

< your merchant id >< status_id >< order_id >< preauth_id >< amount_preauth >< msg >
*without the <  > character

Leave a Reply