From f24a77c533d5bfe9015457119591bd523a563e79 Mon Sep 17 00:00:00 2001 From: darkraul79 Date: Thu, 17 Feb 2022 18:35:42 +0100 Subject: [PATCH] Resuelvo Excepcion SetOrder No compruebo que los primeros caracteres del pedido sean numericos. --- src/Sermepa/Tpv/Tpv.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sermepa/Tpv/Tpv.php b/src/Sermepa/Tpv/Tpv.php index 434f23e..3eed983 100644 --- a/src/Sermepa/Tpv/Tpv.php +++ b/src/Sermepa/Tpv/Tpv.php @@ -176,7 +176,7 @@ public function setDateFrecuency($dateFrecuency) public function setOrder($order='') { $order = trim($order); - if (strlen($order) <= 3 || strlen($order) > 12 || !is_numeric(substr($order, 0, 4))) { + if (strlen($order) <= 3 || strlen($order) > 12 ) { throw new TpvException('Order id must be a 4 digit string at least, maximum 12 characters.'); } @@ -994,7 +994,7 @@ protected function isExpiryDate($expirydate='') */ protected function isValidOrder($order='') { - return ( strlen($order) >= 4 && strlen($order) <= 12 && is_numeric(substr($order, 0, 4)) )?true:false; + return ( strlen($order) >= 4 && strlen($order) <= 12 )?true:false; }