All Products
Search
Document Center

SuperApp:wv.tradePay

Last Updated:Oct 25, 2024

Overview

After a user confirms an order, the merchant or partner calls the /v1/payments/pay operation to create a payment order. The system returns the URL of the cashier page and the order number. Then, the merchant or partner calls the wv.tradePay operation to navigate the user to the cashier page on which the user completes the payment.

Sample code

window.WindVane.call(
    'wv', 
    'tradePay', {
     paymentId: '{paymentId}', 
 paymentUrl: '{paymentUrl}'
     }, 
     function(res) {
    alert(JSON.stringify(res));
    }, 
     function(e) {
     alert('failure:' + JSON.stringify(e));
    }
);

Request parameters

Parameter

Type

Required

Description

paymentId

String

No

The ID of the payment order.

paymentUrl

String

No

The URL of the cashier page.

success

Function

No

The callback function to invoke if the request is successful.

fail

Function

No

The callback function to invoke if the request fails.

complete

Function

No

The callback function to invoke when the request is processed. This callback function is invoked regardless of whether the request is successful or fails.

success

The value of the success parameter is of the OBJECT type and contains the parameter that is described in the following table.

Parameter

Type

Required

Description

resultCode

String

Yes

The payment status code.

Payment status codes

Status code

Description

9000

The order is processed.

8000

The order is being processed. The payment result is unknown. The payment may be complete.

6004

The processing result is unknown. The payment may be complete.

6002

An error occurs in the Internet connection.

6001

The payment is not complete.

4000

The order failed to be processed.

4

The payment is declined.