Payment Web API
  • Payment API Solutions Map
  • API Common Specifications
  • Payment Status Query API (Common)
  • Refund & Refund Query API (Common)
  • Query Exchange Rate API (Common)
  • Payment Process Flow with Mobile App (Common)
  • API for PC Browser with Wechat Pay/Alipay/UnionPay
    • Payment Request with WeChat Pay
    • Payment Request with Alipay
    • Payment Request with UnionPay-SecurePay
      • Query Transaction with UnionPay-SecurePay
  • API for WeChat Browser with WeChat Pay
    • Payment Request API
    • Query Transaction with WeChat Pay
  • API for WeChat Mini-Program with WeChat Pay
    • Payment Request API
    • Query Transaction API
  • API for Mobile Browser with Alipay
    • Payment Request API
    • Query Transaction API
  • API for Mobile Browser with WeChat
    • Payment Request API
    • Query Transaction API
  • API for Mobile with UnionPay-SecurePay
    • Payment Request API
    • Query Transaction API
    • Code Samples(Web App, Android, iOS)
  • API for Mobile App with WeChat Pay
    • Payment Request API
    • Query Transaction API
  • API for Mobile App with Alipay
    • Payment Request with OTT Pay SDK
    • Implementation with Android App SDK
    • Implementation with iOS App SDK
  • API for In-Store Channels(via Merchant POS/Terminal)
    • API Process Flows
    • Payment Request API
    • Query Transaction API
  • API for Elavon Converge-Hosted payment
    • Payment Request API
    • Query Transaction API
  • API for Global payments PORTICO Ecomm Payment
    • Payment Request API
    • Query Transaction API
  • API for Checkout payment
    • Payment Request API
    • Query Transaction API
  • Appendix A (Data Encryption / Decryption)
  • Appendix B (Response Code)
  • FAQ
  • > Back to Top Page
Powered by GitBook
On this page
  • Payment Request API Link
  • API Link Request Parameter Data Format (Example)
  • Request Parameters (need be URL encoded )
  • Payment Return URL Link
  • Return URL Link Format
  • Return URL Parameters (need be decoded with Base64)
  • Payment Notify URL - API Call Back (HTTP-POST)
  • Message Payload Parameters Level (HTTP-Response-Body)

Was this helpful?

  1. API for Mobile Browser with Alipay

Payment Request API

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

PreviousAPI for Mobile Browser with AlipayNextQuery Transaction API

Last updated 2 years ago

Was this helpful?

Payment Request API Link

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.

API Link Request Parameter Data Format (Example)

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 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 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 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 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

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 is the request amount of the order from the merchant. Number, 100 for 1.00 dollar.

trade_no is the internal order number returned from Alipay.

out_trade_no is the order number returned from Alipay.

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
)

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.

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

{
"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"
}

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

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

amount

operId

returnURL (need be encoded with Base64)

notifyURL (need be encoded with Base64)

Payment Link Request Example (need to be URL encoded)

Payment Return URL Link

Return URL Link Format

Return URL Parameters (need be decoded with Base64)

Prefixed URL

total_fee

trade_no

out_trade_no

trade_status

Return URL Link Example (URL encoded)

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

Message Payload Parameters Level (HTTP-Response-Body)

Call-Back Message Example(JSON Data):

Transaction Data (JSON format, after decrypted)

Data Example(JSON Data, after decrypted):

✅
👉
☑️
☑️
*️
*️
*️
*️
*️
*️
*️
*️
☑️
✅
☑️
☑️
*️
*️
*️
*️
*️
☑️
✅
☑️
☑️
☑️
☑️