Class: Spree::Paysera::BuildForm
- Inherits:
-
Object
- Object
- Spree::Paysera::BuildForm
- Defined in:
- app/domain/spree/paysera/build_form.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#payment_method ⇒ Object
readonly
Returns the value of attribute payment_method.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(payment_method, order) ⇒ BuildForm
constructor
A new instance of BuildForm.
- #run ⇒ Object
Constructor Details
#initialize(payment_method, order) ⇒ BuildForm
Returns a new instance of BuildForm.
12 13 14 15 |
# File 'app/domain/spree/paysera/build_form.rb', line 12 def initialize(payment_method, order) @payment_method = payment_method @order = order end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
6 7 8 |
# File 'app/domain/spree/paysera/build_form.rb', line 6 def order @order end |
#payment_method ⇒ Object (readonly)
Returns the value of attribute payment_method.
6 7 8 |
# File 'app/domain/spree/paysera/build_form.rb', line 6 def payment_method @payment_method end |
Class Method Details
.for(payment_method, order) ⇒ Object
8 9 10 |
# File 'app/domain/spree/paysera/build_form.rb', line 8 def self.for(payment_method, order) new(payment_method, order).run end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/domain/spree/paysera/build_form.rb', line 17 def run @result = {} add_gateway_details add_order_details form = Spree::PayseraForm.new(@result) raise Spree::Paysera::Error, 'Params are not valid' unless form.valid? form end |