my.tradePay

Start a payment transaction.

Sample Code

copy
my.tradePay({
    paymentUrl: 'payment url',  
    success: function(res) {            
        my.alert({
            content: JSON.stringify(res),
        });
    },
    fail: function(res) {  
        my.alert({
            content: JSON.stringify(res),
        });
    },
});
  • Note: the paymentUrl is just an example.

Parameters

Property

Type

Required

Description

paymentUrl

String

No

The url of payment page. Refer

here

for details.

success

Function

No

Callback function upon call success.

fail

Function

No

Callback function upon call failure.

complete

Function

No

Callback function upon call completion (to be executed upon either call success or failure).

Success Callback Function

The incoming parameter is of the Object type with the following attributes:

Property

Type

Required

Description

resultCode

String

Yes

The result code of the pay process.

An example of a successfully returned message is as follows:

copy
{
    "resultCode":"9000"
}

Result Code

resultCode

Description

9000

Payment is successful.

8000

Trade is processing.

4000

Payment is failed.

6001

User cancels to pay.

6002

Network exception.

6004

Unknown pay result, may be success.

5001

User does not have KYC

7001

Consult the cashier failed, please try again