From 19e027f355c9ab870108053ee8094493551f6ac3 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 29 Sep 2023 07:32:45 +0100 Subject: [PATCH] Add random delay in pro account is banned --- lib/pro_account_bans.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pro_account_bans.rb b/lib/pro_account_bans.rb index 07ec362c..10dcc65a 100644 --- a/lib/pro_account_bans.rb +++ b/lib/pro_account_bans.rb @@ -5,6 +5,7 @@ module ModelMethods def update_source return super unless pro_account_banned? + sleep (4...10).to_a.sample unless Rails.env.test? # simulate random delay raise ProAccount::CardError, _("The card issuer couldn't authorize " \ "payment.") end