Callback binding
This API is implemented on the merchant site for receiving callbacks from Zalopay for payment.
- application/json
Request Body required
- data string
Zalopay transaction data callback to the application
Data is Json String has field:
app_id(int): Binding's app_id
app_trans_id(string): Binding's app_trans_id.
binding_id(string): The id of binding has been confirmed in the Zalopay system.
pay_token(string): The public token is used when doing auto-debit.
server_time(long): Server time.
merchant_user_id(string): The identifier field in bind request.
status(int): 1: Confirmed, 3: Cancelled.
msg_type(int): 1: The user confirms an agreement, 2: The user updates the agreement.
zp_user_id(string): The identifier of Zalopay user per merchant app_id.
masked_user_phone(string): Masked user phone (Ex: masked_user_phone: "****6938")Data sample:
{"data": "{\"app_id\":123007,\"app_trans_id\":\"260507_13340505426\",\"binding_id\":\"260507KzXdbBvR1rVxyHRWE242m7va8Y\",\"pay_token\":\"MJGYZTAWNMYTNME1ZS0ZNMUZLWI3MZUTZDJMYTK4ZJY2MMFM\",\"merchant_user_id\":\"Test Balance\",\"zp_user_id\":\"zuINqcgQ6zwn4lLYMLEzrUOdTAy-PyJL02lrw6MTmw0\",\"masked_user_phone\":\"****3801\",\"server_time\":1778135665,\"status\":1,\"msg_type\":1,\"expiry_timestamp_in_ms\":2093754865481}","mac": "6f193df9202d42d95e2ebfb1b98ca715a547e0f78b902f4c9868297ddac92df2","type": 2} - mac string
Authentication information mac = HMAC(hmac_algorihtm, callback key, hmacinput), see as below:
- hmac_algorihtm: is a security method registered by Merchant with Zalopay, the default is HmacSHA256.
- callback key: provided by Zalopay at registration.
- hmacinput = data - type int
Callback type
2: Agreement
- 200
OK
- application/json
- Schema
- Example (from schema)
Schema
- return_code int
1: Success.
2: Invalid. - return_message string
Success: in case retun_code=1.
Invalid: in case return_code=2.
{
"return_code": 0,
"return_message": "string"
}