my.tradePay

This Jsapi is userd start a payment transaction.

Sample Code

copy
my.tradePay({
  paymentUrl: 'https://h5-saas-dev1-cirrus.bancoestado.cl/page/h5/index.html#/cashier/?bizNo=20241120111212800100166457500031685&timestamp=1732092093894&mid=216620000000144226590&transType=ACQUIRING&sign=Ciq0%2B7PbUMoGoTSNwyV6yWhH%2FxTiZv%2F7cqAd1uxM74NZKuXvoeYUDcuG9EVYv6rvznhwhqVtXtwydEUp03G7LBuRCZVp6%2BCGdE4Yo6NG1TisR924GVsFoXAWI%2BpizSl%2FC%2FFFambCqaQb5huGSBUW%2Fyf3GNj7%2F1wkr88dc0nxs%2F92o1OHSr8%2FjGeXKNEZE6OfF7gbxnpD%2FFG7s4w4zWZVChA3Iqzj%2BDauZBel991OqXXoH65TL5x7DaLfcBRrwndQWaX8g%2FvKGJygwdbbA4FS5wagX2dQ0XdlV7P62nsYSKnhWwSYrQvtDvwqYPOcTCUJ9J%2FCbErwhhjmIE83yJStLw%3D%3D',
  success: (res) => {
    my.alert({
      content: JSON.stringify(res),
    });
  },
  fail: (res) => {
    my.alert({
      content: JSON.stringify(res),
    });
  }
});

Parameters

Property

Type

Required

Description

paymentUrl

String

Yes

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).

The paymentUrl are different ways to start the payment transaction. The Mini Program should use either one of them to start a payment transaction according to the payment service provided by the host app.

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.

resultMessage

String

Yes

Return on failure

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.

6004

Unknown pay result, may be success.

1004

Network Error

1003

Canceled By User

1002

Internal Error