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 CloudPay.refund () in Wechat development?

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly shows you "what is the use of CloudPay.refund () in Wechat development", the content is simple and clear, and I hope it can help you solve your doubts, so let the editor lead you to study and learn this article "what is the use of CloudPay.refund () in Wechat development?"

CloudPay.refund ()

Supporting end: cloud function 2.0.2

Application for refund

Description

Within a period of time after the transaction, when the buyer or seller needs a refund for reasons, the seller can refund the payment to the buyer through the refund interface. WeChat Pay will return the payment to the buyer's account according to the refund rules after receiving the refund request and verifying the success.

Note:

1. Orders that have been traded for more than one year cannot be submitted for refund. 2. WeChat Pay's refund supports multiple refunds for a single transaction. Multiple refunds require the merchant's order number to submit the original payment order and set different refund number. The total amount of refund requested cannot exceed the amount of the order. Resubmit after a refund failure, please do not change the refund order number, please use the original merchant refund order number. 3. Request frequency limit: 150qps, that is, the number of normal refund requests per second does not exceed 150. Error or invalid request frequency limit: 6qps, that is, no more than 6 abnormal or incorrect refund requests per second 4, no more than 50 partial refunds per payment order

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

The random string nonce_str is a String (32) 5K8264ILTKCH16CQ2502SI8ZNMTM67VS random string that is no longer than 32 bits. Recommended random number generation algorithm

Wechat order number transaction_id No String (32) 12177525012014070332368018 Wechat order number. Fill in one of the two with the merchant's order number.

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

Merchant refund order number out_refund_no is the refund order number within the String (64) 1.21775E+27 merchant system. It is the only one in the merchant system. It can only be numbers, uppercase and lowercase letters _-

Order amount total_fee is the total amount of Int100 order. The unit is points. It can only be an integer. For more information, please see the payment amount.

Refund amount refund_fee is the total amount of Int100 refund, the unit is points, can only be round number, partial refund. For details, see the amount paid.

Currency type refund_fee_type No String (8) CNY currency type, three-digit code that conforms to ISO 4217 standard. Default RMB: CNY. For more information on other values, please see currency types.

Refund_ refund reason No string (80) if the merchant has sold out, the refund reason will be reflected in the refund message sent to the user.

Note: if the refund amount of the order is ≤ 1 yuan and belongs to a partial refund, the refund reason will not be reflected in the refund message.

Source of refund funds refund_account No String (30) REFUND_SOURCE_RECHARGE_FUNDS is only for old capital flow merchants to use

Refund of REFUND_SOURCE_UNSETTLED_FUNDS--- unsettled funds (refund of unsettled funds by default)

Refund of REFUND_SOURCE_RECHARGE_FUNDS--- available balance

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

Business result result_code is String (16) SUCCESSSUCCESS/FAIL

The SUCCESS refund application was received successfully. The result is queried through the refund query API.

FAIL failed to submit business

Error codes err_ Code No string (32) SYSTEMERROR list see error codes list

Error code description err_code_des No String (128) system timeout result information 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) 5K8264ILTKCH16CQ2502SI8ZNMTM67VS signature. For more information, please see signature algorithm.

Wechat order number transaction_id is String (32) 1217752501201407033233368018 Wechat order number

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.

Merchant refund order number out_refund_no is the refund order number within the merchant system String (64) 1217752501201407033233368018, which is the only one in the merchant system. It can only be numbers, uppercase and lowercase letters _-

Wechat refund order number refund_id is String (32) 1217752501201407033233368018 Wechat refund order number

Refund amount refund_fee is the total amount of Int100 refund, the unit is points, you can make a partial refund

Refund amount settlement_refund_fee No Int100 the refund amount after excluding the refund amount of the non-recharged voucher, the refund amount = the refund amount applied for-the refund amount of the non-recharge voucher, the refund amount

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