From 977f20221f2dcd072688950afa0a1c61a9784b62 Mon Sep 17 00:00:00 2001 From: esposimo Date: Fri, 12 Apr 2024 01:40:10 +0200 Subject: [PATCH] fix cache key pspInviaCarrelloRPTCarte --- .../req/pspInviaCarrelloRPTCarte.php | 19 +++++++++++++++++-- ...thNodoInviaCarrelloRPT_1_RPT_ExtraInfo.php | 1 - 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/src/crawler/paymentlist/req/pspInviaCarrelloRPTCarte.php b/src/src/crawler/paymentlist/req/pspInviaCarrelloRPTCarte.php index 9a2c67c3..aef7e8c3 100644 --- a/src/src/crawler/paymentlist/req/pspInviaCarrelloRPTCarte.php +++ b/src/src/crawler/paymentlist/req/pspInviaCarrelloRPTCarte.php @@ -42,7 +42,15 @@ public function isAttempt(int $index = 0): bool */ public function isAttemptInCache(int $index = 0): bool { - $key = $this->getEvent()->getCacheKeyAttempt(); + // se sono valorizzate le colonne + $key = $this->getEvent()->getCacheKeyAttempt(); + $iuv = $this->getEvent()->getColumn('iuv'); + $pa_emittente = $this->getEvent()->getColumn('iddominio'); + $token = $this->getEvent()->getColumn('ccp'); + if (($iuv) && ($pa_emittente) && ($token)) + { + $key = base64_encode(sprintf('attempt_%s_%s_%s', $iuv, $pa_emittente, $token)); + } return $this->hasInCache($key); } @@ -51,7 +59,14 @@ public function isAttemptInCache(int $index = 0): bool */ public function isPaymentInCache(int $index = 0): bool { - $key = $this->getEvent()->getCacheKeyAttempt(); + $key = $this->getEvent()->getCacheKeyAttempt(); + $iuv = $this->getEvent()->getColumn('iuv'); + $pa_emittente = $this->getEvent()->getColumn('iddominio'); + $token = $this->getEvent()->getColumn('ccp'); + if (($iuv) && ($pa_emittente) && ($token)) + { + $key = base64_encode(sprintf('attempt_%s_%s_%s', $iuv, $pa_emittente, $token)); + } return $this->hasInCache($key); } diff --git a/src/tests/process/crawler/pspInviaCarrelloRPTCarte/T00043_UpdatePspWithNodoInviaCarrelloRPT_1_RPT_ExtraInfo.php b/src/tests/process/crawler/pspInviaCarrelloRPTCarte/T00043_UpdatePspWithNodoInviaCarrelloRPT_1_RPT_ExtraInfo.php index 5906514a..32fe4ecd 100644 --- a/src/tests/process/crawler/pspInviaCarrelloRPTCarte/T00043_UpdatePspWithNodoInviaCarrelloRPT_1_RPT_ExtraInfo.php +++ b/src/tests/process/crawler/pspInviaCarrelloRPTCarte/T00043_UpdatePspWithNodoInviaCarrelloRPT_1_RPT_ExtraInfo.php @@ -81,7 +81,6 @@ public function testWorkFlow() $this->assertEquals('T000085', $workflow->getColumnValue('event_id')); $this->assertNull($workflow->getColumnValue('stazione')); $this->assertEquals('OK', $workflow->getColumnValue('outcome')); - } #[TestDox('[EXTRAINFO] Verifica presenza Extra Info')]