Payment Request API

For Alipay on-line payment via Ailpay Wallet while Web App H5 running on mobile browser

The link for payment button on merchant's web page to allow customer to activated Alipay Wallet payment process.

👉 Once Alipay payment process finished, web browser will be redirected to the following returnURL defined by the merchant according to its own business needs with receiving Alipay payment result.

https://mppay.ottpay.com/wapPay?merCode=××××&merchantId=××××&orderId=××××&operId=×××××&amount=××××&returnURL=××××&notifyURL=××××

☑️ Request Parameters (need be URL encoded )

*️ Prefixed URL

https://mppay.ottpay.com/wapPay?

*️ merCode

merCode is the merchant payment key. Once a merchant accept OTT Pay WeChat Official Account service , OTTPay operation team will send this code through welcome email.

*️ merchantId

merchantId is a merchant ID created by OTTPAY. Once a merchant starts OTTPAY payment service, OTTPAY operation team will send this ID through welcome email.

*️ orderId

orderId is a customized order ID provided by merchant. Once an order is placed, merchant need to send this order ID.

*️ amount

Amount of the order. Merchant need to send the amount to OTT server.

Note: The number is based on cents, which means 100 for 1.00 dollar.

*️ operId

operId is an operator number with 10-digit created by OTTPAY. Once a merchant starts OTTPAY payment service, OTTPAY operation team will send this ID through welcome email.

*️ returnURL (need be encoded with Base64)

returnURL is the link to the order processing page to be displayed by the merchant after the payment request is returned, which is defined by the merchant according to its own business needs. That is, after payment is completed, Alipay redirects back to this page of the merchant's website

returnURL=aHR0cHM6Ly93d3cub3R0cGF5LmNvbS9yZXN1bHQ= 
(Base64 encoded value of https://www.ottpay.com/result)

*️ notifyURL (need be encoded with Base64)

notifyURL is the callback URL of the merchant, which be called with the payment result from OTTPAY.

notifyURL=aHR0cHM6Ly93d3cub3R0cGF5LmNvbS9jYWxsYmFjaw== 
(Base64 encoded value of https://www.ottpay.com/callback)
https://mppay.ottpay.com/wapPay?merCode=66e201e8d8f9415be8eb9c1e6e0b308e&merchantId=ON00000097&orderId=2020060919257O266O1801&operId=0000000436&amount=1&returnURL=aHR0cHM6Ly9lenNob3BzLm90dC5jYS9tb2JpbGUvQWxpSDVPVFRQQVlfY2FsbGJhY2sucGhw&notifyURL=aHR0cHM6Ly9lenNob3BzLm90dC5jYS9tb2JpbGUvQWxpSDVPVFRQQVlfY2FsbGJhY2sucGhw

After payment process finished, the result will be sent back by redirecting to the following payment result Web Page URL link.

http://newURL/xxx?total_fee=XXXX&trade_no=XXXX&out_trade_no=XXXX&trade_status=XXXX

☑️ Return URL Parameters (need be decoded with Base64)

*️ Prefixed URL

Prefixed URL is a customized page for order processing, /xxx is an additional page for the merchant according to their own business. e.g.

https://ezshops.ott.ca/mobile/AliH5OTTPAY_callback.php

*️ total_fee

total_fee is the request amount of the order from the merchant. Number, 100 for 1.00 dollar.

*️ trade_no

trade_no is the internal order number returned from Alipay.

*️ out_trade_no

out_trade_no is the order number returned from Alipay.

*️ trade_status

trade_status shows the result of the payment. Payment succeed returns " Trade_Finished".


https://ezshops.ott.ca/mobile/AliH5OTTPAY_callback.php?currency=CAD&out_trade_no=AL2192407938683822&total_fee=0.01&trade_no=2020061022001367651432273894&trade_status=TRADE_FINISHED&sign=aTTXuUU8DD4J11vwsu%2Bx%2FonuesJ%2Ba73bIXrDTgbOze1Df35H6x8cSt9Rk9b9hqQksF8QobWU7Zt0%2F0LbPYFSR9kI%2B5rVYQKSP%2Fgad97A89ySV7wi05jLmiRLVHySG131zTwren9XoS81Do13hFUkoTZfEQc745bTxvgDKIMrSRs%3D&sign_type=RSA
resposdwx:Array
(
    [currency] => CAD
    [out_trade_no] => AL2192407938683822
    [total_fee] => 0.01
    [trade_no] => 2020061022001367651432273894
    [trade_status] => TRADE_FINISHED
    [sign] => aTTXuUU8DD4J11vwsu+x/onuesJ+a73bIXrDTgbOze1Df35H6x8cSt9Rk9b9hqQksF8QobWU7Zt0/0LbPYFSR9kI+5rVYQKSP/gad97A89ySV7wi05jLmiRLVHySG131zTwren9XoS81Do13hFUkoTZfEQc745bTxvgDKIMrSRs=
    [sign_type] => RSA
)

Payment Notify URL - API Call Back (HTTP-POST)

Once API server finished the request process, it will send back process status to specified URL which been set up as field of 'notifyURL' within above API request parameters.

☑️Message Payload Parameters Level (HTTP-Response-Body)

Params Name

Description

Required

Notes

rsp_code

Response code

Y

refer to Appendix B

rsp_msg

Response message

Y

merchant_id

Merchant ID

Y

data

Encrypted Transaction Data

Y

See "Data" table below

md5

Message Digest

Y

☑️ Call-Back Message Example(JSON Data):

{
"data":"j8RlS+SN18WS/nP5rypaQch/qMeTG78qu4hu9GIq66U2mVYQcDMS9OFgaSkFuOwQkxbMReOeksRwwSpsoKCny8Dk84d2OTPN08kpObZd0/C5p+zI5UY9bkq/Wm1KdqKVm/Rz7RELZCN498ersXCeyLwlweFK1KF0mVT1H0mV6nPAm/6lKcJ7oWa1jM9JEhzAjJQ5OstIjrPo+Prb/4XXQc/OU1FkNKhM6MVauN20RnY\u003d",
"rsp_code":"SUCCESS",
"rsp_msg":"success",
"merchant_id":"QC00005496",
"md5":"1E2E9E78906F85FFE17962A523329220"
}

☑️ Transaction Data (JSON format, after decrypted)

Params Name

Description

Required

Notes

finish_time

Payment time

Y

YYYYMMDDHHMMSS (Beijing time)

order_id

Order ID

Y

amount

Transaction amount

Y

String, "100" for 1.00 dollar.

tip

tip amount

N

String, "100" for 1.00 dollar.

bizpay_order_id

order id from Acquirer

Y

Returned by the Payment Service Provider (e.g. WeChat Pay, Alipay)

merchant_id

Merchant ID

Y

Provided by OTT Pay

☑️ Data Example(JSON Data, after decrypted):

{
"amount":"1",
"bizpay_order_id":"AL5599135482523381",
"tip":"0",
"merchant_id":"QC00005496",
"order_id":"2020061019988O227O2154",
"finish_time":"2020-06-10 23:22:09"
}

Last updated