Alipay EasySDK for PHP验签报错

Alipay EasySDK for PHP验签报错,

img


按照SDK中的代码进行验签,函数报错:Call to a member function common() on null

代码:$result=Factory::payment()->common()->verifyNotify($arr);

img

初始化你做了吗?

        $account = new TestAccount();
        Factory::setOptions($account->getTestAccount());
  1. 账号信息

    img

  2. 调用方法

    img

Call to a member function common() on null
对null调用成员函数common()

分析:递归导致开辟新的栈,在新栈中你的"方法()"这个成员方法是不存在的
思路:进行递归时将"方法()"的所属类当做参数传入进去

Alipay SDK for PHP 验签出错问题可能原因
https://www.muouseo.com/article/wjkv81qe62.html