Home  >  Article  >  Backend Development  >  Alipay APP payment asynchronous callback signature verification failure case analysis

Alipay APP payment asynchronous callback signature verification failure case analysis

小云云
小云云Original
2018-03-06 10:54:535663browse

This article mainly shares with you the analysis of the failure case of Alipay APP payment asynchronous callback signature verification. Recently, I have cooperated with IOS to make APP payments. The payment process has been very smooth. According to the official documents, it passed in one go, as shown in the picture:

Alipay APP payment asynchronous callback signature verification failure case analysis
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:

Alipay APP payment asynchronous callback signature verification failure case analysis
$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:

Alipay APP payment asynchronous callback signature verification failure case analysis

Alipay APP payment asynchronous callback signature verification failure case analysis
It is 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, the signature verification is successful.

Recently, I have been working with IOS for APP payment, and the payment process has been very smooth. According to the official document
, it is passed in one go, as shown in the picture:
Alipay APP payment asynchronous callback signature verification failure case analysis
IOS request to string Then directly call the sdk to initiate the payment request

But there is a problem when processing the asynchronous callback signature verification, -_-||, according to the official method, the signature verification continues to fail, as shown in the figure:

Alipay APP payment asynchronous callback signature verification failure case analysis
$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:

Alipay APP payment asynchronous callback signature verification failure case analysis

Alipay APP payment asynchronous callback signature verification failure case analysis
It is 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, the signature verification is successful.

Related recommendations:
In-depth analysis of koa's asynchronous callback processing

An exception when operating redis in asynchronous callback

Promise mode encapsulation example of JavaScript asynchronous callback_javascript skills

The above is the detailed content of Alipay APP payment asynchronous callback signature verification failure case analysis. 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