Use one of the three mutually exclusive payment reference parameters, plus the optional callbacks:
Property
Type
Required
Description
tradeNO
String
One of three
Payment ID returned by the backend from a Payment API call
paymentUrl
String
One of three
Full cashier URL returned by the backend
orderStr
String
One of three
Signed order string returned by the backend
success
Function
No
Callback with payment result
fail
Function
No
Callback on failure
complete
Function
No
Callback that always executes
Which parameter to use depends on the payment method your backend called. Use tradeNO for standard payment flows (Retail Pay, QR Order Pay), and paymentUrl when your backend returns a cashier URL (Link Pay).
Never trust the JSAPI result as final. The resultCode is indicative only. Always confirm payment status via backend webhook before updating business state.