API Doc
Version
Version
  • v1
  • v2
Languages
Languages
  • English
  • 简体中文
Version
Version
  • v1
  • v2
Languages
Languages
  • English
  • 简体中文
  1. 3. Payment
  • Unified API Request Param
  • Unified Async Notification Param
  • Open API Common Code List
  • 1. Account
    • Country Code
    • 1.1 Balance Inquiry
      POST
    • 1.2 Report Download
      POST
  • 2. Checkout
    • Checkout Payment Channel Code List
    • 2.1 Create Checkout Order
      POST
    • 2.2 Check Checkout Order status
      POST
    • 2.3 Get Checkout Order Available Channels
      POST
    • 2.4 Close Checkout Order
      POST
    • 2.5 Asynchronous Notification Of Checkout Payment Results
      POST
  • 3. Payment
    • Payment Channel List
    • Wechat Webpage Authorization Reference
    • Wechat Calls Payment Reference
    • 3.1 Create Payment
      POST
    • 3.2 Check Payment Status
      POST
    • 3.3 Close Payment
      POST
    • 3.4 Asynchronous Notification Of Payment Results
      POST
    • 3.5 Payment Void
      POST
  • 4. Payout
    • Payout Channel List
    • 4.1 Create Payout
      POST
    • 4.2 Check Payout Status
      POST
    • 4.3 Asynchronous Notification Of Payout Results
      POST
  • 5. Refund
    • Refund Support Channel List
    • Refund Status Enum
    • 5.1 Refund
      POST
    • 5.2 Get Refund Payments
      POST
    • 5.3 Asynchronous Notification Of Refund Results
      POST
  • 6. Direct Debit
    • Direct Debit Channel List
    • 6.3 Cancel Authorization
    • 6.1 Create Authorization Url
    • 6.2 Check Authorization Status
    • 6.4 Asynchronous Notification Of Authorization Results
  • 7. Split Payment
    • Split Payment Enumeration
    • 1. Relationship Proof File Upload
    • 2. Add Split Payment Receiver
    • 3. Query Split Payment Receiver
    • 4. Delete Split Payment Receiver
    • 5. Query Unsplit Amount
    • 6. Split Payment
    • 7. Query Split Payment Result
    • 8. Split Payment Return
    • 9. Query Split Payment Return Result API
  1. 3. Payment

Wechat Calls Payment Reference

only for Mini Program Payment and App Payment

Wechat Mini Program Payment#

The merchant first calls the Create Payment 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 Create Payment
nonceStrYesstringrandom string, get it from metadata.wechatpay.nonceStr returned by Create Payment
packageYesstringextension order details, get it from metadata.wechatpay.pkg returned by Create Payment
signTypeYesstringSignature Method, get it from metadata.wechatpay.signType returned by Create Payment
paySignYesstringSignature, get it from metadata.wechatpay.paySign returned by Create Payment
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
3.1 Create Payment
Built with