Laravel 收银员是否处理竞争条件?

Does Laravel Cashier handle race condition?

Laravel 收银员是否处理竞争条件?

//充值的代码

$stripeCharge = $user->charge(100);

调用可能成功,但在条带服务器通知之前连接中断。

在这种情况下,Cashier Package 是如何处理的?

Stripe 允许您通过在请求中传递幂等键来处理此类情况。

The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response.

https://stripe.com/docs/api/idempotent_requests?lang=php

貌似Cashier还没有实现这个功能,看open issue

Support Idempotency Option

https://github.com/laravel/cashier/issues/492