Sha256: 9eaf2f44dc606181ae8e8a7aa56c8a0204447f9778e806e51777337cdde6bad8

Contents?: true

Size: 719 Bytes

Versions: 4

Compression:

Stored size: 719 Bytes

Contents

# frozen_string_literal: true

require 'oauth2'

module LedgerSync
  module Ledgers
    module Stripe
      class Client
        include Ledgers::Client::Mixin

        attr_reader :api_key

        def initialize(
          api_key:
        )
          @api_key = api_key

          super()
        end

        def url_for(resource:)
          DashboardURLHelper.new(
            resource: resource,
            base_url: 'https://dashboard.stripe.com'
          ).url
        end

        def wrap_perform
          ::Stripe.api_key = api_key
          yield
        ensure
          ::Stripe.api_key = nil
        end

        def self.ledger_attributes_to_save
          []
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ledger_sync-1.6.0 lib/ledger_sync/ledgers/stripe/client.rb
ledger_sync-1.5.2 lib/ledger_sync/ledgers/stripe/client.rb
ledger_sync-1.5.1 lib/ledger_sync/ledgers/stripe/client.rb
ledger_sync-1.5.0 lib/ledger_sync/ledgers/stripe/client.rb