Class: Spree::PurchaseOrder
- Inherits:
-
Base
- Object
- Base
- Spree::PurchaseOrder
- Defined in:
- app/models/spree/purchase_order.rb
Instance Method Summary collapse
- #actions ⇒ Object
-
#can_complete?(payment) ⇒ Boolean
Indicates whether its possible to complete the payment.
-
#can_void?(payment) ⇒ Boolean
Indicates whether its possible to void the payment.
Instance Method Details
#actions ⇒ Object
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
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.
18 19 20 |
# File 'app/models/spree/purchase_order.rb', line 18 def can_void?(payment) !payment.failed? && !payment.void? end |