Sha256: 6081d5178c38b5ea69d50ada9ecda21ef9042ffbfb86ec30b47a4096779caf18

Contents?: true

Size: 639 Bytes

Versions: 5

Compression:

Stored size: 639 Bytes

Contents

module Spree
  class Recurring < Spree::Base
    class StripeRecurring < Spree::Recurring
      module ApiHandler
        extend ActiveSupport::Concern

        included do
          include PlanApiHandler
          include SubscriptionApiHandler
          include SubscriptionEventApiHandler
        end

        def error_class
          Stripe::InvalidRequestError
        end

        def raise_invalid_object_error(object, type)
          raise error_class.new("Not a valid object.") unless object.is_a?(type)
        end

        def set_api_key
          Stripe.api_key = preferred_secret_key
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_account_recurring-2.0.0 app/models/concerns/spree/recurring/stripe_recurring/api_handler.rb
spree_account_recurring-1.3.1 app/models/concerns/spree/recurring/stripe_recurring/api_handler.rb
spree_account_recurring-1.2.1 app/models/concerns/spree/recurring/stripe_recurring/api_handler.rb
spree_account_recurring-1.3.0 app/models/concerns/spree/recurring/stripe_recurring/api_handler.rb
spree_account_recurring-1.2.0 app/models/concerns/spree/recurring/stripe_recurring/api_handler.rb