Sha256: 56fea251a6b2df4888e74d570686406288b5c6e9f5297c2f7aae9eada6f30035

Contents?: true

Size: 542 Bytes

Versions: 6

Compression:

Stored size: 542 Bytes

Contents

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

    def can_void?(payment)
      payment.state != 'void'
    end

    def can_capture?(payment)
      ['checkout', 'pending'].include?(payment.state)
    end

    def capture(payment, source, gateway)
      ActiveMerchant::Billing::Response.new(true, "", {}, {})
    end

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

    def source_required?
      false
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spree_loyalty_points-1.1.1 app/models/spree/payment_method/loyalty_points.rb
spree_loyalty_points-1.0.3 app/models/spree/payment_method/loyalty_points.rb
spree_loyalty_points-1.1.0 app/models/spree/payment_method/loyalty_points.rb
spree_loyalty_points-1.0.2 app/models/spree/payment_method/loyalty_points.rb
spree_loyalty_points-1.0.1 app/models/spree/payment_method/loyalty_points.rb
spree_loyalty_points-1.0.0 app/models/spree/payment_method/loyalty_points.rb