Sha256: 47fd2f5dc65efadcb226b7be24ec95ee1d72499204536a037491c0af7f1bc2d2

Contents?: true

Size: 622 Bytes

Versions: 163

Compression:

Stored size: 622 Bytes

Contents

module ForestLiana
  class StripeSourceGetter < StripeBaseGetter
    attr_accessor :record

    def initialize(params, secret_key, reference)
      @params = params
      Stripe.api_key = ForestLiana.integrations[:stripe][:api_key]
    end

    def perform
      resource = collection.find(@params[:recordId])
      customer = resource[field]

      @record = ::Stripe::Customer
        .retrieve({ id: customer, expand: ['sources'] })
        .sources.retrieve(@params[:objectId])

      query = {}
      query[field] = @record.customer
      @record.customer = collection.find_by(query)

      @record
    end
  end
end

Version data entries

163 entries across 163 versions & 1 rubygems

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