Class: StripeModelCallbacks::Customer::DeletedService
- Inherits:
-
BaseEventService
- Object
- BaseEventService
- StripeModelCallbacks::Customer::DeletedService
- Defined in:
- app/services/stripe_model_callbacks/customer/deleted_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/customer/deleted_service.rb', line 2 def perform customer = StripeCustomer.find_or_initialize_by(stripe_id: object.id) customer.assign_from_stripe(object) customer.deleted_at = Time.zone.now if customer.save succeed! else fail! stripe_customer.errors. end end |