Class: Spree::PurchaseOrder

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree/purchase_order.rb

Instance Method Summary collapse

Instance Method Details

#actionsObject



8
9
10
# File 'app/models/spree/purchase_order.rb', line 8

def actions
  %w(complete void)
end

#can_complete?(payment) ⇒ Boolean

Indicates whether its possible to complete the payment

Returns:

  • (Boolean)


13
14
15
# File 'app/models/spree/purchase_order.rb', line 13

def can_complete?(payment)
  payment.pending? || payment.checkout?
end

#can_void?(payment) ⇒ Boolean

Indicates whether its possible to void the payment.

Returns:

  • (Boolean)


18
19
20
# File 'app/models/spree/purchase_order.rb', line 18

def can_void?(payment)
  !payment.failed? && !payment.void?
end