Class: StripeModelCallbacks::Customer::BankAccount::DeletedService

Inherits:
BaseEventService
  • Object
show all
Defined in:
app/services/stripe_model_callbacks/customer/bank_account/deleted_service.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



2
3
4
5
6
7
8
9
10
11
12
# File 'app/services/stripe_model_callbacks/customer/bank_account/deleted_service.rb', line 2

def execute
   = StripeBankAccount.find_or_initialize_by(stripe_id: object.id)
  .assign_from_stripe(object)

  if .save
    .create_activity :customer_bank_account_deleted if event.type == "customer.bank_account.deleted"
    succeed!
  else
    fail! .errors.full_messages
  end
end