Module: SpreeCmCommissioner::PaymentMethodDecorator

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

Constant Summary collapse

DISPLAY =
%i[both front_end back_end frontend_for_early_adopter mini_app].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



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

def self.prepended(base)
  base.const_set(:DISPLAY, DISPLAY)

  base.scope :available_on_frontend_for_early_adopter, -> { active.where(display_on: %i[both front_end frontend_for_early_adopter]) }

  # override
  base.scope :available_on_front_end, -> { active.where(display_on: %i[front_end both mini_app]) }
end

Instance Method Details

#mini_app?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/models/spree_cm_commissioner/payment_method_decorator.rb', line 14

def mini_app?
  display_on == 'mini_app'
end