Class: SolidusAfterpay::UpdateOrderAttributesService

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/solidus_afterpay/update_order_attributes_service.rb

Instance Method Summary collapse

Methods inherited from BaseService

call

Constructor Details

#initialize(order:, afterpay_order_token:, payment_method:, request_env:) ⇒ UpdateOrderAttributesService

Returns a new instance of UpdateOrderAttributesService.



5
6
7
8
9
10
11
12
# File 'app/services/solidus_afterpay/update_order_attributes_service.rb', line 5

def initialize(order:, afterpay_order_token:, payment_method:, request_env:)
  @order = order
  @afterpay_order_token = afterpay_order_token
  @payment_method = payment_method
  @request_env = request_env

  super()
end

Instance Method Details

#callObject



14
15
16
17
18
# File 'app/services/solidus_afterpay/update_order_attributes_service.rb', line 14

def call
  return false if afterpay_order.nil?

  ::Spree::OrderUpdateAttributes.new(order, update_params, request_env: request_env).apply
end