We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2.8.6
微信支付回调验证 报错 INVALID_ARGUMENT: Convert To Array Error! Invalid Xml!
public function notify() { $result = Pay::wechat()->verify(); $attach = json_decode($result->attach, true); $params = [ 'user_id' => $attach['user_id'], 'out_trade_no' => $attach['order_no'], 'payment_flow_id' => $attach['payment_flow_id'], 'money' => bcdiv($result->cash_fee, 100, 2), 'transaction_id' => $result->transaction_id, ]; Log::info('微信支付回调参数'.json_encode($params));
$payment = PaymentFlow::find($params['payment_flow_id']); $order = Order::where('no', $payment->order_no)->first(); $result = $this->finance->wechatCallback($params, $payment, $order); if ($result) { $this->successOrder($order); } Log::info('微信支付回调service出口'); return Pay::wechat()->success(); }
[2019-12-10 20:31:57] local.ERROR: INVALID_ARGUMENT: Convert To Array Error! Invalid Xml! {"exception":"[object] (Yansongda\Pay\Exceptions\InvalidArgumentException(code: 3): INVALID_ARGUMENT: Convert To Array Error! Invalid Xml! at /sites/testing/pin-backend/vendor/yansongda/pay/src/Gateways/Wechat/Support.php:326) [stacktrace] #0 /sites/testing/pin-backend/vendor/yansongda/pay/src/Gateways/Wechat.php(178): Yansongda\Pay\Gateways\Wechat\Support::fromXml('') #1 /sites/testing/pin-backend/app/Http/Controllers/Front/PayController.php(27): Yansongda\Pay\Gateways\Wechat->verify() #2 [internal function]: App\Http\Controllers\Front\PayController->notify() #3 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array) #4 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('notify', Array) #5 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\Front\PayController), 'notify') #6 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController() #7 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php(680): Illuminate\Routing\Route->run() #8 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Dingo\Api\Http\Request)) #9 /sites/testing/pin
2019-12-10 14:08:39 > yansongda.pay.INFO > Received Wechat Request [""]
涉及到 异步通知、同步通知 的问题,请贴出来
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
项目是laravel 5.8的 告诉微信成功回调return Pay::wechat()->success(); 这样写不行, 要写全return Pay::wechat()->success()->send();
也遇到了,重新安装 composer require yansongda/pay:~2 用这个版本的 不要用指定的版本 解决问题 。。。。我是laravel8 php7.4
No branches or pull requests
包版本号
v2.8.6
问题描述
微信支付回调验证 报错 INVALID_ARGUMENT: Convert To Array Error! Invalid Xml!
你的代码
public function notify()
{
$result = Pay::wechat()->verify();
$attach = json_decode($result->attach, true);
$params = [
'user_id' => $attach['user_id'],
'out_trade_no' => $attach['order_no'],
'payment_flow_id' => $attach['payment_flow_id'],
'money' => bcdiv($result->cash_fee, 100, 2),
'transaction_id' => $result->transaction_id,
];
Log::info('微信支付回调参数'.json_encode($params));
报错详情
[2019-12-10 20:31:57] local.ERROR: INVALID_ARGUMENT: Convert To Array Error! Invalid Xml! {"exception":"[object] (Yansongda\Pay\Exceptions\InvalidArgumentException(code: 3): INVALID_ARGUMENT: Convert To Array Error! Invalid Xml! at /sites/testing/pin-backend/vendor/yansongda/pay/src/Gateways/Wechat/Support.php:326)
[stacktrace]
#0 /sites/testing/pin-backend/vendor/yansongda/pay/src/Gateways/Wechat.php(178): Yansongda\Pay\Gateways\Wechat\Support::fromXml('')
#1 /sites/testing/pin-backend/app/Http/Controllers/Front/PayController.php(27): Yansongda\Pay\Gateways\Wechat->verify()
#2 [internal function]: App\Http\Controllers\Front\PayController->notify()
#3 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#4 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('notify', Array)
#5 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\Front\PayController), 'notify')
#6 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController()
#7 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php(680): Illuminate\Routing\Route->run()
#8 /sites/testing/pin-backend/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Dingo\Api\Http\Request))
#9 /sites/testing/pin
sdk 日志
2019-12-10 14:08:39 > yansongda.pay.INFO > Received Wechat Request [""]
nginx/apache 日志
The text was updated successfully, but these errors were encountered: