app/models/spree/payment_method/cash_on_delivery.rb
# Indicates whether its possible to capture the payment
Indicates whether its possible to capture the payment
Indicates whether its possible to capture the payment
def can_capture?(payment)
        return false if payment.completed?
        payment.order.shipments.all?{|shipment|shipment.state == 'shipped'} \
          && ['checkout', 'pending'].include?(payment.state)
      end
def can_capture? ( payment ) return false if payment . completed? payment . order . shipments . all? { | shipment | shipment . state == 'shipped' } && [ 'checkout' , 'pending' ] . include? ( payment . state ) end
Indicates whether its possible to capture the payment
Indicates whether its possible to capture the payment
payment