如何告诉stripe发回一个_token


How to tell stripe to post a _token back

我在Laravel 5项目中使用Stripe的可嵌入形式。当Stripe模式的弹出表单提交且有效时,Stripe会向同一url发送POST请求。

虽然在Laravel 5中,我得到了一个TokenMismatchException sinds Stripe并没有将其包含在其发布数据中。

如何让Stripe在POST请求中发送一个_token变量,使其在Laravel 5项目中工作?

谢谢你,

您可以让您的应用程序为某个功能忽略某个中间件,这样您就不必担心Stripe会发回什么。

添加到控制器的构造函数。。。

$this->middleware('subscribed', ['except' => ['yourPostFunction']]);