**1. Introduction to the work** For example, it may include but is not limited to the following: 1. PCB of the work Picture of the finished welding product:  2. Research background, purpose and function of the work, Market application prospects; In the future, more and more goods and services will be provided through vending and other equipment, and the use of scanning QR code to pay has become very common. However, it is still difficult for equipment developers to design a set of QR code payment equipment including a payment backend server. In view of this, a QR code payment middleware was developed. Users only need to be familiar with communication protocols such as serial communication, and do not need to care about the communication protocols with WeChat Pay and Alipay servers. They only need to set the payment parameters on the server side to develop payment devices. The development cycle is greatly shortened. Shared devices are currently extremely popular, and these devices need to provide payment functions. The market prospect of this middleware should be very good. 3. What are the highlights of the work in terms of innovation, interest, practicality and even public welfare? The work integrates electronic technology and software technology with GPRS communication, internally integrates the payment communication protocol with the backend server, and provides a simple interface for developers of offline payment equipment. In addition, the work provides a DTU link for users to transmit free data. **2. System Architecture Diagram** Use the form of flow chart or mind map to describe the structure of your work, that is, the scheme diagram.  **3. Description of the hardware part** 1. Schematic diagram and PCB file, Pads development [PayHardWare.zip](http://club.szlcsc.com/article/downFile_2D85C06B2F9DEB21.html) (Number of downloads: 284) 2. Use words to briefly explain the implementation principle of the work and the working process of the system. The system is mainly divided into two parts, the analysis of user serial port data, and the analysis of payment request data and payment return data. The module receives user payment data through the serial port. After first parsing and verifying the user request data, it adds the user's payment amount and other parameters, generates an AES encrypted payment message, and sends it to the backend server through SIM800A. The backend server performs secondary verification on the payment data sent by the module. After passing the verification, it sends payment request data to Alipay or WeChat payment server as needed. Then the backend server will receive the payment link data from WeChat and Alipay and send it to the module. After the module receives the data, it will be verified and sent to the user device through the serial port. After that, the module will enter the state of waiting for the payment result. The payment status of the current order is confirmed through the server's asynchronous notification and the module's scheduled rotation order status. Return payment status to the user regularly. According to the user's settings, a certain relay can be turned on after the payment is successful. **4. List of materials (BOM list)**  **5. Description of the software part (Optional)** If your work involves software, please list the software workflow diagram corresponding to the work, as well as the routines and source code of key parts (please upload all source code if you want to open source it). Serial port receiving and decoding flow chart:  GPRS sending exception handling process:  Payment request process processing:  **6. Work Demonstration** Please upload the function demonstration of your work to Tencent Video and edit it to this building (or attach a video link). Uploading videos as required will earn you 5 points. Please see the event rules for details. Payment demonstration: [https://v.qq.com/x/page/y0538heoroa.html](https://v.qq.com/x/page/y0538heoroa.html) Backend server demonstration: **7. Summary ** The main effort of this work is mainly on the software. When it comes to financial operations such as payment, the stability and reliability of the system are very high. For each payment order, the payment status needs to be clearly given. Even if the device restarts abnormally, the order status cannot be lost. This requires close cooperation between the server and the device, and the payment log for each order must be implemented. In terms of communication, GPRS and the server must maintain a long link and maintain the connection through heartbeats. Due to various uncontrollable conditions, the link will be interrupted, which requires the device to be able to reconnect in a timely manner. It is very important to design an elegant reconnection mechanism. In the future, the product will continue to be improved, the software remote upgrade capability will be added, and a variety of protocols will be added. ##### **For more project details, please see the link: **[http://club.szlcsc.com/article/details\_4577\_1.html](http://club.szlcsc.com/article/ details_4577_1.html) ##### **This project is owned by Lichuang Community "**Yunyi Baby**"**