Class: SolidusAdmin::PaymentMethods::Form::Component
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- SolidusAdmin::PaymentMethods::Form::Component
- Includes:
- Layout::PageHelpers
- Defined in:
- app/components/solidus_admin/payment_methods/form/component.rb
Instance Method Summary collapse
- #auto_capture_select_options ⇒ Object
- #available_preference_sources ⇒ Object
- #available_types ⇒ Object
-
#initialize(payment_method:, url:, form_id:) ⇒ Component
constructor
A new instance of Component.
- #store_select_values ⇒ Object
Constructor Details
#initialize(payment_method:, url:, form_id:) ⇒ Component
Returns a new instance of Component.
6 7 8 9 10 |
# File 'app/components/solidus_admin/payment_methods/form/component.rb', line 6 def initialize(payment_method:, url:, form_id:) @payment_method = payment_method @url = url @form_id = form_id end |
Instance Method Details
#auto_capture_select_options ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'app/components/solidus_admin/payment_methods/form/component.rb', line 12 def current_app_default = Spree::Config.auto_capture ? t(".auto_capture.yes_setting") : t(".auto_capture.no_setting") [ [t(".auto_capture.app_default", current_app_default:), ""], [t(".auto_capture.yes_setting"), true], [t(".auto_capture.no_setting"), false] ] end |
#available_preference_sources ⇒ Object
23 24 25 |
# File 'app/components/solidus_admin/payment_methods/form/component.rb', line 23 def available_preference_sources Spree::PaymentMethod.available_preference_sources end |
#available_types ⇒ Object
27 28 29 |
# File 'app/components/solidus_admin/payment_methods/form/component.rb', line 27 def available_types Rails.application.config.spree.payment_methods.sort_by(&:name) end |
#store_select_values ⇒ Object
31 32 33 |
# File 'app/components/solidus_admin/payment_methods/form/component.rb', line 31 def store_select_values Spree::Store.pluck(:name, :id) end |