yansongda / pay

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

webman callback 加解密异常: ciphertext 位数过短 #938

Closed EagriSiol closed 6 months ago

EagriSiol commented 6 months ago

包版本号

最新版

问题描述

Yansongda\Pay\Exception\DecryptException: 加解密异常: ciphertext 位数过短 in vendor\yansongda\pay\src\Functions.php:364 Stack trace:

0 vendor\yansongda\pay\src\Plugin\Wechat\V3\CallbackPlugin.php(51): Yansongda\Pay\decrypt_wechat_resource(Array, Array)

1 vendor\yansongda\supports\src\Pipeline.php(93): Yansongda\Pay\Plugin\Wechat\V3\CallbackPlugin->assembly(Object(Yansongda\Artful\Rocket), Object(Closure))

2 vendor\yansongda\supports\src\Pipeline.php(57): Yansongda\Supports\Pipeline->Yansongda\Supports{closure}(Object(Yansongda\Artful\Rocket))

3 vendor\yansongda\artful\src\Artful.php(257): Yansongda\Supports\Pipeline->then(Object(Closure))

4 vendor\yansongda\pay\src\Provider\Wechat.php(72): Yansongda\Artful\Artful::artful(Array, Array)

5 vendor\yansongda\pay\src\Provider\Wechat.php(133): Yansongda\Pay\Provider\Wechat->pay(Array, Array)

6 app\api\controller\pay\NotifyController.php(59): Yansongda\Pay\Provider\Wechat->callback()

7 vendor\workerman\webman-framework\src\App.php(325): app\api\controller\pay\NotifyController->w(Object(support\Request))

8 vendor\workerman\webman-framework\src\App.php(349): Webman\App::Webman{closure}(Object(support\Request))

9 app\common\middleware\Auth.php(64): Webman\App::Webman{closure}(Object(support\Request))

10 vendor\workerman\webman-framework\src\App.php(341): app\common\middleware\Auth->process(Object(support\Request), Object(Closure))

11 app\common\extend\lib\Throttle.php(114): Webman\App::Webman{closure}(Object(support\Request))

12 app\common\middleware\Throttle.php(79): app\common\extend\lib\Throttle->handle(Object(support\Request), Object(Closure))

13 vendor\workerman\webman-framework\src\App.php(341): app\common\middleware\Throttle->process(Object(support\Request), Object(Closure))

14 app\common\middleware\AccessControl.php(48): Webman\App::Webman{closure}(Object(support\Request))

15 vendor\workerman\webman-framework\src\App.php(341): app\common\middleware\AccessControl->process(Object(support\Request), Object(Closure))

16 vendor\workerman\webman-framework\src\App.php(168): Webman\App::Webman{closure}(Object(support\Request))

17 vendor\workerman\workerman\Connection\TcpConnection.php(646): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))

18 vendor\workerman\workerman\Events\Select.php(311): Workerman\Connection\TcpConnection->baseRead(Resource id #430)

19 vendor\workerman\workerman\Worker.php(1485): Workerman\Events\Select->loop()

20 vendor\workerman\workerman\Worker.php(1402): Workerman\Worker::forkWorkersForWindows()

21 vendor\workerman\workerman\Worker.php(560): Workerman\Worker::forkWorkers()

22 vendor\workerman\webman-framework\src\support\App.php(131): Workerman\Worker::runAll()

23 start.php(4): support\App::run()

24 {main}

报错详情

不知道是不是不兼容的原因 webman 内 callback 与 success 都不能正常使用

EagriSiol commented 6 months ago

vendor\yansongda\pay\src\Plugin\Wechat\V3\CallbackPlugin.php 47行
-$body = json_decode((string) $rocket->getDestination()->getBody(), true); +$body = request()->all(); 就可以用了

yansongda commented 6 months ago

参考:

EagriSiol commented 6 months ago

容器上也有各种问题 返回上与接收上 改了某些但是会出现其他错误 我尝试倒退2.0吧 论坛上说 2.0能改来用