I just entered the industry not long ago, I love coding diligently, because I may not meet anyone anymore, so I was assigned to the module of developing new projects. The framework used is yaf, swoole is used as the connection pool, and the payment interface is instant payment and WeChat payment. I feel that this is quite important, but my thinking is very vague. I only played with gadgets in the past. I just want to ask the masters if they have any advice for the younger generation in the past bumps and bumps. Thank you very much, I will try to write some elegant code next time!
I just entered the industry not long ago, I love coding diligently, because I may not meet anyone anymore, so I was assigned to the module of developing new projects. The framework used is yaf, swoole is used as the connection pool, and the payment interface is instant payment and WeChat payment. I feel that this is quite important, but my ideas are very vague. I only played with gadgets in the past. I just want to ask the masters if they have any advice for the younger generation in the past bumps and bumps. Thank you very much, I will try to write some elegant code next time!
1. Understand the structure first
Mall--->N members;
Members--->N orders;
Orders--->N listed products;
...
2. Front-end users will view , search your own order history, so how to search faster?
3. Back-end management users will check, review, and search order history
4. Financial needs all orders
...
The key points from my personal experience are three pieces:
1. Database design: Order-related table design, order-related items such as product list, membership information, discounts, points, packaged sales, etc.; bill-related tables, including internal bills and channel payment bills (such as WeChat payment, Alipay payment, etc.) , and there is the operation log class. It is recommended to find some information online or refer to open source e-commerce products. It is difficult to consider this completely for the first time. Of course, it is tailored according to actual needs, but if there are problems with the general design, it will be very uncomfortable when the functions are expanded later;
2. Third-party payment: mainly some normal and abnormal processes in the payment process. For WeChat payment, you can refer to the test cases recommended in its help document, which are quite complete; in addition, the backend needs to balance the accounts, which means you have to do it every day Reconcile the account with the third-party platform to see if the payment status in the databases on both sides is correct.
3. You mentioned timely arrival of funds above, which proves that there may be a personal account system. How should we figure out how to handle recharges and withdrawals here? Generally, third-party payment does not have a withdrawal interface for individuals, only refunds.