Sha256: c36f0e467d734954ca7ac8c7ba75e87d7e0f43f749ab52fd780bc355de856c4d

Contents?: true

Size: 845 Bytes

Versions: 2

Compression:

Stored size: 845 Bytes

Contents

module Spree
  module PaymentDecorator
    def handle_response(response, success_state, failure_state)
      self.intent_client_key = response.params['client_secret'] if response.params['client_secret'] && response.success?
      super
    end

    def verify!(**options)
      process_verification(options)
    end

    private

    def process_verification(**options)
      protect_from_connection_error do
        response = payment_method.verify(source, options)

        record_response(response)

        if response.success?
          unless response.authorization.nil?
            self.response_code = response.authorization

            source.update(status: response.params['status'])
          end
        else
          gateway_error(response)
        end
      end
    end
  end
end

Spree::Payment.prepend(Spree::PaymentDecorator)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_gateway-3.9.2 app/models/spree/payment_decorator.rb
spree_gateway-3.9.0 app/models/spree/payment_decorator.rb