Sha256: 1001f3ca491bad764d034ce226695dae762db2c3d636eaa60c8dc97635dd0444

Contents?: true

Size: 635 Bytes

Versions: 4

Compression:

Stored size: 635 Bytes

Contents

module Spree
  class PaymentMethod::BankTransfer < PaymentMethod
    
    def actions
      %w{capture void}
    end

    # Indicates whether its possible to capture the payment
    def can_capture?(payment)
      ['checkout', 'pending'].include?(payment.state)
    end

    # Indicates whether its possible to void the payment.
    def can_void?(payment)
      payment.state != 'void'
    end

    def capture(*args)
      ActiveMerchant::Billing::Response.new(true, "", {}, {})
    end

    def void(*args)
      ActiveMerchant::Billing::Response.new(true, "", {}, {})
    end

    def source_required?
      false
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree-bank-transfer-2.2.1 app/models/spree/payment_method/bank_transfer.rb
spree-bank-transfer-2.2.0 app/models/spree/payment_method/bank_transfer.rb
spree-bank-transfer-2.1.0 app/models/spree/payment_method/bank_transfer.rb
spree-bank-transfer-2.0.5 app/models/spree/payment_method/bank_transfer.rb