Class: StripeSource
Instance Attribute Summary
#stripe_object
Class Method Summary
collapse
Instance Method Summary
collapse
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_class ⇒ Object
9
10
11
|
# File 'lib/stripe_model_callbacks/models/stripe_source.rb', line 9
def self.stripe_class
Stripe::Source
end
|
Instance Method Details
#assign_from_stripe(object) ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/stripe_model_callbacks/models/stripe_source.rb', line 13
def assign_from_stripe(object)
check_object_is_stripe_class(object)
self.stripe_type = object.type
self.amount = Money.new(object.amount, object.currency) if object.respond_to?(:amount)
assign_owner(object)
assign_owner_verified(object)
assign_receiver(object)
assign_ach_credit_transfer(object)
StripeModelCallbacks::AttributesAssignerService.execute!(
model: self, stripe_model: object,
attributes: %w[
client_secret created currency flow livemode metadata statement_descriptor
status usage
]
)
end
|