(self)
Check the state of the transactions and request their capture.
Check the state of the transactions and request their capture.
Check the state of the transactions and request their capture .
def action_capture(self):
        """ Check the state of the transactions and request their capture. """
        if any(tx.state != 'authorized' for tx in self):
            raise ValidationError(_("Only authorized transactions can be captured."))

        for tx in self:
            tx._send_capture_request()
def action_capture ( self ) : if any ( tx . state != 'authorized' for tx in self ) : raise ValidationError ( _ ( "Only authorized transactions can be captured." ) ) for tx in self : tx . _send_capture_request ( )