Class: Workarea::GlobalE::Api::PerformOrderPayment

Inherits:
Object
  • Object
show all
Defined in:
app/services/workarea/global_e/api/perform_order_payment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order, merchant_order) ⇒ PerformOrderPayment

Returns a new instance of PerformOrderPayment.



7
8
9
10
# File 'app/services/workarea/global_e/api/perform_order_payment.rb', line 7

def initialize(order, merchant_order)
  @order = order
  @merchant_order = merchant_order
end

Instance Attribute Details

#merchant_orderObject (readonly)

Returns the value of attribute merchant_order.



5
6
7
# File 'app/services/workarea/global_e/api/perform_order_payment.rb', line 5

def merchant_order
  @merchant_order
end

#orderObject (readonly)

Returns the value of attribute order.



5
6
7
# File 'app/services/workarea/global_e/api/perform_order_payment.rb', line 5

def order
  @order
end

Instance Method Details

#responseObject



12
13
14
15
16
17
18
19
20
# File 'app/services/workarea/global_e/api/perform_order_payment.rb', line 12

def response
  @response ||=
    begin
      order.global_e_approve!
      update_payment
      update_fulfillment
      Workarea::GlobalE::Merchant::ResponseInfo.new(order: order)
    end
end