my.tradePay

Start a payment transaction.

Sample Code

copy
my.tradePay({
  tradeNO: '201711152100110410533667792', // get the tradeNo from the server first
  success: (res) => {
    my.alert({
      content: JSON.stringify(res),
    });
  },
  fail: (res) => {
    my.alert({
      content: JSON.stringify(res),
    });
  }
});

Parameters

FieldTypeMandatoryDescription
tradeNOStringNThe trade number
orderStrStringNA string of complete payment parameters, which is recommended to be obtained from the server
paymentUrlStringNThe url of payment page. Obtain from redirectionUrl that is returned as part of /Pay (

https://miniprogram.tngdigital.com.my/docs/miniprogram_tngd/mpdev/v1_pay )

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
6002Network exception
6004Unknown pay result, may be success
99User click forget password button and quite the pay page(iOS only)