How to deal with the website Alipay interface error code: TRADE_DATA_MATCH_ERROR? Anyone who has done Alipay payment interface should know that this is caused by repeated orders.
Today when dealing with a customer’s website, according to customer feedback, “error code: TRADE_DATA_MATCH_ERROR” appeared when the customer submitted an order through Alipay. After checking the manual of the Alipay docking platform, the customer had already generated the order on the Alipay platform. , but the payment window was closed before payment was made. When I entered the customer website member backend and clicked to pay, the above error code "TRADE_DATA_MATCH_ERROR" appeared. This means that the attributes of this order must have changed, usually the price. It happened that the backend of a shopping mall website we built for our customers supported price modification, which led to the above problem.
Solution: Re-modify the order number
No matter what your reason is, as long as "error code: TRADE_DATA_MATCH_ERROR" appears, you can modify the order number to resolve the error. We can change the order number while modifying the price in the background. For example, the following is what I changed for the customer
$newsddon=ReturnDdNo(); function ReturnDdNo(){ //Randomly generate order number $ddno=time().rand(10000,99999); return $ddno; } |
Of course, the above code is just the program I use. We only need to regenerate/modify a new order number accordingly in the file that modifies the order number price.