summaryrefslogtreecommitdiff
path: root/app/services/users/upsert_credit_card_validation_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/users/upsert_credit_card_validation_service.rb')
-rw-r--r--app/services/users/upsert_credit_card_validation_service.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/users/upsert_credit_card_validation_service.rb b/app/services/users/upsert_credit_card_validation_service.rb
index 61cf598f178..7190c82bea3 100644
--- a/app/services/users/upsert_credit_card_validation_service.rb
+++ b/app/services/users/upsert_credit_card_validation_service.rb
@@ -2,8 +2,9 @@
module Users
class UpsertCreditCardValidationService < BaseService
- def initialize(params)
+ def initialize(params, user)
@params = params.to_h.with_indifferent_access
+ @current_user = user
end
def execute
@@ -18,6 +19,8 @@ module Users
::Users::CreditCardValidation.upsert(@params)
+ ::Users::UpdateService.new(current_user, user: current_user, requires_credit_card_verification: false).execute!
+
ServiceResponse.success(message: 'CreditCardValidation was set')
rescue ActiveRecord::InvalidForeignKey, ActiveRecord::NotNullViolation => e
ServiceResponse.error(message: "Could not set CreditCardValidation: #{e.message}")