Sha256: 92c4a831fae47f4d327625315e31a6104ab68f73d00e2d40cab49813f3b8f6f9
Contents?: true
Size: 851 Bytes
Versions: 24
Compression:
Stored size: 851 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(*) simulated_successful_billing_response end def cancel(*) simulated_successful_billing_response end def void(*) simulated_successful_billing_response end def source_required? false end def credit(*) simulated_successful_billing_response end private def simulated_successful_billing_response ActiveMerchant::Billing::Response.new(true, '', {}, {}) end end end
Version data entries
24 entries across 24 versions & 1 rubygems