Class: StripeBankAccount

Inherits:
StripeModelCallbacks::ApplicationRecord show all
Defined in:
lib/stripe_model_callbacks/models/stripe_bank_account.rb

Instance Attribute Summary

Attributes inherited from StripeModelCallbacks::ApplicationRecord

#stripe_object

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from StripeModelCallbacks::ApplicationRecord

check_object_is_stripe_class, #check_object_is_stripe_class, create_from_stripe!, create_on_stripe!, #destroy_on_stripe, #destroy_on_stripe!, #reload!, #reload_from_stripe!, #to_stripe, #update_on_stripe, #update_on_stripe!

Class Method Details

.stripe_classObject



2
3
4
# File 'lib/stripe_model_callbacks/models/stripe_bank_account.rb', line 2

def self.stripe_class
  Stripe::BankAccount
end

Instance Method Details

#assign_from_stripe(object) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/stripe_model_callbacks/models/stripe_bank_account.rb', line 6

def assign_from_stripe(object)
  check_object_is_stripe_class(object)
  assign_attributes(stripe_account_id: object.)

  StripeModelCallbacks::AttributesAssignerService.execute!(
    model: self, stripe_model: object,
    attributes: %w[
      id account_holder_name account_holder_type bank_name country currency default_for_currency
      fingerprint last4 metadata routing_number status
    ]
  )
end