Class: StripeModelCallbacks::Charge::UpdatedService

Inherits:
BaseEventService
  • Object
show all
Defined in:
app/services/stripe_model_callbacks/charge/updated_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/charge/updated_service.rb', line 2

def execute
  charge.assign_from_stripe(object)

  if charge.save
    create_refunds if event.type == "charge.refunded"
    create_activity
    succeed!
  else
    fail! charge.errors.full_messages
  end
end