Class: Spree::SolidusSixSaferpay::PaymentProcessingSuccessHandler

Inherits:
Object
  • Object
show all
Defined in:
app/services/spree/solidus_six_saferpay/payment_processing_success_handler.rb

Overview

This handler can be overridden by host applications to manage control flow after the payment authorization was successful and the payment was verified. If not overridden, the handler will simply ensure that the order has moved from the “payment” state to the next state.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller_context:, order:) ⇒ PaymentProcessingSuccessHandler

Returns a new instance of PaymentProcessingSuccessHandler.



16
17
18
19
# File 'app/services/spree/solidus_six_saferpay/payment_processing_success_handler.rb', line 16

def initialize(controller_context:, order:)
  @controller_context = controller_context
  @order = order
end

Instance Attribute Details

#controller_contextObject (readonly)

Returns the value of attribute controller_context.



10
11
12
# File 'app/services/spree/solidus_six_saferpay/payment_processing_success_handler.rb', line 10

def controller_context
  @controller_context
end

#orderObject (readonly)

Returns the value of attribute order.



10
11
12
# File 'app/services/spree/solidus_six_saferpay/payment_processing_success_handler.rb', line 10

def order
  @order
end

Class Method Details

.call(controller_context:, order:) ⇒ Object



12
13
14
# File 'app/services/spree/solidus_six_saferpay/payment_processing_success_handler.rb', line 12

def self.call(controller_context:, order:)
  new(controller_context: controller_context, order: order).call
end

Instance Method Details

#callObject



21
22
23
# File 'app/services/spree/solidus_six_saferpay/payment_processing_success_handler.rb', line 21

def call
  order.next! if order.payment?
end