public function cancel()
    {
        if (!$this->payment->IsComplete()) {
            $this->payment->Status = 'Void';
            $this->payment->write();
            ErrorHandling::safeExtend($this->payment, 'onCancelled');
        }

        return $this->generateServiceResponse(ServiceResponse::SERVICE_CANCELLED);
    }
public function cancel()
    {
        if (!$this->payment->IsComplete()) {
            $this->payment->Status = 'Void';
            $this->payment->write();
            ErrorHandling::safeExtend($this->payment, 'onCancelled');
        }

        return $this->generateServiceResponse(ServiceResponse::SERVICE_CANCELLED);
    }
public function cancel ( ) { if ( ! $ this -> payment -> IsComplete ( ) ) { $ this -> payment -> Status = 'Void' ; $ this -> payment -> write ( ) ; ErrorHandling :: safeExtend ( $ this -> payment , 'onCancelled' ) ; } return $ this -> generateServiceResponse ( ServiceResponse :: SERVICE_CANCELLED ) ; }
Cancel a payment

@throws \Exception
@throws \SilverStripe\ORM\ValidationException
@throws \SilverStripe\Omnipay\Exception\ServiceException
@return ServiceResponse
Cancel a payment