你是用Yansongda\Pay 什么版本的。 我用了这个支付插件。不能用。老是提示
Error: Object of class GuzzleHttp\Psr7\Response could not be converted to string in \vendor\workerman\workerman\Protocols\Http.php:254
public function return()
{
Pay::config($this->config);
$data = Pay::alipay()->callback();
print_r($data);
}
public function notify()
{
Pay::config($this->config);
$result = Pay::alipay()->callback();
} 这是两个回调。。,,, 返回报Yansongda\Pay\Exception\InvalidResponseException in D:\v2_demo\vendor\yansongda\pay\src\Plugin\Alipay\CallbackPlugin.php:32
{"exception":"Yansongda\\Pay\\Exception\\InvalidResponseException in /var/www/webman.tinywan.cn/vendor/yansongda/pay/src/Plugin/Alipay/CallbackPlugin.php:32
use support\Log;
use support\Request;
use support\Response;
use Webman\Config;
use Yansongda\Pay\Pay;
Log::info('『支付宝』异步通知 '.json_encode($request->post()));
$config = Config::get('payment');
Pay::config($config);
$result = Pay::alipay()->callback($request->post());
Log::info('『支付宝』接收支付宝回调: '.json_encode($result));
Log::info('『支付宝』确认回调: '.json_encode(Pay::alipay()->success()->getBody()->getContents()));
return new Response(200, [], 'success');
[2022-03-11 18:01:03] default.ERROR: Return value of app\middleware\ActionHookMiddleware::process() must be an instance of Webman\Http\Response, instance of GuzzleHttp\Psr7\Response returned {"exception":"TypeError: Return value of app\\middleware\\ActionHookMiddleware::process() must be an instance of Webman\\Http\\Response, instance of GuzzleHttp\\Psr7\\Response returned in /var/www/webman.tinywan.cn/app/middleware/ActionHookMiddleware.php:48
Stack trace:
可以用在webman上
composer require alipaysdk/easysdk
composer require wechatpay/wechatpay
都是官方的
git上也有很多组合的轮子,但是很多验证证书的时候总会出现异常(微信APIV3情况下出现问题较多)
https://www.workerman.net/doc/webman/components/wechat.html
这个是支付插件?
这个Yansongda\Pay是二合一的,同时支持wechat/ali
我有个支付网关就是跑在webman和Yansongda\Pay下
你是用Yansongda\Pay 什么版本的。 我用了这个支付插件。不能用。老是提示
Error: Object of class GuzzleHttp\Psr7\Response could not be converted to string in \vendor\workerman\workerman\Protocols\Http.php:254
@nitron Yansongda\Pay 直接可用么?还是说要做一些兼容?
之前有人写了个Yansongda\Pay文档给webman,https://www.workerman.net/doc/webman/components/pay.html ,看起来不符合webman项目,就没放出来。看下能否帮忙完善下这个文档,git地址 https://github.com/webman-php/webman-manual/blob/master/resource/doc/zh-cn/components/pay.md
2.10
@walkor 我网了我webman版本了, php版本7.4.3,workerman版本4.0.19
你说的问题我看看,我们只是用到扫码支付,在微信小程序里扫对方出示的支付宝/微信二维码
没关系,能完善到什么程度就什么程度。
我测试的是手机网站支付和APP支付。 都不行。 Yansongda\Pay插件的响应跟webman的响应不一样。所以不兼容
最新的V3版本似乎做了一些breaking change,部分依赖不再强制安装
https://pay.yansongda.cn/docs/v3/quick-start/install.html#%E5%AE%89%E8%A3%85%E6%80%BB%E7%BB%93
我用的就是这个版本。操作都是按官网的去做。 但还是会出现我上面所说的错误! 搞的头痛。 最后还是用官方的SDK去做
提供下webman和workerman的版本
"version": "v1.2.7",
主要是主动扫码,支付结果需要客户端去查询,我这个支付网关就是代替去客户查询,有结果了主动push给到客户端
看了下相关的Issue,应该是guzzle里
workerman的\Protocols\Http.php line 254
获取相应内容换成了
我试一试。
试了没用。具体怎么替换呀。
等等 .你请求了之后不会是忘记使用getBody()了吧?
感谢。成功了!!!$res = Pay::alipay()->web([
'out_trade_no' => ''.time(),
'total_amount' => '0.01',
'subject' => 'yansongda测试',
]);
这样就可以了
哪里的问题,贴出来哦!
Pay::config($this->config);
Pay::set(ParserInterface::class, ArrayParser::class);
$res = Pay::alipay()->wap([
'out_trade_no' => ''.time(),
'total_amount' => '0.01',
'subject' => 'yansongda测试',
]);
@zhang123 能不能帮我试下这个可不可行,就是把你上面的
改成
谢谢
也是可以的,大神
@walkor @Tinyman @zhang123
我看了下workerman和guzzle关于Psr7/MessageTrait的实现代码
workerman内getBody只是简单的用
guzzle的getBody内用的是自己实现的stream_for, 当对象实现to_string()时,会自动调用,以下是具体代码,
不知道修改这里。会不会影响整个WEBMAN的响应
不用改,你就按照我之前说的用就好
@nitron Yansongda\Pay\Exception\InvalidResponseException in D:\v2_demo\vendor\yansongda\pay\src\Plugin\Alipay\CallbackPlugin.php:32
Stack trace: 回调出现这错误是什么原因?
加这个他们的群,去咨询:690027516
没用哦
加了好多次。申请没反应
签名不对
我用的是沙箱环境。 都能支付呀。 沙箱环境不会有回调?
回调的参数里没有sign
http://9nkmpy.natappfree.cc/index/index/return?charset=utf-8&out_trade_no=1646979894&method=alipay.trade.wap.pay.return&total_amount=100.00&
sign=jl3ycFOqNi9RNmUmbfx1Bp%2B7CJWXkijOEZmZCN6wWYg6Lp8nFxomNb%2BhCk0dZIW9IpswCKmEHR0y5HOiyocY7K80A%2B3QjYMBA5m6V87ZXKa1%2B8J03nl5mojWM%2BVHXuDmjEJXyOWdtXPQgIEqIeRgKODCoPlIXjLdl29MpHFoj68iwcdTzTgoZbo%2BpPHi2DDLOkawiML8b%2BF%2Fh06xsjbFDU6mezA87wJxrDOmCnshC84yf1jVPXzO8ruWuguViX0BQfObb1gQukUdev92HkPKQcoZY7Ul9gadHdN5sA4sCmM0tjQoXoHaaUq8XTnVJyFwoo5hlHWF2zlq9fx2tz2nAw%3D%3D&trade_no=2022031122001469710502121931&auth_app_id=2021000119632967&version=1.0&app_id=2021000119632967&sign_type=RSA2&seller_id=2088621957986597×tamp=2022-03-11+14%3A25%3A15 反回的URL。 是有sign的。
你用的同步回调?没用异步回调?
我直接是用他提供的这 $data = Pay::alipay($this->config)->callback();
V3改动这么大啊!一直用的V2没这么多问题
这个->callback是个什么玩意?
https://pay.yansongda.cn/docs/v3/alipay/callback.html#%E4%BE%8B%E5%AD%90
官方的
@nitron 你是不是也是用的V2版本的
@Tinywan 我用的V2,我在看V3,1.0的代码
它提供的代码跟你写的不一样吧,它的
你的
这个返回状态打印出来怎么只有一个 success,,没有返回的具体值 吗? 这样返回怎么来做逻辑处理呀
success 是你返回给支付宝的,不返回他一直会给你发异步回调
你说的是success()还是callback()?
callback()返回的是一个Collection,你根据需求继续做逻辑处理
success()直接就是给支付提供商返回一个状态200的success,告诉对方服务器你收到回调了
你的逻辑处理放在callback后,success前
callback()是 notify 的回调 验签吧。 success 是return的回调吧
同步不需要响应给支付宝了,
callback返回的是一个Collection,你通过Collection里的内容判断是否支付成功
成功了就做逻辑处理并返回success
我收到支付宝那边的回调了。 但是怎么得到他回调过来的各个值呢。 是从这框架的alipay.log里读取吗
$data里面的数据
line:32是你没有sign参数
这两个接口是给支付宝回调访问用的,你直接访问了没用,直接把支付宝返回的数据写入log文件看吧
2022-03-11T16:26:39.984174+08:00 > yansongda.pay.INFO > [AbstractProvider] 即将进行 pay 操作 [["Yansongda\Pay\Plugin\Alipay\PreparePlugin","Yansongda\Pay\Plugin\Alipay\Trade\WapPayPlugin","Yansongda\Pay\Plugin\Alipay\HtmlResponsePlugin","Yansongda\Pay\Plugin\Alipay\SignPlugin","Yansongda\Pay\Plugin\Alipay\RadarPlugin","Yansongda\Pay\Plugin\Alipay\LaunchPlugin","Yansongda\Pay\Plugin\ParserPlugin"],{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"}]
2022-03-11T16:26:39.987881+08:00 > yansongda.pay.INFO > [alipay][PreparePlugin] 插件开始装载 {"rocket":{"Yansongda\Pay\Rocket":{"radar":null,"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":[],"direction":null,"destination":null,"destination_origin":null}}}
2022-03-11T16:26:39.989242+08:00 > yansongda.pay.INFO > [alipay][PreparePlugin] 插件装载完毕 {"rocket":{"Yansongda\Pay\Rocket":{"radar":null,"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":{"app_id":"2021000119632967","method":"","format":"JSON","return_url":"http://rmi3kj.natappfree.cc/index/index/return","charset":"utf-8","sign_type":"RSA2","sign":"","timestamp":"2022-03-11 16:26:39","version":"1.0","notify_url":"http://rmi3kj.natappfree.cc/index/index/notify","app_auth_token":"","app_cert_sn":"eca77a4ea65c1f93b89024b00b3c932f","alipay_root_cert_sn":"687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6","biz_content":[]},"direction":null,"destination":null,"destination_origin":null}}}
2022-03-11T16:26:39.989322+08:00 > yansongda.pay.INFO > [alipay][WapPayPlugin] 插件开始装载 {"rocket":{"Yansongda\Pay\Rocket":{"radar":null,"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":{"app_id":"2021000119632967","method":"","format":"JSON","return_url":"http://rmi3kj.natappfree.cc/index/index/return","charset":"utf-8","sign_type":"RSA2","sign":"","timestamp":"2022-03-11 16:26:39","version":"1.0","notify_url":"http://rmi3kj.natappfree.cc/index/index/notify","app_auth_token":"","app_cert_sn":"eca77a4ea65c1f93b89024b00b3c932f","alipay_root_cert_sn":"687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6","biz_content":[]},"direction":null,"destination":null,"destination_origin":null}}}
2022-03-11T16:26:39.989396+08:00 > yansongda.pay.INFO > [alipay][WapPayPlugin] 插件装载完毕 {"rocket":{"Yansongda\Pay\Rocket":{"radar":null,"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":{"app_id":"2021000119632967","method":"alipay.trade.wap.pay","format":"JSON","return_url":"http://rmi3kj.natappfree.cc/index/index/return","charset":"utf-8","sign_type":"RSA2","sign":"","timestamp":"2022-03-11 16:26:39","version":"1.0","notify_url":"http://rmi3kj.natappfree.cc/index/index/notify","app_auth_token":"","app_cert_sn":"eca77a4ea65c1f93b89024b00b3c932f","alipay_root_cert_sn":"687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6","biz_content":{"product_code":"QUICK_WAP_PAY","out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"}},"direction":"Yansongda\\Pay\\Parser\\ResponseParser","destination":null,"destination_origin":null}}}
2022-03-11T16:26:39.989455+08:00 > yansongda.pay.INFO > [alipay][SignPlugin] 插件开始装载 {"rocket":{"Yansongda\Pay\Rocket":{"radar":null,"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":{"app_id":"2021000119632967","method":"alipay.trade.wap.pay","format":"JSON","return_url":"http://rmi3kj.natappfree.cc/index/index/return","charset":"utf-8","sign_type":"RSA2","sign":"","timestamp":"2022-03-11 16:26:39","version":"1.0","notify_url":"http://rmi3kj.natappfree.cc/index/index/notify","app_auth_token":"","app_cert_sn":"eca77a4ea65c1f93b89024b00b3c932f","alipay_root_cert_sn":"687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6","biz_content":{"product_code":"QUICK_WAP_PAY","out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"}},"direction":"Yansongda\\Pay\\Parser\\ResponseParser","destination":null,"destination_origin":null}}}
2022-03-11T16:26:39.990945+08:00 > yansongda.pay.INFO > [alipay][SignPlugin] 插件装载完毕 {"rocket":{"Yansongda\Pay\Rocket":{"radar":null,"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":{"app_id":"2021000119632967","method":"alipay.trade.wap.pay","format":"JSON","return_url":"http://rmi3kj.natappfree.cc/index/index/return","charset":"utf-8","sign_type":"RSA2","timestamp":"2022-03-11 16:26:39","version":"1.0","notify_url":"http://rmi3kj.natappfree.cc/index/index/notify","app_cert_sn":"eca77a4ea65c1f93b89024b00b3c932f","alipay_root_cert_sn":"687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6","biz_content":"{\"product_code\":\"QUICK_WAP_PAY\",\"out_trade_no\":\"1646987199\",\"total_amount\":\"100\",\"subject\":\"yansongda\\u6d4b\\u8bd5\"}","sign":"hqvCUvvmfc0JKzWPj8yHoxheS3VFr/sK7uyDC3LfaZrshLnuqu9tKH0HrM0arzvc7JgWqHUdhztkb4DqEW1Q4jmX/PS5bqF0tlD4wUixUJ3HXKv9eMNEs7DcglHaUWyyL3lwS5OalqmIztC/Kakf+lOCBbEA1cYpkoSzHELmQz0FnuXtQb2ToH9KkCoByk93Zh6bdEjE1tYVzo7eeIBX+77cvvYDlHVaAithQs2O8cvx2sXgXSmaX3et1XtMwxA5q0YW2r4rohgNYajJ7lOckvFlmubSzmiUEet/o7IDb5HQaneuNliLABQFy3+Gl5/xjkvLe3PiHHZwxYK8fE98Xw=="},"direction":"Yansongda\\Pay\\Parser\\ResponseParser","destination":null,"destination_origin":null}}}
2022-03-11T16:26:39.991032+08:00 > yansongda.pay.INFO > [alipay][RadarPlugin] 插件开始装载 {"rocket":{"Yansongda\Pay\Rocket":{"radar":null,"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":{"app_id":"2021000119632967","method":"alipay.trade.wap.pay","format":"JSON","return_url":"http://rmi3kj.natappfree.cc/index/index/return","charset":"utf-8","sign_type":"RSA2","timestamp":"2022-03-11 16:26:39","version":"1.0","notify_url":"http://rmi3kj.natappfree.cc/index/index/notify","app_cert_sn":"eca77a4ea65c1f93b89024b00b3c932f","alipay_root_cert_sn":"687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6","biz_content":"{\"product_code\":\"QUICK_WAP_PAY\",\"out_trade_no\":\"1646987199\",\"total_amount\":\"100\",\"subject\":\"yansongda\\u6d4b\\u8bd5\"}","sign":"hqvCUvvmfc0JKzWPj8yHoxheS3VFr/sK7uyDC3LfaZrshLnuqu9tKH0HrM0arzvc7JgWqHUdhztkb4DqEW1Q4jmX/PS5bqF0tlD4wUixUJ3HXKv9eMNEs7DcglHaUWyyL3lwS5OalqmIztC/Kakf+lOCBbEA1cYpkoSzHELmQz0FnuXtQb2ToH9KkCoByk93Zh6bdEjE1tYVzo7eeIBX+77cvvYDlHVaAithQs2O8cvx2sXgXSmaX3et1XtMwxA5q0YW2r4rohgNYajJ7lOckvFlmubSzmiUEet/o7IDb5HQaneuNliLABQFy3+Gl5/xjkvLe3PiHHZwxYK8fE98Xw=="},"direction":"Yansongda\\Pay\\Parser\\ResponseParser","destination":null,"destination_origin":null}}}
2022-03-11T16:26:39.994036+08:00 > yansongda.pay.INFO > [alipay][RadarPlugin] 插件装载完毕 {"rocket":{"Yansongda\Pay\Rocket":{"radar":{"url":"https://openapi.alipaydev.com/gateway.do?charset=utf-8","method":"POST","headers":{"Host":["openapi.alipaydev.com"],"Content-Type":["application/x-www-form-urlencoded"]},"body":"app_id=2021000119632967&method=alipay.trade.wap.pay&format=JSON&return_url=http%3A%2F%2Frmi3kj.natappfree.cc%2Findex%2Findex%2Freturn&charset=utf-8&sign_type=RSA2×tamp=2022-03-11+16%3A26%3A39&version=1.0¬ify_url=http%3A%2F%2Frmi3kj.natappfree.cc%2Findex%2Findex%2Fnotify&app_cert_sn=eca77a4ea65c1f93b89024b00b3c932f&alipay_root_cert_sn=687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6&biz_content=%7B%22product_code%22%3A%22QUICK_WAP_PAY%22%2C%22out_trade_no%22%3A%221646987199%22%2C%22total_amount%22%3A%22100%22%2C%22subject%22%3A%22yansongda%5Cu6d4b%5Cu8bd5%22%7D&sign=hqvCUvvmfc0JKzWPj8yHoxheS3VFr%2FsK7uyDC3LfaZrshLnuqu9tKH0HrM0arzvc7JgWqHUdhztkb4DqEW1Q4jmX%2FPS5bqF0tlD4wUixUJ3HXKv9eMNEs7DcglHaUWyyL3lwS5OalqmIztC%2FKakf%2BlOCBbEA1cYpkoSzHELmQz0FnuXtQb2ToH9KkCoByk93Zh6bdEjE1tYVzo7eeIBX%2B77cvvYDlHVaAithQs2O8cvx2sXgXSmaX3et1XtMwxA5q0YW2r4rohgNYajJ7lOckvFlmubSzmiUEet%2Fo7IDb5HQaneuNliLABQFy3%2BGl5%2FxjkvLe3PiHHZwxYK8fE98Xw%3D%3D"},"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":{"app_id":"2021000119632967","method":"alipay.trade.wap.pay","format":"JSON","return_url":"http://rmi3kj.natappfree.cc/index/index/return","charset":"utf-8","sign_type":"RSA2","timestamp":"2022-03-11 16:26:39","version":"1.0","notify_url":"http://rmi3kj.natappfree.cc/index/index/notify","app_cert_sn":"eca77a4ea65c1f93b89024b00b3c932f","alipay_root_cert_sn":"687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6","biz_content":"{\"product_code\":\"QUICK_WAP_PAY\",\"out_trade_no\":\"1646987199\",\"total_amount\":\"100\",\"subject\":\"yansongda\\u6d4b\\u8bd5\"}","sign":"hqvCUvvmfc0JKzWPj8yHoxheS3VFr/sK7uyDC3LfaZrshLnuqu9tKH0HrM0arzvc7JgWqHUdhztkb4DqEW1Q4jmX/PS5bqF0tlD4wUixUJ3HXKv9eMNEs7DcglHaUWyyL3lwS5OalqmIztC/Kakf+lOCBbEA1cYpkoSzHELmQz0FnuXtQb2ToH9KkCoByk93Zh6bdEjE1tYVzo7eeIBX+77cvvYDlHVaAithQs2O8cvx2sXgXSmaX3et1XtMwxA5q0YW2r4rohgNYajJ7lOckvFlmubSzmiUEet/o7IDb5HQaneuNliLABQFy3+Gl5/xjkvLe3PiHHZwxYK8fE98Xw=="},"direction":"Yansongda\\Pay\\Parser\\ResponseParser","destination":null,"destination_origin":null}}}
2022-03-11T16:26:39.994659+08:00 > yansongda.pay.INFO > [alipay][LaunchPlugin] 插件开始装载 {"rocket":{"Yansongda\Pay\Rocket":{"radar":{"url":"https://openapi.alipaydev.com/gateway.do?charset=utf-8","method":"POST","headers":{"Host":["openapi.alipaydev.com"],"Content-Type":["application/x-www-form-urlencoded"]},"body":""},"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":{"app_id":"2021000119632967","method":"alipay.trade.wap.pay","format":"JSON","return_url":"http://rmi3kj.natappfree.cc/index/index/return","charset":"utf-8","sign_type":"RSA2","timestamp":"2022-03-11 16:26:39","version":"1.0","notify_url":"http://rmi3kj.natappfree.cc/index/index/notify","app_cert_sn":"eca77a4ea65c1f93b89024b00b3c932f","alipay_root_cert_sn":"687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6","biz_content":"{\"product_code\":\"QUICK_WAP_PAY\",\"out_trade_no\":\"1646987199\",\"total_amount\":\"100\",\"subject\":\"yansongda\\u6d4b\\u8bd5\"}","sign":"hqvCUvvmfc0JKzWPj8yHoxheS3VFr/sK7uyDC3LfaZrshLnuqu9tKH0HrM0arzvc7JgWqHUdhztkb4DqEW1Q4jmX/PS5bqF0tlD4wUixUJ3HXKv9eMNEs7DcglHaUWyyL3lwS5OalqmIztC/Kakf+lOCBbEA1cYpkoSzHELmQz0FnuXtQb2ToH9KkCoByk93Zh6bdEjE1tYVzo7eeIBX+77cvvYDlHVaAithQs2O8cvx2sXgXSmaX3et1XtMwxA5q0YW2r4rohgNYajJ7lOckvFlmubSzmiUEet/o7IDb5HQaneuNliLABQFy3+Gl5/xjkvLe3PiHHZwxYK8fE98Xw=="},"direction":"Yansongda\\Pay\\Parser\\ResponseParser","destination":null,"destination_origin":null}}}
2022-03-11T16:26:39.994729+08:00 > yansongda.pay.INFO > [alipay][LaunchPlugin] 插件装载完毕 {"rocket":{"Yansongda\Pay\Rocket":{"radar":{"url":"https://openapi.alipaydev.com/gateway.do?charset=utf-8","method":"POST","headers":{"Host":["openapi.alipaydev.com"],"Content-Type":["application/x-www-form-urlencoded"]},"body":""},"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":{"app_id":"2021000119632967","method":"alipay.trade.wap.pay","format":"JSON","return_url":"http://rmi3kj.natappfree.cc/index/index/return","charset":"utf-8","sign_type":"RSA2","timestamp":"2022-03-11 16:26:39","version":"1.0","notify_url":"http://rmi3kj.natappfree.cc/index/index/notify","app_cert_sn":"eca77a4ea65c1f93b89024b00b3c932f","alipay_root_cert_sn":"687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6","biz_content":"{\"product_code\":\"QUICK_WAP_PAY\",\"out_trade_no\":\"1646987199\",\"total_amount\":\"100\",\"subject\":\"yansongda\\u6d4b\\u8bd5\"}","sign":"hqvCUvvmfc0JKzWPj8yHoxheS3VFr/sK7uyDC3LfaZrshLnuqu9tKH0HrM0arzvc7JgWqHUdhztkb4DqEW1Q4jmX/PS5bqF0tlD4wUixUJ3HXKv9eMNEs7DcglHaUWyyL3lwS5OalqmIztC/Kakf+lOCBbEA1cYpkoSzHELmQz0FnuXtQb2ToH9KkCoByk93Zh6bdEjE1tYVzo7eeIBX+77cvvYDlHVaAithQs2O8cvx2sXgXSmaX3et1XtMwxA5q0YW2r4rohgNYajJ7lOckvFlmubSzmiUEet/o7IDb5HQaneuNliLABQFy3+Gl5/xjkvLe3PiHHZwxYK8fE98Xw=="},"direction":"Yansongda\\Pay\\Parser\\ResponseParser","destination":null,"destination_origin":null}}}
2022-03-11T16:26:39.994783+08:00 > yansongda.pay.INFO > [alipay][HtmlResponsePlugin] 插件开始装载 {"rocket":{"Yansongda\Pay\Rocket":{"radar":{"url":"https://openapi.alipaydev.com/gateway.do?charset=utf-8","method":"POST","headers":{"Host":["openapi.alipaydev.com"],"Content-Type":["application/x-www-form-urlencoded"]},"body":""},"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":{"app_id":"2021000119632967","method":"alipay.trade.wap.pay","format":"JSON","return_url":"http://rmi3kj.natappfree.cc/index/index/return","charset":"utf-8","sign_type":"RSA2","timestamp":"2022-03-11 16:26:39","version":"1.0","notify_url":"http://rmi3kj.natappfree.cc/index/index/notify","app_cert_sn":"eca77a4ea65c1f93b89024b00b3c932f","alipay_root_cert_sn":"687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6","biz_content":"{\"product_code\":\"QUICK_WAP_PAY\",\"out_trade_no\":\"1646987199\",\"total_amount\":\"100\",\"subject\":\"yansongda\\u6d4b\\u8bd5\"}","sign":"hqvCUvvmfc0JKzWPj8yHoxheS3VFr/sK7uyDC3LfaZrshLnuqu9tKH0HrM0arzvc7JgWqHUdhztkb4DqEW1Q4jmX/PS5bqF0tlD4wUixUJ3HXKv9eMNEs7DcglHaUWyyL3lwS5OalqmIztC/Kakf+lOCBbEA1cYpkoSzHELmQz0FnuXtQb2ToH9KkCoByk93Zh6bdEjE1tYVzo7eeIBX+77cvvYDlHVaAithQs2O8cvx2sXgXSmaX3et1XtMwxA5q0YW2r4rohgNYajJ7lOckvFlmubSzmiUEet/o7IDb5HQaneuNliLABQFy3+Gl5/xjkvLe3PiHHZwxYK8fE98Xw=="},"direction":"Yansongda\\Pay\\Parser\\ResponseParser","destination":null,"destination_origin":null}}}
2022-03-11T16:26:39.995240+08:00 > yansongda.pay.INFO > [alipay][HtmlResponsePlugin] 插件装载完毕 {"rocket":{"Yansongda\Pay\Rocket":{"radar":{"url":"https://openapi.alipaydev.com/gateway.do?charset=utf-8","method":"POST","headers":{"Host":["openapi.alipaydev.com"],"Content-Type":["application/x-www-form-urlencoded"]},"body":""},"params":{"out_trade_no":"1646987199","total_amount":"100","subject":"yansongda测试"},"payload":{"app_id":"2021000119632967","method":"alipay.trade.wap.pay","format":"JSON","return_url":"http://rmi3kj.natappfree.cc/index/index/return","charset":"utf-8","sign_type":"RSA2","timestamp":"2022-03-11 16:26:39","version":"1.0","notify_url":"http://rmi3kj.natappfree.cc/index/index/notify","app_cert_sn":"eca77a4ea65c1f93b89024b00b3c932f","alipay_root_cert_sn":"687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6","biz_content":"{\"product_code\":\"QUICK_WAP_PAY\",\"out_trade_no\":\"1646987199\",\"total_amount\":\"100\",\"subject\":\"yansongda\\u6d4b\\u8bd5\"}","sign":"hqvCUvvmfc0JKzWPj8yHoxheS3VFr/sK7uyDC3LfaZrshLnuqu9tKH0HrM0arzvc7JgWqHUdhztkb4DqEW1Q4jmX/PS5bqF0tlD4wUixUJ3HXKv9eMNEs7DcglHaUWyyL3lwS5OalqmIztC/Kakf+lOCBbEA1cYpkoSzHELmQz0FnuXtQb2ToH9KkCoByk93Zh6bdEjE1tYVzo7eeIBX+77cvvYDlHVaAithQs2O8cvx2sXgXSmaX3et1XtMwxA5q0YW2r4rohgNYajJ7lOckvFlmubSzmiUEet/o7IDb5HQaneuNliLABQFy3+Gl5/xjkvLe3PiHHZwxYK8fE98Xw=="},"direction":"Yansongda\\Pay\\Parser\\ResponseParser","destination":{},"destination_origin":null}}}
2022-03-11T16:26:49.594346+08:00 > yansongda.pay.INFO > [AbstractProvider] 即将进行 pay 操作 [["Yansongda\Pay\Plugin\Alipay\CallbackPlugin"],[]]
2022-03-11T16:26:49.594669+08:00 > yansongda.pay.INFO > [alipay][CallbackPlugin] 插件开始装载 {"rocket":{"Yansongda\Pay\Rocket":{"radar":null,"params":[],"payload":[],"direction":null,"destination":null,"destination_origin":null}}}
得到这些数据。。 哪个数据是支付宝回调过来的数据
我感觉你对整个支付的流程都不太熟悉啊,那这样我真的很难帮到你
那其实可以
这样试试呢?
因为文档里过于callback参数的说明
https://pay.yansongda.cn/docs/v3/alipay/callback.html#%E5%8F%82%E6%95%B0
这个试试。
https://github.com/Yurunsoft/PaySDK
完整异步回调代码
完整异步回调日志
@Tinywan 有没有我一份[doge]
必须的5:5分啊!
为了解决这个问题,亲自安装跑了一把,总算webman下成功了@Tinywan 提交了一份支付相关的文档,欢迎参考
https://www.workerman.net/doc/webman/components/payment.html
如果你在webman使用过其它支付组件,欢迎提交文档到 https://github.com/walkor/webman-manual ,方便更多人使用
TInywan手真快..[捂脸]
为Tinywan点赞。
微信支付,有大佬测试过的吗?
这个同时支持微信和支付宝
Pay::config($this->config);
$notify = $request->all();
$result = Pay::wechat()->callback($notify);
yansongda v3 异步回掉 写法 测试正确
大佬,这个参数如何获得?
去微信下载证书放到服务器上,这里填入证书路径
好像不是直接下载的,应该是通过算法生成的,官方文档看不懂!~
微信后台自行下载
明白,自行下载的是《微信公钥证书》不是《商户公钥证书》两者不同!
我上面理解错了,以为是私钥,以这个回答为准
Pay文档
https://pay.yansongda.cn/docs/v3/quick-start/init.html#%E5%85%B3%E4%BA%8E%E5%BE%AE%E4%BF%A1%E5%85%AC%E9%92%A5%E8%AF%81%E4%B9%A6
微信官方文档:
https://pay.weixin.qq.com/wiki/doc/apiv3/apis/wechatpay5_1.shtml
mch_public_cert_path 是 商户公钥, wechat_public_cert_path 是微信公钥
是的。官方SDK做的觉得更容易懂!~
谢谢你!!对我来说有点难了,继续用 V2版,简单些!