Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of the CloudPay.closeOrder () function in Wechat development?

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the use of the CloudPay.closeOrder () function in Wechat development. It is very detailed and has certain reference value. Interested friends must finish reading it.

CloudPay.closeOrder ()

Supporting end: cloud function 2.0.2

Close the order

Description

You need to call the customs order API in the following situations: if the merchant's order payment fails, you need to generate a new order number to restart the payment, and call the original order number to avoid repeated payment; after the order is issued by the system, the user's payment times out and the system exits will no longer be accepted. To prevent users from continuing, please call the customs order API. Note: the API for invoking the order cannot be called immediately after the order is generated, and the minimum call time interval is 5 minutes. *

Parameter description

Field name variable name required type sample value description

Sub-merchant number sub_mch_id is the sub-merchant number assigned by String (32) 1900000109 WeChat Pay

Merchant order number out_trade_no is String (32) 1217752501201407033233368018 internal order number of merchant system. It can only be numbers, uppercase and lowercase letters _-within 32 characters.

The random string nonce_str is the order number within the merchant system of String (32) 5K8264ILTKCH16CQ2502SI8ZNMTM67VS. It can contain letters within 32 characters. Other instructions can be found in the security specification.

Return value description

Field name variable name required type sample value description

The return status code returnCode is String (16) SUCCESSSUCCESS/FAIL

Return message SecretnMsg No string (128) failed to sign the message. If it is not empty, it is the reason for the error. Such as signature failure, parameter format verification error

The following fields are returned when returnCode is SUCCESS

Field name variable name required type sample value description

The APPIDappid of the service provider is the APPID of the merchant of String (32) wxd678efh667hg6787 service provider

Merchant number mch_id is the merchant number assigned by String (32) 1230000109 WeChat Pay

The APPIDsub_appid of Mini Program is the Mini Program ID assigned by String (32) wx8888888888888888 Wechat

Sub-merchant number sub_mch_id is the sub-merchant number assigned by String (32) 1900000109 WeChat Pay

Random string nonce_str is a String (32) 5K8264ILTKCH16CQ2502SI8ZNMTM67VS random string, not longer than 32 bits

Signature sign is String (32) C380BEC2BFD727A4B6845133519F3AD6 signature, verify signature algorithm

Business result result_code is String (16) SUCCESSSUCCESS/FAIL

Business result description result_msg is a detailed description of business execution by String (32) OK

Error code err_ Code No string (32) SYSTEMERROR see the error list below for details

Error code description err_code_des No String (128) system error result information description

Error code

Name describes the cause solution

ORDERPAID order paid order paid, cannot initiate customs order paid, cannot initiate customs order, please treat it as paid normal transaction

SYSTEMERROR system error system error, please call the API again

The ORDERCLOSED order has been closed, the order cannot be closed repeatedly, the order has been closed, there is no need to call

SIGNERROR signature error parameter signature result is incorrect Please check whether the signature parameters and methods meet the requirements of the signature algorithm

REQUIRE_POST_METHOD Please use post method instead of using post to pass parameters check whether the request parameters are submitted through the post method

XML_FORMAT_ERRORXML format error XML format error Please check whether the XML parameter format is correct

These are all the contents of this article entitled "what is the use of the CloudPay.closeOrder () function in Wechat development?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report