Sha256: c8bce1dbe5e787ec0197c787978d21e2367063f8e80e7c6a71cde6315b9cae7e

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

Spree::Payment::Processing.module_eval do
  def process!(amount = nil)
    if payment_method.is_a? Spree::Gateway::MollieGateway
      process_with_mollie
    else
      process_with_spree
    end
  end

  private

  def process_with_spree
    if payment_method && payment_method.auto_capture?
      purchase!
    else
      authorize!
    end
  end

  def process_with_mollie
    amount ||= money.money.cents
    started_processing!
    response = payment_method.create_transaction(
        amount,
        source,
        gateway_options
    )
    handle_response(response, :pend, :failure)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_mollie_gateway-1.0.7 app/models/spree/payment/processing_decorator.rb
spree_mollie_gateway-1.0.6 app/models/spree/payment/processing_decorator.rb