Home Backend Development PHP Tutorial Alipay APP payment asynchronous callback signature verification failure case analysis

Alipay APP payment asynchronous callback signature verification failure case analysis

Mar 06, 2018 am 10:54 AM
fail asynchronous case analysis

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to solve problems encountered in Win11 23H2 update? How to solve problems encountered in Win11 23H2 update? Dec 25, 2023 pm 12:18 PM

Users usually upgrade the computer system version to fix some problems. If the user fails to update to the latest version of 23H2 using win11 system, there are three methods to solve your problem. What to do if Win11 update 23H2 fails. Method 1: Bypass TPM1, click "File Explorer - View", and check the "Hidden Items" option in the drop-down menu. 2. Go to and delete "C:\$WINDOWS.~BT\Sources\Panther-Appraiser_Data.ini". 3. Then re-create a folder with the same name in this location, and then click to cancel the "Hide Items" option. 4. Re-update the system and finally click on “Wind

Why can't localstorage successfully save data? Why can't localstorage successfully save data? Jan 03, 2024 pm 01:41 PM

Why does storing data to localstorage always fail? Need specific code examples In front-end development, we often need to store data on the browser side to improve user experience and facilitate subsequent data access. Localstorage is a technology provided by HTML5 for client-side data storage. It provides a simple way to store data and maintain data persistence after the page is refreshed or closed. However, when we use localstorage for data storage, sometimes

How to solve the problem after the upgrade from win7 to win10 fails? How to solve the problem after the upgrade from win7 to win10 fails? Dec 26, 2023 pm 07:49 PM

If the operating system we use is win7, some friends may fail to upgrade from win7 to win10 when upgrading. The editor thinks we can try upgrading again to see if it can solve the problem. Let’s take a look at what the editor did for details~ What to do if win7 fails to upgrade to win10. Method 1: 1. It is recommended to download a driver first to evaluate whether your computer can be upgraded to Win10. 2. Then use the driver test after upgrading. Check if there are any driver abnormalities, and then fix them with one click. Method 2: 1. Delete all files under C:\Windows\SoftwareDistribution\Download. 2.win+R run "wuauclt.e

Quick Application: Practical Development Case Analysis of PHP Asynchronous HTTP Download of Multiple Files Quick Application: Practical Development Case Analysis of PHP Asynchronous HTTP Download of Multiple Files Sep 12, 2023 pm 01:15 PM

Quick Application: Practical Development Case Analysis of PHP Asynchronous HTTP Download of Multiple Files With the development of the Internet, the file download function has become one of the basic needs of many websites and applications. For scenarios where multiple files need to be downloaded at the same time, the traditional synchronous download method is often inefficient and time-consuming. For this reason, using PHP to download multiple files asynchronously over HTTP has become an increasingly common solution. This article will analyze in detail how to use PHP asynchronous HTTP through an actual development case.

How to solve the problem of pip update failure? How to solve the problem of pip update failure? Jan 27, 2024 am 08:32 AM

What should I do if pip update fails? Recently, while developing in Python, I encountered some problems with pip update failure. When developing, we often need to use pip to install, upgrade and remove Python third-party libraries. The failure of pip update will seriously affect our development work. This article will discuss some common pip update failures and provide solutions, hoping to help developers who encounter similar problems. First, when we execute pipinstall-

PHPStudy installation problem revealed: What should I do if PHP 5.5 version fails? PHPStudy installation problem revealed: What should I do if PHP 5.5 version fails? Feb 29, 2024 am 11:54 AM

PHPStudy is a development environment tool that integrates PHP, Apache, and MySQL, providing developers with a convenient way to build a local server environment. However, you may encounter some problems during the installation process, one of which is the failure to install the PHP5.5 version. This article will discuss the reasons and solutions for PHPStudy's failure to install PHP5.5 version, and provide specific code examples to help readers solve this problem. PHPStudy installs PHP5.5 version

How to fix win10 update error code 0x800f0982 How to fix win10 update error code 0x800f0982 Jan 14, 2024 pm 05:54 PM

The win10 system has slowly begun to spread in the market, but there are still many bugs when using it. Recently, many friends have encountered the problem of update failure 0x800f0982. The following will bring you detailed solutions. Win10 update fails and cannot be booted: Method 1. Abnormal system update. Delete abnormal software. 1. Uninstall and reinstall any recently added language packs. 2. Select "Check for Updates" and install the updates. Method 2: Reset the computer if the update is abnormal 1. Click Start to open "Settings" and select "Update & Security". 2. Click "Recovery" on the left and select "Start" under the "Reset this PC" recovery option. 3. Select "Keep my files".

Advanced Guide to Python asyncio: From Beginner to Expert Advanced Guide to Python asyncio: From Beginner to Expert Mar 04, 2024 am 09:43 AM

Concurrent and Asynchronous Programming Concurrent programming deals with multiple tasks executing simultaneously, asynchronous programming is a type of concurrent programming in which tasks do not block threads. asyncio is a library for asynchronous programming in python, which allows programs to perform I/O operations without blocking the main thread. Event loop The core of asyncio is the event loop, which monitors I/O events and schedules corresponding tasks. When a coroutine is ready, the event loop executes it until it waits for I/O operations. It then pauses the coroutine and continues executing other coroutines. Coroutines Coroutines are functions that can pause and resume execution. The asyncdef keyword is used to create coroutines. The coroutine uses the await keyword to wait for the I/O operation to complete. The following basics of asyncio

See all articles