Instamojo 支付集成 - Webhook 问题



来自instamojo api的响应已成功提取,但问题是webhook服务不起作用。在此,我在请求中提供了一个 webhook url,我想排除 CSRF 验证,为此我在中间件中包含带有'instamojo/*'的 Except 数组,但仍然没有使用。

class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'instamojo/*',
];
} 

当前路线

Route::post('webhook','HomeController@webhook');

可以通过在中间件的 Except 部分添加发布路由名称来解决。 在这里,我在中间件中添加了webhook/*

路线

Route::post('webhook','HomeController@webhook');

中间件

class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'webhook/*',
];
}

它工作很好。谢谢。

最新更新