Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program cloud development SDK document WeChat payment and close orders


May 20, 2021 WeChat Mini Program Development Document


Table of contents


CloudPay.closeOrder()

Support: Cloud function 2.0.2

Close the order

Description

The following situations need to call the customs clearance interface: merchant order payment failure needs to generate a new single number to re-initiate the payment, to call the customs order on the original order number, to avoid duplicate payment; N ote: The customs interface cannot be invoked immediately after the order is generated, with a minimum call interval of 5 minutes. *

Description of the parameters

The field name The name of the variable Required Type The sample value Describe
Sub-merchant number sub_mch_id Is String(32) 1900000109 WeChat pays for the assigned sub-merchant number
Merchant order number out_trade_no Is String(32) 1217752501201407033233368018 Merchant system internal order number, required within 32 characters, can only be numbers, case letters -
Random string nonce_str Is String(32) 5K8264ILTKCH16CQ2502SI8ZNMTM67VS The order number inside the merchant system, within 32 characters, may contain letters, other instructions can be found in the security specifications

Returns a description of the value

The field name The name of the variable Required Type The sample value Describe
Return the status code returnCode Is String(16) SUCCESS SUCCESS/FAIL
Return information returnMsg Whether String(128) The signature failed The information returned, if not empty, is the cause of the error. Such as a failed signature, parameter format check error

The following fields are returned when the returnCode is SUCCESS

The field name variable name Required type Sample value describe
APPID of the service provider appid Yes String(32) wxd678efh567hg6787 APPID of the service provider merchant
business number mch_id Yes String(32) 1230000109 WeChat payment distribution merchant
AppID of a small program sub_appid Yes String(32) wx8888888888888888 WeChat allocated small program ID
Submarket sub_mch_id Yes String(32) 1900000109 WeChat payment distribution
Random string nonce_str Yes String(32) 5K8264ILTKCH16CQ2502SI8ZNMTM67VS Random string, not less than 32
sign sign Yes String(32) C380BEC2BFD727A4B6845133519F3AD6 Signature, verification signature algorithm
Business results result_code Yes String(16) SUCCESS SUCCESS/FAIL
Business results description result_msg Yes String(32) OK Detailed description of business execution
error code err_code no String(32) SYSTEMERROR See the following error list details
Error code description err_code_des no String(128) system error Result information description

error code

name describe reason solution
ORDERPAID The order has been paid The order has been paid and the customs order cannot be initiated Order has been paid, can not initiate customs clearance, please treat as paid normal transactions
SYSTEMERROR System error System error System exception, please call the API again
ORDERCLOSED The order has been closed The order has been closed and cannot be closed repeatedly The order is closed and no further calls are required
SIGNERROR The signature is wrong The parameter signature result is incorrect Check that both the signature parameters and methods meet the requirements of the signature algorithm
REQUIRE_POST_METHOD Please use the post method The post pass parameter is not used Please check that the request parameters are submitted via the post method
XML_FORMAT_ERROR The XML is in the wrong format The XML is in the wrong format Check that the XML parameters are in the correct format