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
☑️ 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
☑️ Transaction Data (JSON format, after decrypted)
Last updated
Was this helpful?