Tips for developing small program red envelopes
In the past, the company developed small program red packets and shared some pitfalls they encountered during the development into their blogs. Many people still don't understand how to develop it after reading it. I also consulted. So today, I wrote another article specially. This time I will not talk about the pitfalls I encountered during development. I will mainly explain how to develop this red envelope.
Red Envelope program development ideas:
1. the user sends a red packet, enters the amount of the red packet, sends the number, and then calls the mini-program to make the payment.
The interface for red packet payment is the interface for small program payment. For the payment documentation, see the [payment] applet payment developer documentation.
Https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php? Chapter = 7_3 & index = 1
2. After a red packet is sent, the user grabs the red packet.
You can create a user membership table, store the obtained amount to him, and ask him to withdraw it if the amount reaches a certain value. Red Envelope algorithm. For random red envelopes, refer to the official red envelope distribution algorithm. Baidu search can find their algorithm rules. Just refer to how he made the random red envelope amount. This is a difficult issue. You must search Baidu for other methods. The algorithm of the red envelope amount is the biggest mark of the system.
3. The withdrawal function is now available. Remember to use the wallet function for enterprise payment instead of the interface for cash and red packets. Otherwise, you will be unable to complete the work.
Enterprise payment interface Documentation Reference https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php? Chapter = 14_1 at that time, I was using his red envelope interface for four or five days. After the payment is changed to enterprise payment, it will be done in a moment. Then, you know the withdrawal amount. The minimum amount should be less than one dollar. Just make a judgment.
In this case, we believe that it is okay for everyone to follow this operation.
Good luck!
If you still have any questions, I will try again.
Now, let's share it with you today. I, Qiu Feng, and phper. I am a self-developed company. I am developing a project system. I am welcome to join the php backend and small program front-end. I hope you can learn from each other and improve my number: qiufeng2983.