Home  >  Article  >  Backend Development  >  Solution to Alipay APP payment asynchronous callback signature verification failure

Solution to Alipay APP payment asynchronous callback signature verification failure

小云云
小云云Original
2018-03-28 11:51:388176browse

Recently, I have been working with IOS to make APP payments, and the payment process has been very smooth. This article mainly shares with you the solution to the asynchronous callback verification failure of Alipay APP payment. I hope it can help everyone.

To pass it all at once, as shown in the figure:
Solution to Alipay APP payment asynchronous callback signature verification failure
After IOS requests the string, it directly calls the sdk to initiate the payment request.

But there was a problem when processing the asynchronous callback signature verification, -_-||, according to the official method, the signature verification kept failing, as shown in the picture:

Solution to Alipay APP payment asynchronous callback signature verification failure
$flag kept returning false. Later, I found the Alipay technical support center (the service is really good). With the same payment callback, the customer service side could verify the signature successfully. . . , by comparing the customer service callback data with my local callback data, as shown in the figure:

Solution to Alipay APP payment asynchronous callback signature verification failure

Solution to Alipay APP payment asynchronous callback signature verification failure
It was found that PHP automatically added an escape character before the special characters in fund_bill_list (when requesting, magic_quotes_gpc in php.ini is on, it will automatically escape ' "\, etc.)..., after removing the escape character , the signature verification is successful.

I have been working with IOS to make APP payments recently, and the payment process has been very smooth. I passed it in one go according to the official document
, as shown in the picture:
Solution to Alipay APP payment asynchronous callback signature verification failure
IOS directly calls the sdk to initiate the payment request after requesting the string.

But there is a problem when processing the asynchronous callback signature verification, -_-||, according to the official method, the signature verification always fails, such as picture:

Solution to Alipay APP payment asynchronous callback signature verification failure
$flag kept returning false. Later, I found the Alipay technical support center (the service is really good). With the same payment callback, the customer service side could verify the signature successfully. . . , by comparing the customer service callback data with my local callback data, as shown in the figure:

Solution to Alipay APP payment asynchronous callback signature verification failure

Solution to Alipay APP payment asynchronous callback signature verification failure
It was found that PHP automatically adds an escape character before the special characters in fund_bill_list (magic_quotes_gpc in php.ini is on when requesting, and ' " \ etc. will be automatically escaped)... After removing the escape character , signature verification successful

Related recommendations:

Alipay APP payment asynchronous callback signature verification failure case analysis

The above is the detailed content of Solution to Alipay APP payment asynchronous callback signature verification failure. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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