Skip to content
On this page

Payment

requestPayment

Requests a WeChat Pay payment.

Type

typescript
function requestPayment(request: {
  partnerId: string;
  prepayId: string;
  nonceStr: string;
  timeStamp: string;
  sign: string;
}): Promise<NativeWechatResponse>;

Parameters

These parameters should be determined by application servers communicating with WeChat.

NameTypeRequiredDefault ValueDescription
partnerIdStringYes/Merchant ID assigned by WeChat Pay.
prepayIdStringYes/Prepayment session ID generated by WeChat.
nonceStrStringYes/Random string, not longer than 32 digits.
timeStampStringYes/The current time.
signStringYes/SHA256 Signature.

Note

According to WeChat, the returned result does not represent the payment status. When the promise is resolved, please send a payment checking request to the server before giving feedback to the users.

Released under the MIT License.