From 79cf1b3722010586749f62da2bbb9f8fe80857a8 Mon Sep 17 00:00:00 2001 From: Dominik Skerhak Date: Thu, 16 Sep 2021 13:33:59 +0200 Subject: [PATCH] Throw exception from PrivatbankarRecurrent->checkValid() We are not validating token. Found by new, strictier PHPStan: - Method Crm\PrivatbankarModule\Gateways\PrivatbankarRecurrent::checkValid() should return bool but return statement is missing. remp/crm#2007 --- src/Gateways/PrivatbankarRecurrent.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Gateways/PrivatbankarRecurrent.php b/src/Gateways/PrivatbankarRecurrent.php index baa0e1d..777c004 100644 --- a/src/Gateways/PrivatbankarRecurrent.php +++ b/src/Gateways/PrivatbankarRecurrent.php @@ -37,11 +37,12 @@ public function charge($payment, $token): string public function checkValid($token) { // TODO: 24 charges or 2 years since initial payment + throw new InvalidRequestException(self::GATEWAY_CODE . " gateway doesn't support checking if token is still valid"); } public function checkExpire($recurrentPayments) { - throw new InvalidRequestException("gateway doesn't support token expiration check"); + throw new InvalidRequestException(self::GATEWAY_CODE . " gateway doesn't support token expiration check"); } public function hasRecurrentToken(): bool