Module: SpreeStripe::PaymentMethodDecorator

Defined in:
app/models/spree_stripe/payment_method_decorator.rb

Constant Summary collapse

STRIPE_TYPE =
'SpreeStripe::Gateway'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



5
6
7
8
9
10
# File 'app/models/spree_stripe/payment_method_decorator.rb', line 5

def self.prepended(base)
  base.has_many :payment_methods_webhook_keys, class_name: 'SpreeStripe::PaymentMethodsWebhookKey'
  base.has_many :webhook_keys, through: :payment_methods_webhook_keys, class_name: 'SpreeStripe::WebhookKey'

  base.scope :stripe, -> { where(type: STRIPE_TYPE) }
end

Instance Method Details

#stripe?Boolean



12
13
14
# File 'app/models/spree_stripe/payment_method_decorator.rb', line 12

def stripe?
  type == STRIPE_TYPE
end