For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

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);
}

☑️ Call-Back Message Data

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

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

☑️ Transaction Data (JSON format, after decrypted)

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

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

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

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

👉 Please reference our Android demo code for details.

Last updated

Was this helpful?