Home > php教程 > php手册 > body text

Website Alipay interface error code: TRADE_DATA_MATCH_ERROR How to deal with it?

WBOY
Release: 2016-08-30 09:21:10
Original
1467 people have browsed it

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();
query("update table set pretotal='$pretotal',ddno='$newsddon' where condition"); //Modify the order number while modifying the price

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.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!