Sha256: 0feca360d831919f187d431c58e8a31e79639fc2a254f441b4343142d0f3c2d4

Contents?: true

Size: 440 Bytes

Versions: 3

Compression:

Stored size: 440 Bytes

Contents

class StripeModelCallbacks::Transfer::UpdatedService < StripeModelCallbacks::BaseEventService
  def execute
    transfer.assign_from_stripe(object)

    if transfer.save
      transfer.create_activity :reversed if event.type == "transfer.reversed"
      succeed!
    else
      fail! transfer.errors.full_messages
    end
  end

private

  def transfer
    @transfer ||= StripeTransfer.find_or_initialize_by(stripe_id: object.id)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stripe_model_callbacks-0.1.2 app/services/stripe_model_callbacks/transfer/updated_service.rb
stripe_model_callbacks-0.1.1 app/services/stripe_model_callbacks/transfer/updated_service.rb
stripe_model_callbacks-0.1.0 app/services/stripe_model_callbacks/transfer/updated_service.rb