Sha256: 9b97058e605999a273f2532aa3c1ae4811dab862f92084e0c62474cd6e2df51f

Contents?: true

Size: 628 Bytes

Versions: 268

Compression:

Stored size: 628 Bytes

Contents

module ForestLiana
  class StripePaymentGetter < 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::Charge.retrieve(@params[:payment_id])

      @record.created = Time.at(@record.created).to_datetime
      @record.amount /= 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

268 entries across 268 versions & 1 rubygems

Version Path
forest_liana-9.11.1 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.11.0 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.10.6 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.10.5 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.10.4 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.10.3 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.10.2 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.10.1 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.10.0 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.9.1 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.9.0 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.8.0 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.7.0 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.6.4 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.6.3 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.6.0 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.5.7 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.5.6 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.5.5 app/services/forest_liana/stripe_payment_getter.rb
forest_liana-9.5.4 app/services/forest_liana/stripe_payment_getter.rb