<> summary

remember 2019
year , There was a failure in wechat payment , After the user initiated the payment , Wechat never calls back , As a result, the orders of merchants who used wechat payment have become unpaid , If the business system is not well designed , There will be a lot of customer complaints in that moment .

It's like the conversation scene below , I believe there must have been a lot at that time :

user : I paid several times , You said you didn't get it ? Don't be kidding .
business : I don't really charge for it . And I thought : This guy doesn't want to be a bully, is he ?

Although big payment platforms like WeChat and Alipay are available. , The probability of major failure is relatively low , But we have to guard against it . Here are some payment problems and corresponding solutions .

<> Third party payment platform cannot pay

Take wechat as an example , image 2019 When wechat payment fails , Meituan , It's in APP
side , Immediately put wechat payment in gray , Guide users to use Alipay payment , Minimize loss and impact . To do that , At least two things have to be done :

* Monitoring the connectivity of wechat payment ( Critical link , Monitoring get bit );
* There must be a switch to block wechat payment , The front end can determine whether to set gray wechat payment button according to this switch .
<> Third party payment platform does not call back

This belongs to the user to give money , Because there is no callback , The business system thinks it didn't receive the money , Very easy to cause customer complaints . We can use timed tasks , Regularly check whether the user's order has been paid .

for instance , You went to the tea shop and bought a cup of milk tea
, After paying by wechat , After the store printer prints out the small ticket and cup sticker , The store staff will start making tea for you . If this time , Wechat payment is out of order , Never call back , Then the small ticket and cup stickers can't be printed , The store staff won't make it for you . If the business system has a scheduled task , every other
2 minute , hold 5 The order was picked up minutes ago , Call the interface of whether wechat order has been paid , If paid , Then the printer is informed to print out the small ticket .

<> Third party payment callback is slow

In the e-commerce order , There is usually an order payment validity period , If the user fails to pay within the validity period , The order will be cancelled , But this is based on the fact that the user didn't pay
Under the premise of , If the payment callback exceeds the payment validity period, it will be recalled , In fact, users paid for it . generally speaking , Payment callback is slow , There are three situations :

* The user pulled up the payment window , But never paid , Payment will be made after the payment is valid ;
* There is a problem with the performance of the third-party payment platform , The payment callback is really slow ;
* Network jitter
For the first case , The interface of payment platform can be used , When pulling up payment , Specify a validity period , I didn't give the money within the validity period , The payment platform will automatically prompt that the transaction has expired .

payment platform Parameters that control the payment validity period
WeChat time_expire
Alipay timeout_express
For example , Call Alipay's pull up payment interface , Set a five minute payment validity period , Once the user exceeds the validity period, he will pay , Alipay will have the following tips. :

For the second and third cases , It can be used in the interface of order cancellation , Refund to users , After all, users gave money .

©2019-2020 Toolsou All rights reserved,
Python Garbage collection and memory leak hive Summary of processing methods for a large number of small files The difference between memory overflow and memory leak , Causes and Solutions Create data mysql Library process You don't know ——HarmonyOS stay Vue Use in Web WorkerSparkSQL Achieve partition overlay write msf Generate Trojan horse attack android mobile phone Linux Page replacement algorithm C Language implementation Django Personal blog building tutorial --- Time classified archiving