yansongda / pay

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

在laravel8.5中使用包 swooletw/laravel-swoole 加速,发起支付宝或微信支付时出现服务未找到。 #1031

Open outsource-zone opened 1 month ago

outsource-zone commented 1 month ago

包版本号

~3.7.0

问题描述

如标题

你的代码

image

报错详情

[2024-10-12 15:25:33] local.ERROR: 服务未找到: Yansongda\Artful\Contract\ConfigInterface {"exception":"[object] (Yansongda\Artful\Exception\ServiceNotFoundException(code: 9102): 服务未找到: Yansongda\Artful\Contract\ConfigInterface at /Users/sbihgu/project/95box/cq_box_ayansongda/artful/src/Artful.php:156) [stacktrace]

0 /Users/sbihgu/project/95box/cq_box_api/vendor/yansongda/pay/src/Pay.php(96): Yansongda\Artful\Artful::get('Yansongda\\Artfu...')

1 /Users/sbihgu/project/95box/cq_box_api/vendor/yansongda/pay/src/Functions.php(72): Yansongda\Pay\Pay::get('Yansongda\\Artfu...')

2 /Users/sbihgu/project/95box/cq_box_api/vendor/yansongda/pay/src/Plugin/Alipay/V2/StartPlugin.php(48): Yansongda\Pay\get_provider_config('alipay', Array)

3 /Users/sbihgu/project/95box/cq_box_api/vendor/yansongda/pay/src/Plugin/Alipay/V2/StartPlugin.php(33): Yansongda\Pay\Plugin\Alipay\V2\StartPlugin->getPayload(Array)

4 /Users/sbihgu/project/95box/cq_box_api/vendor/yansongda/supports/src/Pipeline.php(93): Yansongda\Pay\Plugin\Alipay\V2\StartPlugin->assembly(Object(Yansongda\Artful\Rocket), Object(Closure))

5 /Users/sbihgu/project/95box/cq_box_api/vendor/yansongda/supports/src/Pipeline.php(57): Yansongda\Supports\Pipeline->Yansongda\Supports\{closure}(Object(Yansongda\Artful\Rocket))

6 /Users/sbihgu/project/95box/cq_box_api/vendor/yansongda/artful/src/Artful.php(258): Yansongda\Supports\Pipeline->then(Object(Closure))

7 /Users/sbihgu/project/95box/cq_box_api/vendor/yansongda/artful/src/Artful.php(237): Yansongda\Artful\Artful::artful(Array, Array)

8 /Users/sbihgu/project/95box/cq_box_api/vendor/yansongda/pay/src/Provider/Alipay.php(59): Yansongda\Artful\Artful::shortcut('\\Yansongda\\Pay\\...', Array)

9 /Users/sbihgu/project/95box/cq_box_api/app/Service/V1/Box/Payment/impl/Alipay.php(186): Yansongda\Pay\Provider\Alipay->__call('h5', Array)

10 /Users/sbihgu/project/95box/cq_box_api/app/Http/Controllers/V1/Box/TestController.php(40): App\Service\V1\Box\Payment\impl\Alipay->pay(Array)

11 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\V1\Box\TestController->test(Object(Illuminate\Http\Request))

12 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('test', Array)

13 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\V1\Box\TestController), 'test')

14 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()

15 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\Routing\Route->run()

16 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))

17 /Users/sbihgu/project/95box/cq_box_api/app/Http/Middleware/RequestLog.php(74): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

18 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\RequestLog->handle(Object(Illuminate\Http\Request), Object(Closure))

19 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

20 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\Pipeline\Pipeline->then(Object(Closure))

21 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))

22 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))

23 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))

24 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))

25 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))

26 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

27 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))

28 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(Object(Illuminate\Http\Request), Object(Closure))

29 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

30 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))

31 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TrimStrings->handle(Object(Illuminate\Http\Request), Object(Closure))

32 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

33 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))

34 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

35 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))

36 /Users/sbihgu/project/95box/cq_box_api/vendor/fruitcake/laravel-cors/src/HandleCors.php(52): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

37 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))

38 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

39 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Http\Middleware\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))

40 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

41 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then(Object(Closure))

42 /Users/sbihgu/project/95box/cq_box_api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))

43 /Users/sbihgu/project/95box/cq_box_api/vendor/swooletw/laravel-swoole/src/Server/Sandbox.php(257): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))

44 /Users/sbihgu/project/95box/cq_box_api/vendor/swooletw/laravel-swoole/src/Server/Sandbox.php(217): SwooleTW\Http\Server\Sandbox->handleRequest(Object(Illuminate\Http\Request))

45 /Users/sbihgu/project/95box/cq_box_api/vendor/swooletw/laravel-swoole/src/Server/Sandbox.php(179): SwooleTW\Http\Server\Sandbox->prepareObResponse(Object(Illuminate\Http\Request))

46 /Users/sbihgu/project/95box/cq_box_api/vendor/swooletw/laravel-swoole/src/Server/Manager.php(230): SwooleTW\Http\Server\Sandbox->run(Object(Illuminate\Http\Request))

47 [internal function]: SwooleTW\Http\Server\Manager->onRequest(Object(Swoole\Http\Request), Object(Swoole\Http\Response))

48 {main}

"}

sdk 日志

nginx/apache 日志

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

yansongda commented 1 month ago

Pay::config() 执行了?

outsource-zone commented 1 month ago

Pay::config() 执行了?

嗯,在构造函数中执行的。

yansongda commented 1 month ago

如果方便的话,可以提供一个最小复现的 demo

2024年10月14日 15:09,outsource-zone @.***> 写道:

Pay::config() 执行了?

嗯,在构造函数中执行的。

— Reply to this email directly, view it on GitHub https://github.com/yansongda/pay/issues/1031#issuecomment-2410220161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2RXOVFXTWCHCPVTYEPALTZ3NU2LAVCNFSM6AAAAABP2E7R3KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJQGIZDAMJWGE. You are receiving this because you commented.

outsource-zone commented 1 month ago

如果方便的话,可以提供一个最小复现的 demo 2024年10月14日 15:09,outsource-zone @.***> 写道: Pay::config() 执行了? 嗯,在构造函数中执行的。 — Reply to this email directly, view it on GitHub <#1031 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2RXOVFXTWCHCPVTYEPALTZ3NU2LAVCNFSM6AAAAABP2E7R3KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJQGIZDAMJWGE. You are receiving this because you commented.

按照文档写法直接执行composer instal swooletw/laravel-swoole,运行 php artisan swoole:http start 启动,访问监听的端口请求支付接口即可。