From cea051923886155e9949295ceee166c5adb3bbad Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Sun, 20 Oct 2024 12:21:43 +0300 Subject: [PATCH] fix --- src/Validation/CustomerCreditCardValidation.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Validation/CustomerCreditCardValidation.php b/src/Validation/CustomerCreditCardValidation.php index bfc91358..a8e1ab06 100644 --- a/src/Validation/CustomerCreditCardValidation.php +++ b/src/Validation/CustomerCreditCardValidation.php @@ -60,16 +60,11 @@ public function __construct(SaferPayCardAliasRepository $saferPayCardAliasReposi */ public function validate($idSavedCard, $idCustomer) { - if (empty($idSavedCard) || empty($idCustomer)) { - $this->logger->error(sprintf('%s - Missing required data', self::FILE_NAME), [ - 'context' => [] - ]); - - throw SaferPayException::unknownError(); - } - - if (!is_numeric($idCustomer) || !is_numeric($idSavedCard)) { - $this->logger->error(sprintf('%s - Invalid data', self::FILE_NAME), [ + if ( + !is_numeric($idCustomer) || !is_numeric($idSavedCard) + || empty($idCustomer) || empty($idSavedCard)) + { + $this->logger->error(sprintf('%s - Invalid data or bad types', self::FILE_NAME), [ 'context' => [], 'id_saved_card' => $idSavedCard, 'id_customer' => $idCustomer