Class: Workarea::FlowIo::CheckoutTokenForm
- Inherits:
-
Object
- Object
- Workarea::FlowIo::CheckoutTokenForm
- Defined in:
- app/services/workarea/flow_io/checkout_token_form.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
Class Method Summary collapse
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(order:, session_id:) ⇒ CheckoutTokenForm
constructor
A new instance of CheckoutTokenForm.
- #to_flow_model ⇒ Object
Constructor Details
#initialize(order:, session_id:) ⇒ CheckoutTokenForm
Returns a new instance of CheckoutTokenForm.
10 11 12 13 |
# File 'app/services/workarea/flow_io/checkout_token_form.rb', line 10 def initialize(order:, session_id:) @order = order @session_id = session_id end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
8 9 10 |
# File 'app/services/workarea/flow_io/checkout_token_form.rb', line 8 def order @order end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
8 9 10 |
# File 'app/services/workarea/flow_io/checkout_token_form.rb', line 8 def session_id @session_id end |
Class Method Details
.from(order:, session_id:) ⇒ Object
4 5 6 |
# File 'app/services/workarea/flow_io/checkout_token_form.rb', line 4 def self.from(order:, session_id:) new(order: order, session_id: session_id).to_flow_model end |
Instance Method Details
#attributes ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/services/workarea/flow_io/checkout_token_form.rb', line 19 def attributes { order_number: order.id, session_id: session_id, urls: { continue_shopping: continue_shopping_url } } end |
#to_flow_model ⇒ Object
15 16 17 |
# File 'app/services/workarea/flow_io/checkout_token_form.rb', line 15 def to_flow_model ::Io::Flow::V0::Models::CheckoutTokenReferenceForm.new(attributes) end |