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

How to use CloudPay.queryRefund () in Wechat Development

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

Share

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

This article is about how to use CloudPay.queryRefund () in Wechat development. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

CloudPay.queryRefund ()

Supporting end: cloud function 2.0.2

Inquire about a refund

Description

After submitting a refund application, query the refund status by calling this API. Refund has a certain delay, the refund paid with change will arrive within 20 minutes, and the refund paid by bank card will be checked again after 3 working days. Note: if there are more than 20 partial refunds for a single payment order, please use the refund order number query * paging query *

When a merchant uses Wechat order number or merchant order number to query API for refund after a partial refund of more than 10 orders, the first 10 refunds and total_refund_count (total number of refund orders) are returned by default. When merchants need to query more than 10 refund orders under the same order, they can pass in the order number and offset. WeChat Pay will return offset and the following 10 refund orders, and so on. When the offset passed in by the merchant exceeds total_refund_count, the system returns an error PARAM_ERROR.

For example:

There are 36 refund orders under an order. When the merchant wants to inquire about the 25th order, you can pass in the order number and offset=24. WeChat Pay platform will return the 25th to 35th refund order information, or the merchant can directly pass in the refund order number to inquire about the refund.

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 one of four String (28) 1217752501201407033233368018 Wechat order number query priority is: refund_id > out_refund_no > transaction_id > out_trade_no

Merchant order number out_trade_ no 4 choose one of 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 four choose a refund order number within the merchant system String (64) 1217752501201407033233368018, which is unique within the merchant system and can only be numbers, uppercase and lowercase letters _-

Wechat refund order number refund_ id choose one String (32) 1217752501201407033233368018 Wechat refund order number

Offset offset No Int15 offset. It can be used when the number of partial refunds exceeds 10, indicating that the returned query results are recorded from this offset.

One of the four parameters refund_id, out_refund_no, out_trade_no and transaction_id is required. If they exist at the same time, the priority is refund_id > out_refund_no > transaction_id > out_trade_no.

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.

Error code err_code is String (32) SYSTEMERROR error code see section 6 for more information

Error description err_code_des is String (128) system error result message 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. 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.

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.

Closing order amount settlement_total_fee No Int100 this parameter is returned when the order uses a non-rechargeable coupon, the closing order amount = order amount-free coupon amount.

Currency type fee_ type No string (8) CNY order amount currency type, three-digit code in accordance with the ISO 4217 standard, default RMB: CNY. For more information on the list of other values, see currency type.

Cash payment amount cash_fee is the Int100 cash payment amount, the unit is points, can only be an integer, see the payment amount

Number of refunds refund_count is the number of refunds currently returned by Int1

Merchant refund order number out_refund_no_$n 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_$n is String (32) 1217752501201407033233368018 Wechat refund order number

Refund channel refund_channel_$ n No string (16) ORIGINALORIGINAL- original refund

BALANCE- returns to balance

The original OTHER_BALANCE- account was abnormally returned to other balance accounts.

The original bank card of OTHER_BANKCARD- was abnormally returned to other bank cards.

Total number of refunds for the order total_refund_count No Int35 the total number of partial refunds that have occurred for the order, which is returned when the request parameter is passed into offset

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

Refund amount settlement_refund_fee_$ n No int 100 refund amount = apply for refund amount-non-recharge voucher refund amount, 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