Sha256: d4921964b82241c9d279692f3f5073e93c8cdf30851a8a4e5ebaf9b1992ccd7e
Contents?: true
Size: 865 Bytes
Versions: 151
Compression:
Stored size: 865 Bytes
Contents
module ForestLiana class StripeInvoiceGetter < StripeBaseGetter attr_accessor :record def initialize(params, secret_key, reference) @params = params Stripe.api_key = ForestLiana.integrations[:stripe][:api_key] end def perform query = {} @record = ::Stripe::Invoice.retrieve(@params[:invoice_id]) @record.due_date = Time.at(@record.due_date).to_datetime unless @record.due_date.nil? @record.period_start = Time.at(@record.period_start).to_datetime @record.period_end = Time.at(@record.period_end).to_datetime @record.subtotal /= 100.00 @record.total /= 100.00 @record.amount_due /= 100.00 query[field] = @record.customer if collection @record.customer = collection.find_by(query) else @record.customer = nil end @record end end end
Version data entries
151 entries across 151 versions & 1 rubygems