my.tradePay

Starts a payment transaction.

Sample Code

copy
my.tradePay({
  paymentUrl: 'https://....', // get the payment from the OpenAPI first
  success: (res) => {
    my.alert({
      content: JSON.stringify(res),
    });
  },
  fail: (res) => {
    my.alert({
      content: JSON.stringify(res),
    });
  }
});

Parameters

FieldTypeMandatoryDescription
paymentUrlStringNThe url of payment page

Success Callback Function

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

FieldTypeMandatoryDescription
resultCodeStringYThe result code of the pay process

Result Code

resultCodeDescription
9000Pay success
8000Trade is processing
4000Pay failed
6001User cancel to pay