


thinkphp website Alipay asynchronous callback signature verification failure problem
Jul 03, 2020 pm 01:26 PMThe 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 Article

Hot tools Tags

Hot Article

Hot Article Tags

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

How to make transactions from Bybit to Alipay account?

How to withdraw money from TrustWallet wallet to Alipay

How to withdraw money from Bitget Wallet to Alipay

How to buy and sell coins on MEXC exchange?

How to withdraw kraken platform currency to WeChat or Alipay

How to get started with buying virtual coins? 2025 Ethereum Virtual Currency Newcomers' Guide

Sesame Open Door Login Registration Entrance gate.io Exchange Registration Official Website Entrance

How to buy Bitcoin on Alipay? Alipay Buy BTC Complete Tutorial
