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
  • Parameters of API
  • Request Code Example(Android)
  • Call-Back Message Data

Was this helpful?

  1. API for Mobile App with Alipay

Payment Request with OTT Pay SDK

By Invoking of OTT Pay SDK, it will activate Alipay wallet automatically, and payment result will returned with Call-back data.

PreviousAPI for Mobile App with AlipayNextImplementation with Android App SDK

Last updated 2 years ago

Was this helpful?

Payment Request API

Parameters of API

Params Name

Description

Required

Notes

server_url

OTT Pay in App API URL

Y

amount

Transaction amount in cent

Y

string, "100" for 1.00 dollar.

bizType

Business type

Y

string, "ALIPAYONLINE"

merchant_id

Merchant ID in OTT PAY

Y

Provided by OTTPay

shop_id

OTT PAY store id,optional for future usage

N

String

operator_id

Operator ID from OTT PAY

Y

String , Provided by OTTPay

order_id

Your own order id

N

String, Your own order id

call_back_url

Call back URL

Y

Call back data from OTT Pay,

Request Code Example(Android)

/**
call alipay sdk pay. 调用 SDK 支付
*/
public void pay(View v) {
 String server_url = "https://mppay.ottpay.com/inAppPay"; //OTT Pay inApp API URL
 String merchant_id= "ON00000097"//OTT PAY merchant id
 String shop_id= "";//OTT PAY store id,optional for future usage
 String operator_id= "";//OTT Pay operator Id
 String currency= "CAD"; //currency “CAD” or ”USD”
 String amount = "100"; //pay amount in cents
 String call_back_url= "https://www.eshops.com/call_back"; //call back URL
 String biz_type = “ALIPAYONLINE”; //if currency “USD”,using “APUSDONLINE”
 order_id = "123456"; // your own order id
 ConsumeStarter starter = new ConsumeStarter();
 
 starter.setOnCompleteListener(new OnCompleteListener() {
  @Override
  public void onComplete(String rspString) {
    Toast.makeText(MainActivity.this, rspString,
    Toast.LENGTH_SHORT).show();
  }
  });
  starter.consumeImp(MainActivity.this, server_url, merchant_id,
        shop_id, operator_id, currency, amount, order_id, call_back_url, biz_type);
}

Params Name

Description

Required

Notes

rsp_code

Response code

Y

Refer to Appendix B

rsp_msg

Response message

Y

merchant_id

Merchant ID

Y

Merchant ID

data

Transaction Data Encrypted

y

refer to Data table below

finish_time

Payment time

Y

YYYYMMDDHHMMSS (Beijing time)

order_id

Order ID

Y

amount

Transaction amount

Y

String, "100" for 1.00 dollar

md5

Message Digest

Y

 {
  "data":"hy0yiXxPH4TDXeY5ET7gqIsUcgY5ykO1vQYOahS5SsbN7/5Ha7+hvcXhgY1hz9kHuf5OxqNfv28kVeiYACrLzngk+hA2o8dVAcifT6h3AquN5micrIi3L9owj6cHT1nJRExC74sNUqF8CDY5fb4jLh9it9tq7r8xFOpcpf19VNWceo/Jt1nHca6HPMvMUEDeX1aUjnxOs7R7B2TUQbAENg\u003d\u003d",
  "rsp_code":"SUCCESS",
  "rsp_msg":"success",
  "merchant_id":"QC00005496",
  "md5":"F70CA0472D1AAA596E720C19A1DD36A0"
 }

Params Name

Description

Required

Notes

finish_time

Payment time

Y

YYYYMMDDHHMMSS (Beijing time)

order_id

Order ID

Y

your

amount

Transaction amount

Y

string, "100" for 100 dollar.

tip

Tip Amount

Y

string, "100" for 100 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":"AL781266859681754",
 "tip":"0",
 "merchant_id":"QC00005496",
 "order_id":"2020041553699O153O0407",
 "finish_time":"20200416050429"
}

Data in Call back data in encrypted, refer to appendix A for decryption.

Call-Back Message Data

Call-Back Message Example(JSON Data):

Transaction Data (JSON format, after decrypted)

Data Example(JSON Data, after decrypted):

Call back data中的 data是加密过的数据,参考appendix A进行解密处理。

Please reference our Android demo code for details.

✅
☑️
☑️
☑️
☑️
☑️
☑️
👉
👉
https://mppay.ottpay.com/inAppPay