yansongda / pay

可能是我用过的最优雅的 Alipay/WeChat/Unipay/江苏银行 的支付 SDK 扩展包了
http://pay.yansongda.cn
MIT License
4.98k stars 1.02k forks source link

微信支付回调报错 #1004

Closed pasawu closed 1 week ago

pasawu commented 2 weeks ago

包版本号

thinkphp8

"yansongda/pay": "~3.2.0",

问题描述

微信支付回调报错,但没有具体的报错信息,微信支付回调会回调多次,前面的回调正常,没有报错,大概过了8小时微信又重复回调就报错了(已经返回微信回调成功)

你的代码

/**
 * 微信支付回调
 * @throws ErrorException
 */
public function notify()
{
    try {
        Pay::config(Config::get('payment'));
        $result = Pay::wechat()->callback();
        $res    = $this->service->wechatNotify($result);

    } catch (\Exception $e) {
        xdebug($this->request->param(), 'wechatNotify-param', 'error');
        xdebug([$e->getLine(), $e->getMessage(), $e->getFile()], 'wechatNotify-Exception', 'error');
        throw new ErrorException($e->getMessage());
    }

    if (isset($res) && $res) {
        return Pay::wechat()->success();
    }
}

报错详情

[186,"","\/opt\/data\/www\/web\/www.baidu.com\/vendor\/yansongda\/pay\/src\/Functions.php"]

image

vendor/yansongda/pay/src/Functions.php

sdk 日志

nginx/apache 日志

涉及到 异步通知、同步通知 的问题,请贴出来

yansongda commented 2 weeks ago

https://github.com/yansongda/pay/issues/947

先参考这个排查下