Sha256: 9da4c9227642483e92edcf541d096dbb52091b6b1d979f6e4ff8a0a415f99928
Contents?: true
Size: 839 Bytes
Versions: 138
Compression:
Stored size: 839 Bytes
Contents
# frozen_string_literal: true module Spree class PaymentMethod::Check < PaymentMethod def actions %w{capture void credit} 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 void(*) simulated_successful_billing_response end alias_method :try_void, :void def credit(*) simulated_successful_billing_response end def source_required? false end def simulated_successful_billing_response ActiveMerchant::Billing::Response.new(true, "", {}, {}) end end end
Version data entries
138 entries across 138 versions & 2 rubygems