Module: Pay::Merchant
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/pay/merchant.rb
Class Attribute Summary collapse
-
.includers ⇒ Object
readonly
Returns the value of attribute includers.
Class Method Summary collapse
Instance Method Summary collapse
- #merchant ⇒ Object
- #merchant_processor_for(name) ⇒ Object
- #onboarding_complete? ⇒ Boolean
- #stripe_connect_account_id? ⇒ Boolean
Class Attribute Details
.includers ⇒ Object (readonly)
Returns the value of attribute includers.
7 8 9 |
# File 'lib/pay/merchant.rb', line 7 def includers @includers end |
Class Method Details
.included(base = nil, &block) ⇒ Object
10 11 12 13 14 |
# File 'lib/pay/merchant.rb', line 10 def self.included(base = nil, &block) @includers ||= [] @includers << base if base super end |
Instance Method Details
#merchant ⇒ Object
21 22 23 |
# File 'lib/pay/merchant.rb', line 21 def merchant @merchant ||= merchant_processor_for(merchant_processor).new(self) end |
#merchant_processor_for(name) ⇒ Object
25 26 27 |
# File 'lib/pay/merchant.rb', line 25 def merchant_processor_for(name) "Pay::#{name.to_s.classify}::Merchant".constantize end |
#onboarding_complete? ⇒ Boolean
33 34 35 |
# File 'lib/pay/merchant.rb', line 33 def onboarding_complete? !!onboarding_complete end |
#stripe_connect_account_id? ⇒ Boolean
29 30 31 |
# File 'lib/pay/merchant.rb', line 29 def stripe_connect_account_id? !!stripe_connect_account_id end |