API Doc
Languages
Languages
  • English
  • 简体中文
Languages
Languages
  • English
  • 简体中文
  1. 4. WebPay
  • Merchant Unified API Param
  • API Code Collection
  • Unified API Param
  • 1. Account
    • 1.1 Balance Inquiry
      POST
  • 2. Disburse
    • Payout Channel List
    • 2.1 Create Payout
      POST
    • 2.2 Check Payout Status
      POST
  • 3. QR Code
    • QR Code Channel Code List
    • 3.1 QR Code Create
      POST
    • 3.2 QR Code Detail
      POST
    • 3.3 QR Code Payment List
      POST
    • 3.4 QR Code Payment Notification
      POST
    • 3.5 QR Code Cancel
      POST
  • 4. WebPay
    • WebPay Channel Code List
    • Wechat Webpage Authorization Reference
    • Wechat Calls Payment Reference
    • 4.1 WebPay Create
      POST
    • 4.2 Retrieve WebPay Status
      POST
    • 4.3 WebPay Payment Notification
      POST
  • 5. Refund
    • Refund Support Channel List
    • Refund Status Enum
    • 5.1 Refund
      POST
    • 5.2 Get Refund Payments
      POST
    • 5.3 Refund Notification
      POST
  • 6. Void
    • Payment Void Channel List
    • 6.1 Payment Void
  • 7. Direct Debit
    • Direct Debit Channel List
    • 6.4 Authorization Notification
    • 6.3 Cancel Authorization
    • 6.1 Create Authorization Url
    • 6.2 Check Authorization Status
    • 6.5 Direct Debit Pay
    • 6.6 Direct Debit Pay Detail
    • 6.7 Direct Debit Notification
  1. 4. WebPay

Wechat Calls Payment Reference

only for Mini Program Payment and App Payment

Wechat Mini Program Payment#

The merchant first calls the WebPay Create to generate a prepayment order,
and obtain the metadata.wechatpay before transferring it to the app to initiate payment.
Then the merchant calls wx.requestPayment(OBJECT) in the Mini Program to start WeChat Pay. Wechat Official Doc
with Promise style call: Supported
Mini Program plugin: Not supported
Wechat Windows version: Supported
Wechat Mac version: Supported

Request Parameters#

parameter namerequiredtype of datadescription
timeStampYesstringtimestamp, get it from metadata.wechatpay.timeStamp returned by WebPay Create
nonceStrYesstringrandom string, get it from metadata.wechatpay.nonceStr returned by WebPay Create
packageYesstringextension order details, get it from metadata.wechatpay.pkg returned by WebPay Create
signTypeYesstringSignature Method, get it from metadata.wechatpay.signType returned by WebPay Create
paySignYesstringSignature, get it from metadata.wechatpay.paySign returned by WebPay Create
successNofunctionCallback function for successful interface call
failNofunctionCallback function for interface call failure
completeNofunctionThe callback function for the end of the interface call (will be executed if the call succeeds or fails)

CallBack Result#

Callback TypeerrMsgdescription
successrequestPayment:okCalling payment successful
failrequestPayment:fail cancelUser cancels payment
failrequestPayment:fail (detail message)Failed to call payment. The detail message is the specific failure reason returned by the backend

Request example#

Previous
Wechat Webpage Authorization Reference
Next
4.1 WebPay Create
Built with