Stop using SystemException in PaypalCallbackAction
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 27 Oct 2021 09:16:11 +0000 (11:16 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 27 Oct 2021 09:16:11 +0000 (11:16 +0200)
wcfsetup/install/files/lib/action/PaypalCallbackAction.class.php

index 8080d8f2d45a70bfcb311c4356b9a5f2ca7a7d43..f972bc5ea479daf3afb93b750966aecdfce0d97a 100644 (file)
@@ -6,7 +6,6 @@ use GuzzleHttp\Psr7\Request;
 use Laminas\Diactoros\Response\EmptyResponse;
 use Psr\Http\Client\ClientExceptionInterface;
 use wcf\data\object\type\ObjectTypeCache;
-use wcf\system\exception\SystemException;
 use wcf\system\io\HttpFactory;
 use wcf\system\payment\type\IPaymentType;
 use wcf\util\StringUtil;
@@ -77,21 +76,21 @@ class PaypalCallbackAction extends AbstractAction
                     $exceptionMessage .= " and business ('" . $_POST['business'] . "')";
                 }
                 $exceptionMessage .= ", expected '" . PAYPAL_EMAIL_ADDRESS . "'.";
-                throw new SystemException($exceptionMessage);
+                throw new \Exception($exceptionMessage);
             }
 
             // get token
             if (!isset($_POST['custom'])) {
-                throw new SystemException('invalid custom item');
+                throw new \Exception('invalid custom item');
             }
             $tokenParts = \explode(':', $_POST['custom'], 2);
             if (\count($tokenParts) != 2) {
-                throw new SystemException('invalid custom item');
+                throw new \Exception('invalid custom item');
             }
             // get payment type object type
             $objectType = ObjectTypeCache::getInstance()->getObjectType(\intval($tokenParts[0]));
             if ($objectType === null || !($objectType->getProcessor() instanceof IPaymentType)) {
-                throw new SystemException('invalid payment type id');
+                throw new \Exception('invalid payment type id');
             }
             $processor = $objectType->getProcessor();