Notification process

After receiving a notification, you need to verify the authenticity of the signature to ensure the data contained in the notification is originated from AlipayHK without being modified during the transmission. Only after verifying the content, you can trust the received notification and use the data contained in the notification in your own system for further process.

Note:

For the alipay.intl.acquiring.common.notify.pay API: 

You need to provide AlipayHK with the payment notify URL offline after the contract is signed so that it can be configured accordingly for payment notification.

After the transaction succeeds, including both the agreement and WAP payment, you will receive both asynchronous and synchronous responses from our payment gateway. It is recommended to process the asynchronous notification. You don't need to verify both of the asynchronous notification and synchronous notification.

Below is one example of the payment notification sent to the merchant-provided notify_url. After the program is executed, you need to reply a resultCode of "SUCCESS" to AlipayHK. If not, AlipayHK server will keep re-sending the notification, until over 24 hour 22 minutes. Generally, there are 8 notifications within 25 hours (Frequency: 2m,10m,10m,1h,2h,6h,15h).

Request

copy
{
    "request":{
        "head":{
           "version":"2.0.0",
            "function":"alipay.intl.acquiring.common.notify.pay",
           "clientId":"2014000014442",
           "reqTime":"2001-07-04T12:08:56+05:30",
           "reqMsgId":"1234567asdfasdf1123fda",
            "reserve":"{}"
        },
        "body":{
            "resultInfo":{
               "resultStatus":"S",
               "resultCodeId":"00000000",
               "resultCode":"SUCCESS",
               "resultMsg":"success"
            },
           "acquirementId":"201503       2412007101547201352747",
           "merchantTransId":"51051001000000000002",
            "orderAmount":{
               "currency":"USD",
               "value":"239"
            },
           "paymentTime":"2016-07-04T12:08:56+05:30",
           "extendInfo":"{}"
        }
    },
    "signature":"signature string"
}

Response

copy
{  
   "response":{  
      "head":{  
         "version":"2.0.0",
         "function":"alipay.intl.acquiring.common.notify.pay",
         "clientId":"4Q5XPV504B0A5302",
         "respTime":"2018-12-14T12:57:29+05:30",
         "reqMsgId":"2018-12-13-4966a937-2987-4d5f-bda4-94fc10622f41",
         "reserve":"{}"
      },
      "body":{  
         "resultInfo":{  
            "resultStatus":"S",
            "resultCodeId":"00000000",
            "resultCode":"SUCCESS",
            "resultMsg":"success"
         }
      }
   },
   "signature":"lWPNGhCPdtYH7LjNztxbMPln5zs5+ditM4e4cRMRhkvyiVK82PgzoWGSnWNwg77Epipc7NMpNNnpJrxjOQSeTqOLATCNN85v1l5SWWzzPMVv4w5tMq62KT1p33A0XuoqR92UX/H3RbJvUV2EjiDlx2PFMJt1rRVZBaNkxIq/ynCMA3lI1sQ1TXbgP6SEzvQh+WTJHxZcFVIyCHRDfyofNssW+tXwHB7zTF2G1cNbLTR4xKQ6dldA40inU9+zvavybuMWCNO7To6YUeg3SPyHEGM7NrG0GQYndCxXZSteJYcj+gvcOHIih5N7BboGtwB/eo5F3yjwe0GG5DrC+hhnoA=="
}

For the alipay.intl.oauth.auth.notify.cancel API: 

You need to provide AlipayHK with the cancel notify URL offline after the contract so that it can be configured accordingly.

After the contract is unbounded by users via AlipayHK APP or from the merchant end, you will receive both asynchronous and synchronous responses. It is recommended to process the asynchronous notification. You don't need to verify both of the asynchronous notification and synchronous notification.

Request 

copy
{
"request": {
"body": {
"cancelTime": "2018-12-28 02:57:44",
"merchantAgreementId": "a431c90c97aa4e1b930ad448369c5092",
"resultInfo": {
"resultCode": "SUCCESS",
"resultCodeId": "00000000",
"resultMsg": "Success",
"resultStatus": "S"
}
},
"head": {
"clientId": "4Q5XPW44SG002Z03",
"function": "alipay.intl.oauth.auth.notify.cancel",
"reqMsgId": "2018-12-27-0255acf7-0b4f-48e2-9125-ca5502727088",
"reqTime": "2018-12-27T19:57:45-08:00",
"version": "2.0.0"
}
},
"signature": "xxx"
}

Response

copy
{
    "response": {
        "head": {
            "version": "2.0.0",
            "function": "alipay.intl.oauth.auth.notify.cancel",
            "clientId": "4Q5XPW44SG002Z03",
            "respTime": "2018-12-28T03:57:48+08:00",
            "reqMsgId": "2018-12-27-0255acf7-0b4f-48e2-9125-ca5502727088"
        },
        "body": {
            "resultInfo": {
                "resultStatus": "S",
                "resultCodeId": "00000000",
                "resultCode": "SUCCESS",
                "resultMsg": "success"
            }
        }
    },
    "signature": "xxx"
}