


thinkphp website Alipay asynchronous callback signature verification failure problem
The following tutorial column of thinkphp framework will introduce to you the problem of Alipay asynchronous callback signature verification failure on the thinkphp website. I hope it will be helpful to friends in need!
A project at hand uses Alipay mobile website payment. The project is made with TP. After downloading the Alipay SDK and modifying it, it can be called up normally. The synchronous interface can also be accessed, but it is asynchronous. The interface signature verification always fails with an error. It is traced to line 580 of AopClient.php
, and
if ("RSA2" == $signType) { $result = (bool) openssl_verify($data, base64_decode($sign), $res, OPENSSL_ALGO_SHA256);//这句报错 } else { $result = (bool) openssl_verify($data, base64_decode($sign), $res); }
is printed at the bottom of the code. print_r(openssl_error_string());
, The output is
error:0906D06C:PEM routines:PEM_read_bio:no start line
Baidu has no results. Some people say that the certificate is wrong. It is useless to change the certificate myself.
Later, I accidentally discovered that there was a problem with the input, and finally found a reason:
When receiving Alipay asynchronous notifications, the I function cannot be used
$data=I("post.");//项目中这样写,导致支付宝传来的数据部分特殊字符被过滤,具体主要是fund_bill_list和sign这两部分 $data=$_POST;//写成这样就好了
One more thing:
No matter whether the signature verification is correct or not, openssl_error_string()
always outputs error:0906D06C:PEM routines:PEM_read_bio:no start line
. This is my situation and I have not delved into the details. .
The above is the detailed content of thinkphp website Alipay asynchronous callback signature verification failure problem. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Alipay PHP...

Problem Description When calling Alipay EasySDK using PHP, after filling in the parameters according to the official code, an error message was reported during operation: "Undefined...

ThinkPHP6 routing parameters are processed in Chinese and complete acquisition. In the ThinkPHP6 framework, URL parameters containing special characters (such as Chinese and punctuation marks) are often processed...

The OKX trading platform offers a variety of rates, including transaction fees, withdrawal fees and financing fees. For spot transactions, transaction fees vary according to transaction volume and VIP level, and adopt the "market maker model", that is, the market charges a lower handling fee for each transaction. In addition, OKX also offers a variety of futures contracts, including currency standard contracts, USDT contracts and delivery contracts, and the fee structure of each contract is also different.

Using the ThinkPHP6 framework combined with elasticsearch-php client to operate Elasticsearch...

This article provides a detailed guide to safe download of Ouyi OKX App in China. Due to restrictions on domestic app stores, users are advised to download the App through the official website of Ouyi OKX, or use the QR code provided by the official website to scan and download. During the download process, be sure to verify the official website address, check the application permissions, perform a security scan after installation, and enable two-factor verification. During use, please abide by local laws and regulations, use a safe network environment, protect account security, be vigilant against fraud, and invest rationally. This article is for reference only and does not constitute investment advice. Digital asset transactions are at your own risk.

H5. The main difference between mini programs and APP is: technical architecture: H5 is based on web technology, and mini programs and APP are independent applications. Experience and functions: H5 is light and easy to use, with limited functions; mini programs are lightweight and have good interactiveness; APPs are powerful and have smooth experience. Compatibility: H5 is cross-platform compatible, applets and APPs are restricted by the platform. Development cost: H5 has low development cost, medium mini programs, and highest APP. Applicable scenarios: H5 is suitable for information display, applets are suitable for lightweight applications, and APPs are suitable for complex functions.

Gate.io (Sesame Open Door) is the world's leading cryptocurrency trading platform. This article provides a complete tutorial on spot trading of Gate.io. The tutorial covers steps such as account registration and login, KYC certification, fiat currency and digital currency recharge, trading pair selection, limit/market transaction orders, and orders and transaction records viewing, helping you quickly get started on the Gate.io platform for cryptocurrency trading. Whether a beginner or a veteran, you can benefit from this tutorial and easily master the Gate.io trading skills.
