Кто-нибудь сталкивался с этой ошибкой? В нескольких тестах используется следующий шаблон:
- Создание пользователя
- Создание чека для оплаты в полосе
- Прикрепление токена к пользователю
- Зарядите пользователя токеном, прикрепленным к пользователю
Иногда, когда я запускаю этот тест, я получаю следующую ошибку:
%Stripe.Error{
code: :invalid_request_error,
extra: %{
card_code: :token_in_use,
http_status: 400,
raw_error: %{
"code" => "token_in_use",
"doc_url" => "https://stripe.com/docs/error-codes/token-in-use",
"message" => "There is currently another in-progress request using this Stripe token (that probably means you clicked twice, and the other charge is still going through): src_1GQSQOJzKOsRMI5KPg3d5KZE. This token can not be used again if that charge is successful.'",
"type" => "invalid_request_error"
}
},
message: "There is currently another in-progress request using this Stripe token (that probably means you clicked twice, and the other charge is still going through): src_1GQSQOJzKOsRMI5KPg3d5KZE. This token can not be used again if that charge is successful.'",
request_id: nil,
source: :stripe,
user_message: nil
}
Дело в том, что я создаю бренд новый клиент и токен для каждого теста, поэтому нельзя использовать два теста для одного и того же клиента или токена. Кто-нибудь сталкивался с этим вопросом? Это только начало происходить недавно.