Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijusCoding committed Oct 20, 2024
1 parent d69dcd2 commit cea0519
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/Validation/CustomerCreditCardValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cea0519

Please sign in to comment.