Notification

After a successful order payment or refund, if a notifyUrl is available, the URL will be requested to send order status. The HTTP method is POST.

Double Verification to Confirm Payment Success

  1. Call Query APIs: Keep obtaining order status by querying the Order Inquiry API or Refund Inquiry API until the status is successful or failed
  2. Asynchronous Notification: When a customer's payment or refund is successful, AlphaPay server will asynchronously notify the merchant server.

Rules For Pushing Notifications

Payment Order:

  • After the order is successfully paid, it will be immediately pushed (with up to 3 attempts).
  • Notifications that fail to be pushed will be continuously pushed within 24 hours after payment (at an interval of 30 minutes).
  • If the push is successful or the payment has been completed more than 24 hours, no more pushes will be made.

Refund Order:

  • After a successful refund, a notification will be immediately pushed (with 1 attempt).
  • The refund notification will only be pushed once, and no further attempts will be made regardless of whether the push is successful or not.

Note: The merchant system should be able to handle duplicate requests.

Push Notification Request

The structure of the push request is as follows. Merchants must verify the request signature before processing the transaction.

  • Http Method: POST(only POST requests are supported for push requests)
  • Http Headers: When pushing a request, the following request headers will be included:
    • Merchant-Code: Merchant code provided by AlphaPay
    • Request-Time: Specifies the time when a request is sent, as defined by ISO 8601. This field must be accurate to milliseconds. E.g.: 2019-05-28T12:12:12+08:00
    • Nonce: Random String with length of 32
    • Signature: The signature information, like a response from other interfaces, a signature generated using AlphaPay's private key is added to the header. Merchants need to use AlphaPay's public key to verify the signature after receiving the request. The format of the signature content is the same as the signature requested by the merchant from AlphaPay. Please refer to Signature Algorithm - Handle a Response for more details.
  • Http Body:The content of the push request is in JSON format. The content of the push is consistent with the response content of the Order Inquiry API or Refund Inquiry API(without the result field).

Push Notification Response

When receiving push notifications, merchant's server should send a success message response back to AlphaPay.

The response does not require signature. The response content is a JSON body that includes a result field, the result is a JSON object, which includes resultCode, resultStatus and resultMessage fields. The resultCode field must be SUCCESS and the resultStatus field must be S, which indicate the success of the push result.

If the resultCode is not filled in as SUCCESS or resultStatus is not filled in as S, AlphaPay will consider the push as unsuccessful and will continue to push within 24 hours after the transaction is completed.

A example is as follows:

Response Body
{
 "result": {
    "resultCode":"SUCCESS",
    "resultStatus":"S",
    "resultMessage":"success"
   }
}