Class: SolidusAfterpay::OrderComponentBuilder
- Inherits:
-
Object
- Object
- SolidusAfterpay::OrderComponentBuilder
- Defined in:
- app/models/solidus_afterpay/order_component_builder.rb
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#popup_origin_url ⇒ Object
readonly
Returns the value of attribute popup_origin_url.
-
#redirect_cancel_url ⇒ Object
readonly
Returns the value of attribute redirect_cancel_url.
-
#redirect_confirm_url ⇒ Object
readonly
Returns the value of attribute redirect_confirm_url.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(order:, mode: nil, redirect_confirm_url: nil, redirect_cancel_url: nil, popup_origin_url: nil) ⇒ OrderComponentBuilder
constructor
A new instance of OrderComponentBuilder.
Constructor Details
#initialize(order:, mode: nil, redirect_confirm_url: nil, redirect_cancel_url: nil, popup_origin_url: nil) ⇒ OrderComponentBuilder
Returns a new instance of OrderComponentBuilder.
9 10 11 12 13 14 15 |
# File 'app/models/solidus_afterpay/order_component_builder.rb', line 9 def initialize(order:, mode: nil, redirect_confirm_url: nil, redirect_cancel_url: nil, popup_origin_url: nil) @order = order @mode = mode @redirect_confirm_url = redirect_confirm_url @redirect_cancel_url = redirect_cancel_url @popup_origin_url = popup_origin_url end |
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
7 8 9 |
# File 'app/models/solidus_afterpay/order_component_builder.rb', line 7 def mode @mode end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
7 8 9 |
# File 'app/models/solidus_afterpay/order_component_builder.rb', line 7 def order @order end |
#popup_origin_url ⇒ Object (readonly)
Returns the value of attribute popup_origin_url.
7 8 9 |
# File 'app/models/solidus_afterpay/order_component_builder.rb', line 7 def popup_origin_url @popup_origin_url end |
#redirect_cancel_url ⇒ Object (readonly)
Returns the value of attribute redirect_cancel_url.
7 8 9 |
# File 'app/models/solidus_afterpay/order_component_builder.rb', line 7 def redirect_cancel_url @redirect_cancel_url end |
#redirect_confirm_url ⇒ Object (readonly)
Returns the value of attribute redirect_confirm_url.
7 8 9 |
# File 'app/models/solidus_afterpay/order_component_builder.rb', line 7 def redirect_confirm_url @redirect_confirm_url end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/models/solidus_afterpay/order_component_builder.rb', line 17 def call ::Afterpay::Components::Order.new( amount: amount, mode: mode, consumer: consumer, billing: address(order.billing_address), shipping: address(order.shipping_address), merchant: merchant, items: items, merchant_reference: order.number ) end |