Sha256: ff175d8fc96c20402d1596ec49b415903c3949be4ee08421ff929ba31679c584
Contents?: true
Size: 828 Bytes
Versions: 105
Compression:
Stored size: 828 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.date = Time.at(@record.date).to_datetime @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
105 entries across 105 versions & 1 rubygems