laravel10 Easywechat native 下单没有回调通知(已解决)
兄弟们,我用的是的 Laravel 10 的 框架
Easywechat 版本是 “overtrue/laravel-wechat”: “7.2”
php 代码如下: 现在能正常支付下单, 但是一直没有收到回调通知:
$config = [
'mch_id' => config('easywechat.pay.default.mch_id'),
'secret_key' => config('easywechat.pay.default.v2_secret_key'),
// 商户证书
'private_key' => config('easywechat.pay.default.private_key'),
'certificate' => config('easywechat.pay.default.certificate')
];
$app = new Application($config);
$response = $app->getClient()->postJson('v3/pay/transactions/native', [
"mchid" => config('easywechat.pay.default.mch_id'),
"out_trade_no" => $order["order_no"],
"appid" => config('easywechat.pay.default.app_id'),
"description" => Str::limit('商户订单' . $order["order_no"]),
"notify_url" => config('easywechat.pay.default.notify_url'),
'amount' => [
'total' => (int)($order["amount"] * 100),
'currency' => 'CNY',
]
]);
return $response->toArray(false);
请求体的参数
array:6 [
"mchid" => "160xxx2378"
"out_trade_no" => "202403112054300533"
"appid" => "wx23eadxxx352d46"
"description" => "商户订单202403112054300533"
"notify_url" => "https://test.easygpt.cloud/api/order/callback"
"amount" => array:2 [
"total" => 1
"currency" => "CNY"
]
]
接口路由:
Route::any('order/callback', [WeChatController::class, 'callback']);
回调地址的接口是正常的, 也能正常请求, 就是收不到微信回调的接口, 请求大佬解惑 谢谢大家
推荐文章: