class StripeTransfer

Public Class Methods

stripe_class() click to toggle source
# File lib/stripe_model_callbacks/models/stripe_transfer.rb, line 5
def self.stripe_class
  Stripe::Transfer
end

Public Instance Methods

assign_from_stripe(object) click to toggle source
# File lib/stripe_model_callbacks/models/stripe_transfer.rb, line 9
def assign_from_stripe(object)
  assign_attributes(
    amount: Money.new(object.amount, object.currency),
    amount_reversed: Money.new(object.amount_reversed, object.currency),
    created: Time.zone.at(object.created),
    metadata: JSON.generate(object.metadata)
  )

  StripeModelCallbacks::AttributesAssignerService.execute!(
    model: self, stripe_model: object,
    attributes: %w[
      balance_transaction currency description destination destination_payment livemode reversed
      source_transaction source_type transfer_group status
    ]
  )
end