my.tradePay is part of the Cashier Payment flow used to collect wallet payments.my.tradePay launches the wallet cashier so the user can confirm and complete a payment. Pass the cashier paymentUrl you obtained from the pay API response — specifically the redirectActionForm.redirectionUrl field. On completion, the API returns a status code indicating whether the payment succeeded, failed, or is still processing.
my.tradePay({
paymentUrl: 'https://wallet.example.com/cashier?orderId=xxxxxxx',
success: (res) => {
my.alert({
content: JSON.stringify(res)
});
},
fail: (err) => {
my.alert({
content: JSON.stringify(err)
});
}
});
| Property | Type | Required | Description |
|---|---|---|---|
paymentUrl | string | No | The redirect URL of the cashier page, obtained from the pay response field redirectActionForm.redirectionUrl. See Cashier payment flow for how to obtain it. |
success | Function | No | Callback executed when the API call succeeds. Provides the payload defined in Callback payload. |
fail | Function | No | Callback executed when the API call fails. |
complete | Function | No | Callback executed after success or failure. |
The
payAPI returns the cashier URL asredirectActionForm.redirectionUrl. Pass that exact value astradePay'spaymentUrlto route the user to the correct cashier.
| Property | Type | Required | Description |
|---|---|---|---|
resultCode | string | Yes | Result code representing the payment outcome. See Result codes. |
{
"resultCode": "9000"
}
resultCode | Description |
|---|---|
9000 | Payment successful. |
8000 | Payment processing; final status pending. |
4000 | Payment failed. |
6001 | User cancelled the payment. |
6002 | Network exception occurred. |
6004 | Unknown payment result; retry status query. |