Class: StripeOrder
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
10
11
12
|
# File 'lib/stripe_model_callbacks/models/stripe_order.rb', line 10
def self.stripe_class
Stripe::Order
end
|
Instance Method Details
#assign_from_stripe(object) ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/stripe_model_callbacks/models/stripe_order.rb', line 14
def assign_from_stripe(object)
check_object_is_stripe_class(object)
assign_attributes(
stripe_charge_id: object.charge,
created: Time.zone.at(object.created),
currency: object.currency,
stripe_customer_id: object.customer,
email: object.email,
livemode: object.livemode,
metadata: JSON.generate(object.metadata),
selected_shipping_method: object.selected_shipping_method,
status: object.status,
updated: Time.zone.at(object.updated)
)
assign_amounts_from_stripe(object)
assign_shipping_address_from_stripe(object)
assign_shipping_from_stripe(object)
end
|