Sha256: 55c1fa6ff46256b9321a8555ae6f998f39052db8674c657e364cef4e0ee66076

Contents?: true

Size: 591 Bytes

Versions: 47

Compression:

Stored size: 591 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(customer)
        .sources.retrieve(@params[:objectId])

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

      @record
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
forest_liana-2.1.0 app/services/forest_liana/stripe_source_getter.rb
forest_liana-2.0.4 app/services/forest_liana/stripe_source_getter.rb
forest_liana-2.0.3 app/services/forest_liana/stripe_source_getter.rb
forest_liana-2.0.2 app/services/forest_liana/stripe_source_getter.rb
forest_liana-2.0.1 app/services/forest_liana/stripe_source_getter.rb
forest_liana-2.0.0 app/services/forest_liana/stripe_source_getter.rb
forest_liana-1.9.8 app/services/forest_liana/stripe_source_getter.rb