Closed sky-bin closed 6 months ago
3.6
使用app微信支付,报错
$order = [ 'out_trade_no' => $order->order_number, 'description' => $goodsModel->name, 'amount' => [ 'total' => (int)($goodsModel->price * 100), ], ]; $res = Pay::wechat()->app($order);
参数异常:微信 ur或 service url 参数缺失:你可 能用错插件顺序,应该先使用 业务插件”
2024-02-23T11:49:28.593034+08:00 > yansongda.artful.DEBUG > [Wechat][StartPlugin] 插件开始装载 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":[],"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Contract\DirectionInterface","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.593906+08:00 > yansongda.artful.INFO > [Wechat][StartPlugin] 插件装载完毕 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Contract\DirectionInterface","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.594353+08:00 > yansongda.artful.DEBUG > [Alipay][Pay][App][PayPlugin] 插件开始装载 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Contract\DirectionInterface","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.594628+08:00 > yansongda.artful.INFO > [Alipay][Pay][App][PayPlugin] 插件装载完毕 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800},"method":"alipay.trade.app.pay","biz_content":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}}},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Direction\ResponseDirection","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.594854+08:00 > yansongda.artful.DEBUG > [AddPayloadBodyPlugin] 插件开始装载 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800},"method":"alipay.trade.app.pay","biz_content":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}}},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Direction\ResponseDirection","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.595603+08:00 > yansongda.artful.INFO > [AddPayloadBodyPlugin] 插件装载完毕 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800},"method":"alipay.trade.app.pay","biz_content":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"_body":"{\"out_trade_no\":\"xrl240223114928012466\",\"description\":\"test1\",\"amount\":{\"total\":12800},\"method\":\"alipay.trade.app.pay\",\"biz_content\":{\"out_trade_no\":\"xrl240223114928012466\",\"description\":\"test1\",\"amount\":{\"total\":12800}}}"},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Direction\ResponseDirection","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.595960+08:00 > yansongda.artful.DEBUG > [Wechat][V3][AddPayloadSignaturePlugin] 插件开始装载 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800},"method":"alipay.trade.app.pay","biz_content":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"_body":"{\"out_trade_no\":\"xrl240223114928012466\",\"description\":\"test1\",\"amount\":{\"total\":12800},\"method\":\"alipay.trade.app.pay\",\"biz_content\":{\"out_trade_no\":\"xrl240223114928012466\",\"description\":\"test1\",\"amount\":{\"total\":12800}}}"},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Direction\ResponseDirection","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
使用 \Yansongda\Pay\Plugin\Wechat\V3\Pay\App\PayPlugin::class与\Yansongda\Pay\Plugin\Wechat\V3\Pay\App\InvokePlugin::class两个插件,实现app微信支付 详细代码
$order = [ 'out_trade_no' => $order->order_number, 'description' => $goodsModel->name, 'amount' => [ 'total' => (int)($goodsModel->price * 100), ], ]; $allPlugins = Pay::wechat()->mergeCommonPlugins([ \Yansongda\Pay\Plugin\Wechat\V3\Pay\App\PayPlugin::class, \Yansongda\Pay\Plugin\Wechat\V3\Pay\App\InvokePlugin::class ]); $res = Pay::wechat()->pay($allPlugins, $order);
shortcut 里的插件搞成 alipay 的了,我修复下
已修复,麻烦 composer update 即可
感谢反馈
包版本号
3.6
问题描述
使用app微信支付,报错
你的代码
报错详情
参数异常:微信 ur或 service url 参数缺失:你可 能用错插件顺序,应该先使用 业务插件”
sdk 日志
2024-02-23T11:49:28.593034+08:00 > yansongda.artful.DEBUG > [Wechat][StartPlugin] 插件开始装载 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":[],"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Contract\DirectionInterface","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.593906+08:00 > yansongda.artful.INFO > [Wechat][StartPlugin] 插件装载完毕 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Contract\DirectionInterface","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.594353+08:00 > yansongda.artful.DEBUG > [Alipay][Pay][App][PayPlugin] 插件开始装载 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Contract\DirectionInterface","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.594628+08:00 > yansongda.artful.INFO > [Alipay][Pay][App][PayPlugin] 插件装载完毕 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800},"method":"alipay.trade.app.pay","biz_content":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}}},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Direction\ResponseDirection","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.594854+08:00 > yansongda.artful.DEBUG > [AddPayloadBodyPlugin] 插件开始装载 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800},"method":"alipay.trade.app.pay","biz_content":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}}},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Direction\ResponseDirection","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.595603+08:00 > yansongda.artful.INFO > [AddPayloadBodyPlugin] 插件装载完毕 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800},"method":"alipay.trade.app.pay","biz_content":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"_body":"{\"out_trade_no\":\"xrl240223114928012466\",\"description\":\"test1\",\"amount\":{\"total\":12800},\"method\":\"alipay.trade.app.pay\",\"biz_content\":{\"out_trade_no\":\"xrl240223114928012466\",\"description\":\"test1\",\"amount\":{\"total\":12800}}}"},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Direction\ResponseDirection","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
2024-02-23T11:49:28.595960+08:00 > yansongda.artful.DEBUG > [Wechat][V3][AddPayloadSignaturePlugin] 插件开始装载 {"rocket":{"Yansongda\Artful\Rocket":{"radar":{"url":null,"method":null,"headers":null,"body":""},"params":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"payload":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800},"method":"alipay.trade.app.pay","biz_content":{"out_trade_no":"xrl240223114928012466","description":"test1","amount":{"total":12800}},"_body":"{\"out_trade_no\":\"xrl240223114928012466\",\"description\":\"test1\",\"amount\":{\"total\":12800},\"method\":\"alipay.trade.app.pay\",\"biz_content\":{\"out_trade_no\":\"xrl240223114928012466\",\"description\":\"test1\",\"amount\":{\"total\":12800}}}"},"packer":"Yansongda\Artful\Contract\PackerInterface","direction":"Yansongda\Artful\Direction\ResponseDirection","destination":null,"destination_origin":{"status":null,"headers":null,"body":""}}}}
临时解决方案
使用 \Yansongda\Pay\Plugin\Wechat\V3\Pay\App\PayPlugin::class与\Yansongda\Pay\Plugin\Wechat\V3\Pay\App\InvokePlugin::class两个插件,实现app微信支付 详细代码