protected function notificationFailure($serviceResponse)
    {
        $omnipayResponse = $serviceResponse->getOmnipayResponse();

        // if there's no response from the gateway, don't bother. Errors are already in messages/log
        if (!$omnipayResponse) {
            return;
        }

        // void any pending partial payments
        $pending = $this->payment->getPartialPayments()->filter('Status', $this->pendingState);

        /** @var Payment $payment */
        foreach ($pending as $payment) {
            $payment->Status = 'Void';
            $payment->write();
        }

        // reset the payment to the start-state
        $this->payment->Status = $this->startState;
        $this->payment->write();
    }