Sha256: 48df1094b95a590ce50eb0016677e47529c8d6ad9fbc32dcc8c840f495bfe273

Contents?: true

Size: 895 Bytes

Versions: 2

Compression:

Stored size: 895 Bytes

Contents

module Spree
  module SolidusSixSaferpay

    # This handler can be overridden by host applications to manage control
    # flow if no order can be found when SIX Saferpay performs the callback
    # request after the user submits a payment.
    # If not overridden, the handler will simply trigger an error.
    class OrderNotFoundHandler

      attr_reader :controller_context, :order_number

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

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

      def call
        ::SolidusSixSaferpay::ErrorHandler.handle(
          StandardError.new("No solidus order could be found for number #{order_number}")
        )
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_six_saferpay-0.5.0 app/services/spree/solidus_six_saferpay/order_not_found_handler.rb
solidus_six_saferpay-0.4.0 app/services/spree/solidus_six_saferpay/order_not_found_handler.rb