Home > front end >  After the order creation data preparation should be given when performing?
After the order creation data preparation should be given when performing?

Time:01-15

Create orders are generally contain amount payment business scenarios, and amount of the payment business scenario I here into offline, two payment online, offline payment, including cash top-up consumption; Online is WeChat, alipay, union pay, paypal, bank card payment, etc.,

? Offline payment is execution way is sequential, data processing logic is an independent whole; While online payment basic is divided into three steps:

? 1, order

? In order system to create a first order of waiting for payment and get the order information,

? 2, pay

? According to the order information, call interface of three parties, or the SDK to generate payment data needed, qr code or other way let users online payment,

? 3, waiting for the callback

? In the second step before the request, or the parameters passed in the request with the three parties to pay the service interface of the system when the callback address, in this interface, verify the correctness of the correction data, the order status changes, the opening of the service, as well as the subsequent orders

? At this point, the order payment is basically completed, but the user purchase order corresponding service (except for commodities), to enjoy, or use the service, the enjoyment of the service record, or have enjoy this data when writing, this is a thinking problem,

? The first kind of thinking:

? Do create order record, but it's not very reasonable, create order, the user does not pay, there will be a record, there is something wrong with the rigor of business, PASS,

? The second kind of thinking:

? Payment immediately after the completion of the record, that's ok, but be processing in two different conditions, for payment, offline payment is in the pay increase in the program after the completion of the order processing; While online payment in the callback interface to increase processing, unified processing, or packaging to the service at this time of the new state of data are to be used, update the status when you wait for the user service, the scheme when users use service response soon, but in order, may be because of the order to modify the data too much and affect the response speed of the order payment, each have advantages and disadvantages, specific see the business scenario in order related to how much the amount of data,

? The third kind of thinking:

? After completion of payment does not make new, when users use the service of new service using log data, the plan the whole divided into two blocks to the purchase and after-sales service, the business is more clear, the data on to handle is independent, the plan is good, can change the data for order involved too much slow response due to do this plan execution, could improve the efficiency of a certain, when users use the service, due to the amount of data is a data, the response is not likely to slow,

?

To sum up, after the order creation data preparation should be written when users use the service, rather than write in advance,



Aside: I use a second thinking to do is to follow-up to see service when the usage of good search, and when using a third kind of thinking more round the bend to do queries, seem a bit trouble, but the third party think he data accurate, according to the order of the query results, comprehensive and accurate data, follow-up can be applied to multiple business scenarios,

CodePudding user response:

The third plan. Another advantage is relative to the comparatively independent business in a refund, won't produce the useless data
  • Related