In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
The content of this article mainly focuses on what are the steps of refund application development for Weixin Mini Programs (Mini). The content of the article is clear and easy to understand, and the organization is clear. It is very suitable for beginners to learn and worth reading. Interested friends can read along with Xiaobian. I hope everyone gets something out of this article!
The steps for developing refund application for Weixin Mini Programs are relatively simple compared to Weixin Pay.
The following two points are worth noting:
1. After requesting a refund from WeChat refund interface, it can be directly determined whether the refund is completed according to the response obtained. There is no longer a need to set up a special callback interface to wait for WeChat notifications. Of course, if necessary, you can also set up a callback interface on the WeChat merchant platform to accept WeChat callbacks, but it is not necessary.
2. Refund request needs to install the security certificate provided by WeChat in the request server, that is, the request method cannot be reused when initiating the refund request compared with the payment request, because WeChat refund needs to carry the request of certificate, this certificate can be downloaded from the WeChat merchant platform after the successful application of WeChat merchant number. The certificate of PHP development environment under Linux only needs to be placed in the cert folder of the website root directory. Other development environments may require import operations.
Here are the specific steps for refunding
I. User initiated refund request
The user initiates a refund request at the front end, receives the refund request at the back end, marks the corresponding order as a refund application, and displays it in the background. After the merchant checks, if agrees to refund then carries on the corresponding operation. After that, it enters the real refund process.
II. Merchant initiates refund request
After the merchant agrees to refund, the backend initiates a request to the refund API provided by WeChat.
Same as requesting Weixin Pay API. The refund request also needs to sign the required parameters and send them to WeChat's refund API in XML
The parameters required for a refund request are as follows (several parameters are also used in payment API requests):
Mini programs appid.
Merchant number mch_id. After the application for opening Weixin Pay merchant authentication is successful, the email sent to you by WeChat contains
Merchant order number out_trade_no. Order number generated at time of payment for refund order
Refund order number out_refund_no. The refund number generated by the backend needs to be guaranteed to be unique, because multiple identical refund numbers will only be refunded once.
Total_fee. Total order amount, unit: cent.
refund_fee The amount of money to be refunded, also in cents
operator op_user_id. Same as merchant number
Random string nonce_str. Same payment request
Sign it. Use all of the above parameters to encrypt and generate a signature. (The specific processing method is the same as payment, and can be directly multiplexed.)
III. Refund completed
After the refund request is initiated, it can be judged whether the refund is successful according to the result_code field in the response XML of the request, so as to process the order status and subsequent operations. There is no need to wait for notification from another interface to determine the status of the request, as there is for payment. Of course, as mentioned above, if you need the WeChat server to send notifications to the backend, you can go to the WeChat merchant platform to set up.
Refund because the process is similar to payment, so refund PHP class I chose direct inheritance payment class,
Thank you for reading. I believe you have a certain understanding of "What are the steps for the development of refund application for Weixin Mini Programs?" Go to practice quickly. If you want to know more relevant knowledge points, you can pay attention to the website! The editor will continue to bring better articles to everyone!
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: 214
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.