Sha256: efa764b159c825f8fa5a1b7d86ecfffe5f0974e6eec6daea2994dcefbfcb129d

Contents?: true

Size: 654 Bytes

Versions: 65

Compression:

Stored size: 654 Bytes

Contents

module Spree
  class PaymentMethod::Check < 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 cancel(response); end

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

    def source_required?
      false
    end
  end
end

Version data entries

65 entries across 65 versions & 2 rubygems

Version Path
solidus_core-1.2.3 app/models/spree/payment_method/check.rb
solidus_core-1.1.4 app/models/spree/payment_method/check.rb
solidus_core-1.0.7 app/models/spree/payment_method/check.rb
solidus_core-1.0.6 app/models/spree/payment_method/check.rb
solidus_core-1.2.2 app/models/spree/payment_method/check.rb
solidus_core-1.2.1 app/models/spree/payment_method/check.rb
solidus_core-1.1.3 app/models/spree/payment_method/check.rb
solidus_core-1.0.5 app/models/spree/payment_method/check.rb
solidus_core-1.2.0 app/models/spree/payment_method/check.rb
solidus_core-1.2.0.rc2 app/models/spree/payment_method/check.rb
solidus_core-1.0.4 app/models/spree/payment_method/check.rb
solidus_core-1.1.2 app/models/spree/payment_method/check.rb
solidus_core-1.2.0.rc1 app/models/spree/payment_method/check.rb
solidus_core-1.2.0.beta1 app/models/spree/payment_method/check.rb
solidus_core-1.0.3 app/models/spree/payment_method/check.rb
solidus_core-1.1.1 app/models/spree/payment_method/check.rb
solidus_core-1.1.0 app/models/spree/payment_method/check.rb
solidus_core-1.1.0.pre2 app/models/spree/payment_method/check.rb
solidus_core-1.1.0.pre1 app/models/spree/payment_method/check.rb
solidus_core-1.1.0.beta1 app/models/spree/payment_method/check.rb