Class: StripeModelCallbacks::Account::ExternalAccount::UpdatedService
- Inherits:
-
BaseEventService
- Object
- BaseEventService
- StripeModelCallbacks::Account::ExternalAccount::UpdatedService
- Defined in:
- app/services/stripe_model_callbacks/account/external_account/updated_service.rb
Instance Method Summary collapse
Instance Method Details
#perform ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'app/services/stripe_model_callbacks/account/external_account/updated_service.rb', line 2 def perform bank_account = StripeBankAccount.find_or_initialize_by(stripe_id: object.id) bank_account.assign_from_stripe(object) if bank_account.save bank_account.create_activity :deleted if event.type == "account.external_account.deleted" succeed! else fail! bank_account.errors. end end |