Sha256: eb7fa76ce9482c4004897e87e819d44b44acaecdb147ae64bf769291d5fe6d4f
Contents?: true
Size: 513 Bytes
Versions: 12
Compression:
Stored size: 513 Bytes
Contents
module Spree class PurchaseOrder < Spree::Base belongs_to :payment_method has_many :payments, as: :source validates_presence_of :po_number, :organization_name def actions %w(complete void) end # Indicates whether its possible to complete the payment def can_complete?(payment) payment.pending? || payment.checkout? end # Indicates whether its possible to void the payment. def can_void?(payment) !payment.failed? && !payment.void? end end end
Version data entries
12 entries across 12 versions & 1 rubygems