From 950b54488823cd70796e9e3a4def6b31a7a71a3a Mon Sep 17 00:00:00 2001 From: esposimo Date: Fri, 3 May 2024 22:52:38 +0200 Subject: [PATCH] add nodoInoltraEsitoPAgamentoPayPayl to the crawler --- src/mock_crawler.php | 8 +- src/mock_insert.php | 291 ++++++++++++++++++ src/sql/02_2024_create_table.sql | 4 +- src/sql/05_2024_insert_data.sql | 4 +- src/src/crawler/CacheObject.php | 20 ++ .../req/nodoInoltraEsitoPagamentoPayPal.php | 171 ++++++++++ .../resp/nodoInoltraEsitoPagamentoPayPal.php | 180 +++++++++++ .../req/nodoInoltraEsitoPagamentoPayPal.php | 56 ++++ .../resp/nodoInoltraEsitoPagamentoPayPal.php | 29 ++ .../req/nodoInoltraEsitoPagamentoPayPal.php | 62 ++++ .../paymentlist/req/pspNotifyPaymentV2.php | 3 +- .../resp/nodoInoltraEsitoPagamentoPayPal.php | 42 +++ .../nodoInoltraEsitoPagamentoPayPalTest.php | 108 +++++++ .../nodoInoltraEsitoPagamentoPayPalTest.php | 107 +++++++ .../nodoInoltraEsitoPagamentoPayPalTest.php | 216 +++++++++++++ .../nodoInoltraEsitoPagamentoPayPalTest.php | 275 +++++++++++++++++ src/tests/phpunit.xml | 9 +- ....php => T00063_WorkFlowWithCdInfoWisp.php} | 2 +- ...lowWithNodoInoltraEsitoPagamentoPayPal.php | 197 ++++++++++++ 19 files changed, 1776 insertions(+), 8 deletions(-) create mode 100644 src/src/crawler/events/req/nodoInoltraEsitoPagamentoPayPal.php create mode 100644 src/src/crawler/events/resp/nodoInoltraEsitoPagamentoPayPal.php create mode 100644 src/src/crawler/methods/req/nodoInoltraEsitoPagamentoPayPal.php create mode 100644 src/src/crawler/methods/resp/nodoInoltraEsitoPagamentoPayPal.php create mode 100644 src/src/crawler/paymentlist/req/nodoInoltraEsitoPagamentoPayPal.php create mode 100644 src/src/crawler/paymentlist/resp/nodoInoltraEsitoPagamentoPayPal.php create mode 100644 src/tests/pagopa/events/req/nodoInoltraEsitoPagamentoPayPalTest.php create mode 100644 src/tests/pagopa/events/resp/nodoInoltraEsitoPagamentoPayPalTest.php create mode 100644 src/tests/pagopa/methods/req/nodoInoltraEsitoPagamentoPayPalTest.php create mode 100644 src/tests/pagopa/methods/resp/nodoInoltraEsitoPagamentoPayPalTest.php rename src/tests/process/crawler/cdInfoWisp/{T00063_WorkFlowWithcdInfoWisp.php => T00063_WorkFlowWithCdInfoWisp.php} (99%) create mode 100644 src/tests/process/crawler/nodoInoltraEsitoPagamentoPayPal/T00064_WorkFlowWithNodoInoltraEsitoPagamentoPayPal.php diff --git a/src/mock_crawler.php b/src/mock_crawler.php index 41e47e29..bcd01bad 100644 --- a/src/mock_crawler.php +++ b/src/mock_crawler.php @@ -142,7 +142,13 @@ $a = new \pagopa\crawler\paymentlist\req\nodoInoltraEsitoPagamentoCarta(new DateTime('2024-03-10'), 'nodoInoltraEsitoPagamentoCarta', 'REQ', $redis_cache); $a->run(); -$a = new \pagopa\crawler\paymentlist\resp\nodoInoltraEsitoPagamentoCarta(new DateTime('2024-03-10'), 'nodoInoltraEsitoPagamentoCarta', 'RESP', $redis_cache); +$a = new \pagopa\crawler\paymentlist\resp\nodoInoltraEsitoPagamentoCarta(new \DateTime('2024-03-10'), 'nodoInoltraEsitoPagamentoCarta', 'RESP', $redis_cache); +$a->run(); + +$a = new \pagopa\crawler\paymentlist\req\nodoInoltraEsitoPagamentoPayPal(new \DateTime('2024-03-10'), 'nodoInoltraEsitoPagamentoPayPal', 'REQ', $redis_cache); +$a->run(); + +$a = new \pagopa\crawler\paymentlist\resp\nodoInoltraEsitoPagamentoPayPal(new \DateTime('2024-03-10'), 'nodoInoltraEsitoPagamentoPayPal', 'RESP', $redis_cache); $a->run(); diff --git a/src/mock_insert.php b/src/mock_insert.php index a14b1a49..6685df22 100644 --- a/src/mock_insert.php +++ b/src/mock_insert.php @@ -5579,5 +5579,296 @@ ]; +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +$data_req = [ + ':id' => 230, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 15:42:00.197', + ':tipoevento' => 'activateIOPayment', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000185', + ':ccp' => 't0000000000000000000000000000185', + ':noticenumber' => '301000000000000185', + ':creditorreferenceid' => '01000000000000185', + ':paymenttoken' => 't0000000000000000000000000000185', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100204', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000230', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHNvYXA6RW52ZWxvcGUgeG1sbnM6bmZwc3A9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvbm9kZS9ub2RlRm9ySU8ueHNkIiB4bWxuczpzb2FwPSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VudmVsb3BlLyIgeG1sbnM6dG5zPSJodHRwOi8vcGFnb3BhLWFwaS5wYWdvcGEuZ292Lml0L25vZGUvbm9kZUZvcklPLndzZGwiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiPgoJPHNvYXA6Qm9keT4KCQk8bmZwc3A6YWN0aXZhdGVJT1BheW1lbnRSZXEgeG1sbnM6bmZwc3A9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvbm9kZS9ub2RlRm9ySU8ueHNkIj4KCQkJPGlkUFNQPkFHSURfMDE8L2lkUFNQPgoJCQk8aWRCcm9rZXJQU1A+Nzc3Nzc3Nzc3Nzc8L2lkQnJva2VyUFNQPgoJCQk8aWRDaGFubmVsPjc3Nzc3Nzc3Nzc3XzAxPC9pZENoYW5uZWw+CgkJCTxwYXNzd29yZD54eHh4eHg8L3Bhc3N3b3JkPgoJCQk8cXJDb2RlPgoJCQkJPGZpc2NhbENvZGU+Nzc3Nzc3Nzc3Nzc8L2Zpc2NhbENvZGU+CgkJCQk8bm90aWNlTnVtYmVyPjMwMTAwMDAwMDAwMDAwMDE4NTwvbm90aWNlTnVtYmVyPgoJCQk8L3FyQ29kZT4KCQkJPGFtb3VudD41MC4wMDwvYW1vdW50PgoJCTwvbmZwc3A6YWN0aXZhdGVJT1BheW1lbnRSZXE+Cgk8L3NvYXA6Qm9keT4KPC9zb2FwOkVudmVsb3BlPg==', +]; + +$data_resp = [ + ':id' => 231, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 15:42:01.197', + ':tipoevento' => 'activateIOPayment', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000185', + ':ccp' => 't0000000000000000000000000000185', + ':noticenumber' => '301000000000000185', + ':creditorreferenceid' => '01000000000000185', + ':paymenttoken' => 't0000000000000000000000000000185', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100204', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000231', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpuZnBzcD0iaHR0cDovL3BhZ29wYS1hcGkucGFnb3BhLmdvdi5pdC9ub2RlL25vZGVGb3JJTy54c2QiIHhtbG5zOnNvYXBlbnY9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiPgoJPHNvYXBlbnY6Qm9keT4KCQk8bmZwc3A6YWN0aXZhdGVJT1BheW1lbnRSZXM+CgkJCTxvdXRjb21lPk9LPC9vdXRjb21lPgoJCQk8dG90YWxBbW91bnQ+NTAuMDA8L3RvdGFsQW1vdW50PgoJCQk8cGF5bWVudERlc2NyaXB0aW9uPnh4eHh4eDwvcGF5bWVudERlc2NyaXB0aW9uPgoJCQk8ZmlzY2FsQ29kZVBBPjc3Nzc3Nzc3Nzc3PC9maXNjYWxDb2RlUEE+CgkJCTxjb21wYW55TmFtZT54eHh4PC9jb21wYW55TmFtZT4KCQkJPHBheW1lbnRUb2tlbj50MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDE4NTwvcGF5bWVudFRva2VuPgoJCQk8Y3JlZGl0b3JSZWZlcmVuY2VJZD4wMTAwMDAwMDAwMDAwMDE4NTwvY3JlZGl0b3JSZWZlcmVuY2VJZD4KCQk8L25mcHNwOmFjdGl2YXRlSU9QYXltZW50UmVzPgoJPC9zb2FwZW52OkJvZHk+Cjwvc29hcGVudjpFbnZlbG9wZT4=', +]; + + +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + + + + + + +$data_req = [ + ':id' => 232, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 15:43:00.197', + ':tipoevento' => 'nodoChiediInformazioniPagamento', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000185', + ':ccp' => 't0000000000000000000000000000185', + ':noticenumber' => '301000000000000185', + ':creditorreferenceid' => '01000000000000185', + ':paymenttoken' => 't0000000000000000000000000000185', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100205', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000232', + ':payload' => '', +]; + +$data_resp = [ + ':id' => 233, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 15:43:01.197', + ':tipoevento' => 'nodoChiediInformazioniPagamento', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000185', + ':ccp' => 't0000000000000000000000000000185', + ':noticenumber' => '301000000000000185', + ':creditorreferenceid' => '01000000000000185', + ':paymenttoken' => 't0000000000000000000000000000185', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100205', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000233', + ':payload' => 'ewogICAgIklCQU4iOiAiSVQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxIiwKICAgICJib2xsb0RpZ2l0YWxlIjogZmFsc2UsCiAgICAiY29kaWNlRmlzY2FsZSI6ICJYWFhYWFhYWFhYWFhYWFhYIiwKICAgICJkZXR0YWdsaSI6IFsKICAgICAgICB7CiAgICAgICAgICAgICJDQ1AiOiAidDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxODUiLAogICAgICAgICAgICAiSVVWIjogIjAxMDAwMDAwMDAwMDAwMTg1IiwKICAgICAgICAgICAgImNvZGljZVBhZ2F0b3JlIjogIlhYWFhYWFhYWFhYWFhYWFgiLAogICAgICAgICAgICAiZW50ZUJlbmVmaWNpYXJpbyI6ICJ4eHh4eCIsCiAgICAgICAgICAgICJpZERvbWluaW8iOiAiNzc3Nzc3Nzc3NzciLAogICAgICAgICAgICAiaW1wb3J0byI6IDUwLjAwLAogICAgICAgICAgICAibm9tZVBhZ2F0b3JlIjogIlhYWFhYWFhYWFhYWFhYWFgiLAogICAgICAgICAgICAidGlwb1BhZ2F0b3JlIjogIkYiCiAgICAgICAgfQogICAgXSwKICAgICJpbXBvcnRvVG90YWxlIjogNTAuMDAsCiAgICAib2dnZXR0b1BhZ2FtZW50byI6ICJ4eHh4eHh4IiwKICAgICJyYWdpb25lU29jaWFsZSI6ICJ4eHh4IiwKICAgICJ1cmxSZWRpcmVjdEVDIjogImh0dHBzOi8vZXhhbXBsZS5jb20iCn0=', +]; + + +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + + + + + + + + + + +$data_req = [ + ':id' => 234, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 15:44:00.197', + ':tipoevento' => 'nodoInoltraEsitoPagamentoPayPal', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000185', + ':ccp' => 't0000000000000000000000000000185', + ':noticenumber' => '301000000000000185', + ':creditorreferenceid' => '01000000000000185', + ':paymenttoken' => 't0000000000000000000000000000185', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100206', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000234', + ':payload' => 'ewogICAgImlkUGFnYW1lbnRvIjogImFlYTllNmU5YzdlYzc5ZWU2YWM5YTZlNmU5NmM5ZWUyIiwKICAgICJpZFRyYW5zYXppb25lIjogIjIyMjIyMjIyMiIsCiAgICAiaWRUcmFuc2F6aW9uZVBzcCI6ICI5OTk5OTk5OTk5OTk5OSIsCiAgICAiaWRlbnRpZmljYXRpdm9DYW5hbGUiOiAiODg4ODg4ODg4ODhfMDEiLAogICAgImlkZW50aWZpY2F0aXZvSW50ZXJtZWRpYXJpbyI6ICI4ODg4ODg4ODg4OCIsCiAgICAiaWRlbnRpZmljYXRpdm9Qc3AiOiAiQUdJRF8wMSIsCiAgICAiaW1wb3J0b1RvdGFsZVBhZ2F0byI6IDUwLjAwLAogICAgInRpbWVzdGFtcE9wZXJhemlvbmUiOiAiMjAyNC0wNS0wMlQyMzo1NzozOC4wMDErMDI6MDAiCn0=', +]; + +$data_resp = [ + ':id' => 235, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 15:44:50.197', + ':tipoevento' => 'nodoInoltraEsitoPagamentoPayPal', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000185', + ':ccp' => 't0000000000000000000000000000185', + ':noticenumber' => '301000000000000185', + ':creditorreferenceid' => '01000000000000185', + ':paymenttoken' => 't0000000000000000000000000000185', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100206', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000235', + ':payload' => 'eyJlc2l0byI6Ik9LIn0=', +]; + + +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + + + + + +$data_req = [ + ':id' => 236, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 15:44:10.197', + ':tipoevento' => 'pspNotifyPayment', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000185', + ':ccp' => 't0000000000000000000000000000185', + ':noticenumber' => '301000000000000185', + ':creditorreferenceid' => '01000000000000185', + ':paymenttoken' => 't0000000000000000000000000000185', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100207', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000236', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpjb21tb249Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQveHNkL2NvbW1vbi10eXBlcy92MS4wLjAvIiB4bWxuczpwZm49Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvcHNwL3BzcEZvck5vZGUueHNkIiB4bWxuczpzb2FwZW52PSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VudmVsb3BlLyIgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIj4KCTxzb2FwZW52OkJvZHk+CgkJPHBmbjpwc3BOb3RpZnlQYXltZW50UmVxPgoJCQk8aWRQU1A+QUdJRF8wMTwvaWRQU1A+CgkJCTxpZEJyb2tlclBTUD44ODg4ODg4ODg4ODwvaWRCcm9rZXJQU1A+CgkJCTxpZENoYW5uZWw+ODg4ODg4ODg4ODhfMDE8L2lkQ2hhbm5lbD4KCQkJPHBheW1lbnRUb2tlbj50MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDE4NTwvcGF5bWVudFRva2VuPgoJCQk8cGF5bWVudERlc2NyaXB0aW9uPnBhZ2FtZW50byBtdWx0aWJlbmVmaWNpYXJpbzwvcGF5bWVudERlc2NyaXB0aW9uPgoJCQk8ZmlzY2FsQ29kZVBBPjc3Nzc3Nzc3Nzc3PC9maXNjYWxDb2RlUEE+CgkJCTxjb21wYW55TmFtZT54eHh4eHh4PC9jb21wYW55TmFtZT4KCQkJPGNyZWRpdG9yUmVmZXJlbmNlSWQ+MDEwMDAwMDAwMDAwMDAxODU8L2NyZWRpdG9yUmVmZXJlbmNlSWQ+CgkJCTxkZWJ0QW1vdW50PjUwLjAwPC9kZWJ0QW1vdW50PgoJCQk8dHJhbnNmZXJMaXN0PgoJCQkJPHRyYW5zZmVyPgoJCQkJCTxpZFRyYW5zZmVyPjE8L2lkVHJhbnNmZXI+CgkJCQkJPHRyYW5zZmVyQW1vdW50PjUwLjAwPC90cmFuc2ZlckFtb3VudD4KCQkJCQk8ZmlzY2FsQ29kZVBBPjc3Nzc3Nzc3Nzc3PC9maXNjYWxDb2RlUEE+CgkJCQkJPElCQU4+SVQxOFUwMDAwMDAwMDAwMDAwMDAwMDAwMDAxPC9JQkFOPgoJCQkJCTxyZW1pdHRhbmNlSW5mb3JtYXRpb24+eHh4eDwvcmVtaXR0YW5jZUluZm9ybWF0aW9uPgoJCQkJPC90cmFuc2Zlcj4KCQkJPC90cmFuc2Zlckxpc3Q+CgkJCTxwYXlwYWxQYXltZW50PgoJCQkJPHRyYW5zYWN0aW9uSWQ+MjIyMjIyMjIyPC90cmFuc2FjdGlvbklkPgoJCQkJPHBzcFRyYW5zYWN0aW9uSWQ+OTk5OTk5OTk5OTk5OTk8L3BzcFRyYW5zYWN0aW9uSWQ+CgkJCQk8dG90YWxBbW91bnQ+NTEuNTA8L3RvdGFsQW1vdW50PgoJCQkJPGZlZT4xLjUwPC9mZWU+CgkJCQk8dGltZXN0YW1wT3BlcmF0aW9uPjIwMjQtMDUtMDJUMjI6MTA6MTg8L3RpbWVzdGFtcE9wZXJhdGlvbj4KCQkJPC9wYXlwYWxQYXltZW50PgoJCTwvcGZuOnBzcE5vdGlmeVBheW1lbnRSZXE+Cgk8L3NvYXBlbnY6Qm9keT4KPC9zb2FwZW52OkVudmVsb3BlPg==', +]; + +$data_resp = [ + ':id' => 237, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 15:44:30.197', + ':tipoevento' => 'pspNotifyPayment', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000185', + ':ccp' => 't0000000000000000000000000000185', + ':noticenumber' => '301000000000000185', + ':creditorreferenceid' => '01000000000000185', + ':paymenttoken' => 't0000000000000000000000000000185', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100207', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000237', + ':payload' => 'PFNPQVAtRU5WOkVudmVsb3BlIHhtbG5zOlNPQVAtRU5WPSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VudmVsb3BlLyI+PFNPQVAtRU5WOkhlYWRlci8+PFNPQVAtRU5WOkJvZHk+PG5zMzpwc3BOb3RpZnlQYXltZW50UmVzIHhtbG5zOm5zMz0iaHR0cDovL3BhZ29wYS1hcGkucGFnb3BhLmdvdi5pdC9wc3AvcHNwRm9yTm9kZS54c2QiPjxvdXRjb21lPk9LPC9vdXRjb21lPjwvbnMzOnBzcE5vdGlmeVBheW1lbnRSZXM+PC9TT0FQLUVOVjpCb2R5PjwvU09BUC1FTlY6RW52ZWxvcGU+', +]; + + +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + + + + + + + +$data_req = [ + ':id' => 238, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 15:46:10.197', + ':tipoevento' => 'sendPaymentOutcome', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000185', + ':ccp' => 't0000000000000000000000000000185', + ':noticenumber' => '301000000000000185', + ':creditorreferenceid' => '01000000000000185', + ':paymenttoken' => 't0000000000000000000000000000185', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100208', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000238', + ':payload' => 'PHNvYXA6RW52ZWxvcGUgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iPgoJPHNvYXA6Qm9keT4KCQk8bnMyOnNlbmRQYXltZW50T3V0Y29tZVJlcSB4bWxuczpuczI9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvbm9kZS9ub2RlRm9yUHNwLnhzZCIgeG1sbnM6bnMzPSJodHRwOi8vd3MucGFnYW1lbnRpLnRlbGVtYXRpY2kuZ292LyI+CgkJCTxpZFBTUD5BR0lEXzAxPC9pZFBTUD4KCQkJPGlkQnJva2VyUFNQPjg4ODg4ODg4ODg4PC9pZEJyb2tlclBTUD4KCQkJPGlkQ2hhbm5lbD44ODg4ODg4ODg4OF8wMTwvaWRDaGFubmVsPgoJCQk8cGFzc3dvcmQ+eHh4eHh4eHg8L3Bhc3N3b3JkPgoJCQk8cGF5bWVudFRva2VuPnQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMTg1PC9wYXltZW50VG9rZW4+CgkJCTxvdXRjb21lPk9LPC9vdXRjb21lPgoJCQk8ZGV0YWlscz4KCQkJCTxwYXltZW50TWV0aG9kPm90aGVyPC9wYXltZW50TWV0aG9kPgoJCQkJPGZlZT4xLjUwPC9mZWU+CgkJCQk8YXBwbGljYXRpb25EYXRlPjIwMjQtMDQtMDI8L2FwcGxpY2F0aW9uRGF0ZT4KCQkJCTx0cmFuc2ZlckRhdGU+MjAyNC0wNC0wMzwvdHJhbnNmZXJEYXRlPgoJCQk8L2RldGFpbHM+CgkJPC9uczI6c2VuZFBheW1lbnRPdXRjb21lUmVxPgoJPC9zb2FwOkJvZHk+Cjwvc29hcDpFbnZlbG9wZT4=', +]; + +$data_resp = [ + ':id' => 239, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 15:46:30.197', + ':tipoevento' => 'sendPaymentOutcome', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000185', + ':ccp' => 't0000000000000000000000000000185', + ':noticenumber' => '301000000000000185', + ':creditorreferenceid' => '01000000000000185', + ':paymenttoken' => 't0000000000000000000000000000185', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100208', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000239', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpjb21tb249Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQveHNkL2NvbW1vbi10eXBlcy92MS4wLjAvIiB4bWxuczpuZnA9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvbm9kZS9ub2RlRm9yUHNwLnhzZCIgeG1sbnM6c29hcGVudj0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSI+Cgk8c29hcGVudjpCb2R5PgoJCTxuZnA6c2VuZFBheW1lbnRPdXRjb21lUmVzPgoJCQk8b3V0Y29tZT5PSzwvb3V0Y29tZT4KCQk8L25mcDpzZW5kUGF5bWVudE91dGNvbWVSZXM+Cgk8L3NvYXBlbnY6Qm9keT4KPC9zb2FwZW52OkVudmVsb3BlPg==', +]; + + Capsule::statement($render_query, $data_req); Capsule::statement($render_query, $data_resp); \ No newline at end of file diff --git a/src/sql/02_2024_create_table.sql b/src/sql/02_2024_create_table.sql index ffd28b1d..3585fe83 100644 --- a/src/sql/02_2024_create_table.sql +++ b/src/sql/02_2024_create_table.sql @@ -95,8 +95,8 @@ create table if not exists public.extra_info_2024 ( id bigint default nextval('public.extra_information_2024_id_seq'::regclass) not null, date_event date not null, fk_payment bigint null, - info_name varchar(20) not null, - info_value varchar(80) not null, + info_name varchar(30) not null, + info_value varchar(50) not null, constraint "EXTRA_INFO_2024_pk" primary key (date_event, id) ) PARTITION BY RANGE (date_event); diff --git a/src/sql/05_2024_insert_data.sql b/src/sql/05_2024_insert_data.sql index 37b14a80..d04080c6 100644 --- a/src/sql/05_2024_insert_data.sql +++ b/src/sql/05_2024_insert_data.sql @@ -36,7 +36,9 @@ INSERT INTO mapped_events(tipo_evento,sotto_tipo_evento ,fk_event) values ('nodoChiediAvanzamentoPagamento' , 'REQ' , 35), ('nodoChiediAvanzamentoPagamento' , 'RESP', 36), ('cdInfoWisp' , 'REQ' , 37), - ('cdInfoWisp' , 'RESP', 38); + ('cdInfoWisp' , 'RESP', 38), + ('nodoInoltraEsitoPagamentoPayPal' , 'REQ' , 39), + ('nodoInoltraEsitoPagamentoPayPal' , 'RESP', 40); insert into mapped_payment_methods (tipoversamento, descrizione) values ('CC', 'Carta di Credito'), diff --git a/src/src/crawler/CacheObject.php b/src/src/crawler/CacheObject.php index c6713270..d26433c3 100644 --- a/src/src/crawler/CacheObject.php +++ b/src/src/crawler/CacheObject.php @@ -25,6 +25,7 @@ public static function createInstance() : self 'pa_emittente' => '', 'token_ccp' => '', 'touchpoint' => '', + 'payment_type' => '', 'transfer_added' => false, 'esito' => false, 'amount_update' => false, @@ -407,6 +408,25 @@ public function hasTouchPoint() : bool return !empty($touchpoint); } + /** + * Restituisce il payment type (CC, PPAL, etc.) + * @return string + */ + public function getPaymentType() : string + { + return $this->getKey('payment_type'); + } + + /** + * Restituisce true/false se il payment type è stato già inserito + * @return bool + */ + public function hasPaymentType() : bool + { + $payment_type = $this->getKey('payment_type'); + return !empty($payment_type); + } + public function getCacheData() : array { return $this->cache_data; diff --git a/src/src/crawler/events/req/nodoInoltraEsitoPagamentoPayPal.php b/src/src/crawler/events/req/nodoInoltraEsitoPagamentoPayPal.php new file mode 100644 index 00000000..44a2aa67 --- /dev/null +++ b/src/src/crawler/events/req/nodoInoltraEsitoPagamentoPayPal.php @@ -0,0 +1,171 @@ +method = new Payload($this->data['payload']); + } + + /** + * @inheritDoc + */ + public function getIuvs(): array|null + { + $value = $this->getIuv(); + return (is_null($value)) ? null : array($value); + } + + /** + * @inheritDoc + */ + public function getPaEmittenti(): array|null + { + $value = $this->getPaEmittente(); + return (is_null($value)) ? null : array($value); + } + + /** + * @inheritDoc + */ + public function getCcps(): array|null + { + $value = $this->getCcp(); + return (is_null($value)) ? null : array($value); + } + + /** + * @inheritDoc + */ + public function transaction(int $index = 0): Transaction|null + { + return null; + } + + public function transactionDetails(int $transfer, int $index = 0): TransactionDetails|null + { + return null; + } + + public function workflowEvent(int $index = 0): Workflow|null + { + $workflow = new Workflow($this->getInsertedTimestamp()); + $workflow->setNewColumnValue('date_event', $this->getInsertedTimestamp()->format('Y-m-d')); + $workflow->setEventTimestamp($this->getInsertedTimestamp()); + $workflow->setEventId($this->getUniqueId()); + $workflow->setFkTipoEvento(MapEvents::getMethodId($this->getTipoEvento(), $this->getSottoTipoEvento())); + + $id_psp = $this->getPsp(); + $stazione = $this->getStazione(); + $canale = $this->getCanale(); + + if (!is_null($id_psp)) + { + $workflow->setPsp($id_psp); + } + if (!is_null($stazione)) + { + $workflow->setStazione($stazione); + } + if (!is_null($canale)) + { + $workflow->setCanale($canale); + } + + return $workflow; + } + + /** + * @inheritDoc + */ + public function getMethodInterface(): Payload + { + return $this->method; + } + + /** + * @inheritDoc + */ + public function getPaymentsCount(): int|null + { + return 1; + } + + /** + * @inheritDoc + */ + public function getTransferCount(int $index = 0): int|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getCacheKeyPayment(int $index = 0): string|null + { + $iuv = $this->getColumn('iuv'); + $pa_emittente = $this->getColumn('iddominio'); + $token = $this->getColumn('ccp'); + $key = null; + if (($iuv) && ($pa_emittente) && ($token)) + { + $key = base64_encode(sprintf('attempt_%s_%s_%s', $iuv, $pa_emittente, $token)); + } + return $key; + } + + /** + * @inheritDoc + */ + public function getCacheKeyAttempt(int $index = 0): string|null + { + $iuv = $this->getColumn('iuv'); + $pa_emittente = $this->getColumn('iddominio'); + $token = $this->getColumn('ccp'); + $key = null; + if (($iuv) && ($pa_emittente) && ($token)) + { + $key = base64_encode(sprintf('attempt_%s_%s_%s', $iuv, $pa_emittente, $token)); + } + return $key; + } + + /** + * @inheritDoc + */ + public function getCacheKeyList(): array + { + $return = array(); + if (!is_null($this->getSessionIdOriginal())) + { + $key = sprintf('sessionOriginal_%s', $this->getSessionIdOriginal()); + $return[] = $key; + } + if (!is_null($this->getSessionId())) + { + $key = sprintf('session_id_%s_%s_%s', $this->getSessionId(), $this->getTipoEvento(), $this->getSottoTipoEvento()); + $return[] = $key; + } + if (!is_null($this->getPaymentToken())) + { + $key = sprintf('token_%s', $this->getPaymentToken()); + $return[] = $key; + } + return $return; + } +} \ No newline at end of file diff --git a/src/src/crawler/events/resp/nodoInoltraEsitoPagamentoPayPal.php b/src/src/crawler/events/resp/nodoInoltraEsitoPagamentoPayPal.php new file mode 100644 index 00000000..f1503971 --- /dev/null +++ b/src/src/crawler/events/resp/nodoInoltraEsitoPagamentoPayPal.php @@ -0,0 +1,180 @@ +method = new Payload($this->data['payload']); + } + /** + * @inheritDoc + */ + public function getIuvs(): array|null + { + $value = $this->getIuv(); + return (is_null($value)) ? null : array($value); + } + + /** + * @inheritDoc + */ + public function getPaEmittenti(): array|null + { + $value = $this->getPaEmittente(); + return (is_null($value)) ? null : array($value); + } + + /** + * @inheritDoc + */ + public function getCcps(): array|null + { + $value = $this->getCcp(); + return (is_null($value)) ? null : array($value); + } + + /** + * @inheritDoc + */ + public function transaction(int $index = 0): Transaction|null + { + return null; + } + + public function transactionDetails(int $transfer, int $index = 0): TransactionDetails|null + { + return null; + } + + public function workflowEvent(int $index = 0): Workflow|null + { + $workflow = new Workflow($this->getInsertedTimestamp()); + $workflow->setNewColumnValue('date_event', $this->getInsertedTimestamp()->format('Y-m-d')); + $workflow->setEventTimestamp($this->getInsertedTimestamp()); + $workflow->setEventId($this->getUniqueId()); + $workflow->setFkTipoEvento(MapEvents::getMethodId($this->getTipoEvento(), $this->getSottoTipoEvento())); + + $id_psp = $this->getPsp(); + $stazione = $this->getStazione(); + $canale = $this->getCanale(); + $outcome = $this->getMethodInterface()->outcome(); + $faultCode = $this->getMethodInterface()->getFaultCode(); + + if (!is_null($id_psp)) + { + $workflow->setPsp($id_psp); + } + if (!is_null($stazione)) + { + $workflow->setStazione($stazione); + } + if (!is_null($canale)) + { + $workflow->setCanale($canale); + } + if (!is_null($outcome)) + { + $workflow->setOutcomeEvent($outcome); + } + if (!is_null($faultCode)) + { + $workflow->setFaultCode($faultCode); + } + + return $workflow; + } + + /** + * @inheritDoc + */ + public function getMethodInterface(): Payload + { + return $this->method; + } + + /** + * @inheritDoc + */ + public function getPaymentsCount(): int|null + { + return 1; + } + + /** + * @inheritDoc + */ + public function getTransferCount(int $index = 0): int|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getCacheKeyPayment(int $index = 0): string|null + { + $iuv = $this->getColumn('iuv'); + $pa_emittente = $this->getColumn('iddominio'); + $token = $this->getColumn('ccp'); + $key = null; + if (($iuv) && ($pa_emittente) && ($token)) + { + $key = base64_encode(sprintf('attempt_%s_%s_%s', $iuv, $pa_emittente, $token)); + } + return $key; + } + + /** + * @inheritDoc + */ + public function getCacheKeyAttempt(int $index = 0): string|null + { + $iuv = $this->getColumn('iuv'); + $pa_emittente = $this->getColumn('iddominio'); + $token = $this->getColumn('ccp'); + $key = null; + if (($iuv) && ($pa_emittente) && ($token)) + { + $key = base64_encode(sprintf('attempt_%s_%s_%s', $iuv, $pa_emittente, $token)); + } + return $key; + } + + /** + * @inheritDoc + */ + public function getCacheKeyList(): array + { + $return = array(); + if (!is_null($this->getSessionIdOriginal())) + { + $key = sprintf('sessionOriginal_%s', $this->getSessionIdOriginal()); + $return[] = $key; + } + if (!is_null($this->getSessionId())) + { + $key = sprintf('session_id_%s_%s_%s', $this->getSessionId(), $this->getTipoEvento(), $this->getSottoTipoEvento()); + $return[] = $key; + } + if (!is_null($this->getPaymentToken())) + { + $key = sprintf('token_%s', $this->getPaymentToken()); + $return[] = $key; + } + return $return; + } +} \ No newline at end of file diff --git a/src/src/crawler/methods/req/nodoInoltraEsitoPagamentoPayPal.php b/src/src/crawler/methods/req/nodoInoltraEsitoPagamentoPayPal.php new file mode 100644 index 00000000..99374938 --- /dev/null +++ b/src/src/crawler/methods/req/nodoInoltraEsitoPagamentoPayPal.php @@ -0,0 +1,56 @@ +getImportoTotale(); + } + + + /** + * Restituisce il valore del campo id Transazione (generato dal PM)) + * @return string|null + * @throws \Exception + */ + public function getIdTransazione() : string|null + { + return $this->getElement('idTransazione'); + + } + + /** + * Restituisce il valore del campo idTransazione Psp (generato dal PSP)) + * @return string|null + * @throws \Exception + */ + public function getIdTransazionePsp() : string|null + { + return $this->getElement('idTransazionePsp'); + + } + +} \ No newline at end of file diff --git a/src/src/crawler/methods/resp/nodoInoltraEsitoPagamentoPayPal.php b/src/src/crawler/methods/resp/nodoInoltraEsitoPagamentoPayPal.php new file mode 100644 index 00000000..301e7457 --- /dev/null +++ b/src/src/crawler/methods/resp/nodoInoltraEsitoPagamentoPayPal.php @@ -0,0 +1,29 @@ +outcome() == 'OK'); + } + +} \ No newline at end of file diff --git a/src/src/crawler/paymentlist/req/nodoInoltraEsitoPagamentoPayPal.php b/src/src/crawler/paymentlist/req/nodoInoltraEsitoPagamentoPayPal.php new file mode 100644 index 00000000..c614425b --- /dev/null +++ b/src/src/crawler/paymentlist/req/nodoInoltraEsitoPagamentoPayPal.php @@ -0,0 +1,62 @@ +setEvent($event); + } + + /** + * @inheritDoc + */ + public function isValidPayment(int $index = 0): bool + { + if ((!is_null($this->getEvent()->getSessionIdOriginal())) || (!empty($this->getEvent()->getSessionIdOriginal()))) + { + return true; + } + return ($this->getEvent()->getIuv(0) && $this->getEvent()->getPaEmittente(0)); + } + + /** + * @inheritDoc + */ + public function isAttempt(int $index = 0): bool + { + if ((!is_null($this->getEvent()->getSessionIdOriginal())) || (!empty($this->getEvent()->getSessionIdOriginal()))) + { + return true; + } + return ($this->getEvent()->getIuv(0) && $this->getEvent()->getPaEmittente(0) && $this->getEvent()->getPaymentToken(0)); + } + + public function updateTransaction(CacheObject $cache, int $index = 0): array|null + { + if ($cache->getPaymentType()) + { + return $cache->getCacheData(); + } + $id = $cache->getId(); + $date_event = $cache->getDateEvent(); + $transaction = Transaction::getTransactionByIdAndDateEvent($id, $date_event); + $transaction->setPaymentType('PPAL'); + $transaction->update(); + DB::statement($transaction->getQuery(), $transaction->getBindParams()); + + return $cache->getCacheData(); + } +} \ No newline at end of file diff --git a/src/src/crawler/paymentlist/req/pspNotifyPaymentV2.php b/src/src/crawler/paymentlist/req/pspNotifyPaymentV2.php index e82d336b..497c331b 100644 --- a/src/src/crawler/paymentlist/req/pspNotifyPaymentV2.php +++ b/src/src/crawler/paymentlist/req/pspNotifyPaymentV2.php @@ -73,7 +73,8 @@ public function createExtraInfo(CacheObject $cache, int $index = 0): array|null } if (count($cache_data) > 0) { - $cache->setExtraInfo($cache_data); + $extra_info['typePaymentPspNotifyPaymentV2'] = $cache_data; + $cache->setExtraInfo($extra_info); } return $cache->getCacheData(); diff --git a/src/src/crawler/paymentlist/resp/nodoInoltraEsitoPagamentoPayPal.php b/src/src/crawler/paymentlist/resp/nodoInoltraEsitoPagamentoPayPal.php new file mode 100644 index 00000000..659a336f --- /dev/null +++ b/src/src/crawler/paymentlist/resp/nodoInoltraEsitoPagamentoPayPal.php @@ -0,0 +1,42 @@ +setEvent($event); + } + + /** + * @inheritDoc + */ + public function isValidPayment(int $index = 0): bool + { + if ((!is_null($this->getEvent()->getSessionIdOriginal())) || (!empty($this->getEvent()->getSessionIdOriginal()))) + { + return true; + } + return ($this->getEvent()->getIuv(0) && $this->getEvent()->getPaEmittente(0)); + } + + /** + * @inheritDoc + */ + public function isAttempt(int $index = 0): bool + { + if ((!is_null($this->getEvent()->getSessionIdOriginal())) || (!empty($this->getEvent()->getSessionIdOriginal()))) + { + return true; + } + return ($this->getEvent()->getIuv(0) && $this->getEvent()->getPaEmittente(0) && $this->getEvent()->getPaymentToken(0)); + } +} \ No newline at end of file diff --git a/src/tests/pagopa/events/req/nodoInoltraEsitoPagamentoPayPalTest.php b/src/tests/pagopa/events/req/nodoInoltraEsitoPagamentoPayPalTest.php new file mode 100644 index 00000000..291c7e72 --- /dev/null +++ b/src/tests/pagopa/events/req/nodoInoltraEsitoPagamentoPayPalTest.php @@ -0,0 +1,108 @@ +paypal = new nodoInoltraEsitoPagamentoPayPal( + [ + 'date_event' => '2023-09-01', + 'inserted_timestamp' => '2023-09-01 07:37:50', + 'tipoevento' => 'nodoInoltraEsitoPagamentoPayPal', + 'sottotipoevento' => 'REQ', + 'psp' => 'AGID_01', + 'stazione' => '77777777777_01', + 'canale' => '88888888888_01', + 'sessionid' => 'sessid_0010', + 'sessionidoriginal' => '', + 'uniqueid' => 'unique_id_PayPal', + 'state' => 'TO_LOAD', + 'iddominio' => '77777777777', + 'iuv' => '01000000000000010', + 'ccp' => 't0000000000000000000000000000010', + 'noticeNumber' => '301000000000000010', + 'creditorreferenceid' => '01000000000000010', + 'paymenttoken' => 't0000000000000000000000000000010', + 'payload' => 'ewogICAgImlkUGFnYW1lbnRvIjogIjEwMjkyMzAxMDIzOTIyMDM5MjAwMTI5MzkzMDIwMTIyIiwKICAgICJpZFRyYW5zYXppb25lIjogIjExMTExMTExMyIsCiAgICAiaWRUcmFuc2F6aW9uZVBzcCI6ICI5OTk5OTk5OTk5OTk5OSIsCiAgICAiaWRlbnRpZmljYXRpdm9DYW5hbGUiOiAiODg4ODg4ODg4ODhfMDEiLAogICAgImlkZW50aWZpY2F0aXZvSW50ZXJtZWRpYXJpbyI6ICI4ODg4ODg4ODg4OCIsCiAgICAiaWRlbnRpZmljYXRpdm9Qc3AiOiAiQUdJRF8wMSIsCiAgICAiaW1wb3J0b1RvdGFsZVBhZ2F0byI6IDcwLjAwLAogICAgInRpbWVzdGFtcE9wZXJhemlvbmUiOiAiMjAyNC0wNS0wMlQyMjoxMDoyMC45MjIrMDI6MDAiCn0=' + ] + ); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertEquals(1, $this->paypal->getPaymentsCount()); + } + + #[TestDox('getMethodInterface()')] + public function testGetMethodInterface() + { + $this->assertInstanceOf(\pagopa\crawler\methods\req\nodoInoltraEsitoPagamentoPayPal::class, $this->paypal->getMethodInterface()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $values = ['t0000000000000000000000000000010']; + $this->assertEquals($values, $this->paypal->getCcps()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->paypal->getTransferCount()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $values = ['77777777777']; + $this->assertEquals($values, $this->paypal->getPaEmittenti()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $values = ['01000000000000010']; + $this->assertEquals($values, $this->paypal->getIuvs()); + } + + #[TestDox('workflowEvent()')] + public function testWorkflowEvent() + { + $workflow = $this->paypal->workflowEvent(); + + $this->assertEquals(MapEvents::getMethodId('nodoInoltraEsitoPagamentoPayPal', 'REQ'), $workflow->getReadyColumnValue('fk_tipoevento')); + $this->assertEquals('2023-09-01 07:37:50.000', $workflow->getReadyColumnValue('event_timestamp')); + $this->assertEquals('unique_id_PayPal', $workflow->getReadyColumnValue('event_id')); + $this->assertEquals('AGID_01', $workflow->getReadyColumnValue('id_psp')); + $this->assertEquals('77777777777_01', $workflow->getReadyColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getReadyColumnValue('canale')); + $this->assertNull($workflow->getReadyColumnValue('faultcode')); + $this->assertNull($workflow->getReadyColumnValue('outcome')); + + } + + #[TestDox('transaction()')] + public function testTransaction() + { + $this->assertNull($this->paypal->transaction()); + } + + #[TestDox('transactionDetails()')] + public function testTransactionDetails() + { + $this->assertNull($this->paypal->transactionDetails(0)); + } +} diff --git a/src/tests/pagopa/events/resp/nodoInoltraEsitoPagamentoPayPalTest.php b/src/tests/pagopa/events/resp/nodoInoltraEsitoPagamentoPayPalTest.php new file mode 100644 index 00000000..65d3be70 --- /dev/null +++ b/src/tests/pagopa/events/resp/nodoInoltraEsitoPagamentoPayPalTest.php @@ -0,0 +1,107 @@ +event = new nodoInoltraEsitoPagamentoPayPal( + [ + 'date_event' => '2023-09-01', + 'inserted_timestamp' => '2023-09-01 07:37:50', + 'tipoevento' => 'nodoInoltraEsitoPagamentoPayPal', + 'sottotipoevento' => 'RESP', + 'psp' => 'AGID_01', + 'stazione' => '77777777777_01', + 'canale' => '88888888888_01', + 'sessionid' => 'sessid_0010', + 'sessionidoriginal' => '', + 'uniqueid' => 'unique_id_PayPal', + 'state' => 'TO_LOAD', + 'iddominio' => '77777777777', + 'iuv' => '01000000000000010', + 'ccp' => 't0000000000000000000000000000010', + 'noticeNumber' => '301000000000000010', + 'creditorreferenceid' => '01000000000000010', + 'paymenttoken' => 't0000000000000000000000000000010', + 'payload' => '' + ] + ); + } + + #[TestDox('getMethodInterface()')] + public function testGetMethodInterface() + { + $this->assertInstanceOf(\pagopa\crawler\methods\resp\nodoInoltraEsitoPagamentoPayPal::class, $this->event->getMethodInterface()); + } + + #[TestDox('transactionDetails()')] + public function testTransactionDetails() + { + $this->assertNull($this->event->transactionDetails(0)); + } + + #[TestDox('workflowEvent()')] + public function testWorkflowEvent() + { + $workflow = $this->event->workflowEvent(); + + $this->assertEquals(MapEvents::getMethodId('nodoInoltraEsitoPagamentoPayPal', 'RESP'), $workflow->getReadyColumnValue('fk_tipoevento')); + $this->assertEquals('2023-09-01 07:37:50.000', $workflow->getReadyColumnValue('event_timestamp')); + $this->assertEquals('unique_id_PayPal', $workflow->getReadyColumnValue('event_id')); + $this->assertEquals('AGID_01', $workflow->getReadyColumnValue('id_psp')); + $this->assertEquals('77777777777_01', $workflow->getReadyColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getReadyColumnValue('canale')); + $this->assertNull($workflow->getReadyColumnValue('faultcode')); + $this->assertNull($workflow->getReadyColumnValue('outcome')); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $values = ['77777777777']; + $this->assertEquals($values, $this->event->getPaEmittenti()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $values = ['01000000000000010']; + $this->assertEquals($values, $this->event->getIuvs()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertEquals(1, $this->event->getPaymentsCount()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->event->getTransferCount()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $values = ['t0000000000000000000000000000010']; + $this->assertEquals($values, $this->event->getCcps()); + } + + #[TestDox('transaction()')] + public function testTransaction() + { + $this->assertNull($this->event->transaction()); + } +} diff --git a/src/tests/pagopa/methods/req/nodoInoltraEsitoPagamentoPayPalTest.php b/src/tests/pagopa/methods/req/nodoInoltraEsitoPagamentoPayPalTest.php new file mode 100644 index 00000000..ccc2e431 --- /dev/null +++ b/src/tests/pagopa/methods/req/nodoInoltraEsitoPagamentoPayPalTest.php @@ -0,0 +1,216 @@ +paypal = new nodoInoltraEsitoPagamentoPayPal(base64_decode('ewogICAgImlkUGFnYW1lbnRvIjogIjEwMjkyMzAxMDIzOTIyMDM5MjAwMTI5MzkzMDIwMTIyIiwKICAgICJpZFRyYW5zYXppb25lIjogIjExMTExMTExMyIsCiAgICAiaWRUcmFuc2F6aW9uZVBzcCI6ICI5OTk5OTk5OTk5OTk5OSIsCiAgICAiaWRlbnRpZmljYXRpdm9DYW5hbGUiOiAiODg4ODg4ODg4ODhfMDEiLAogICAgImlkZW50aWZpY2F0aXZvSW50ZXJtZWRpYXJpbyI6ICI4ODg4ODg4ODg4OCIsCiAgICAiaWRlbnRpZmljYXRpdm9Qc3AiOiAiQUdJRF8wMSIsCiAgICAiaW1wb3J0b1RvdGFsZVBhZ2F0byI6IDcwLjAwLAogICAgInRpbWVzdGFtcE9wZXJhemlvbmUiOiAiMjAyNC0wNS0wMlQyMjoxMDoyMC45MjIrMDI6MDAiCn0=')); + $this->error_json = new nodoInoltraEsitoPagamentoPayPal('non_sono_un_json'); + } + + #[TestDox('getImporto()')] + public function testGetImporto() + { + $this->assertEquals('70.00', $this->paypal->getImporto()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $this->assertNull($this->paypal->getPaEmittenti()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->paypal->getTransferCount()); + } + + #[TestDox('getImportoTotale()')] + public function testGetImportoTotale() + { + $this->assertEquals('70.00', $this->paypal->getImportoTotale()); + } + + #[TestDox('getTransferPa()')] + public function testGetTransferPa() + { + $this->assertNull($this->paypal->getTransferPa()); + } + + #[TestDox('getAllNoticesNumbers()')] + public function testGetAllNoticesNumbers() + { + $this->assertNull($this->paypal->getAllNoticesNumbers()); + } + + #[TestDox('outcome()')] + public function testOutcome() + { + $this->assertNull($this->paypal->outcome()); + } + + #[TestDox('getTransferMetaDataKey()')] + public function testGetTransferMetaDataKey() + { + $this->assertNull($this->paypal->getTransferMetaDataKey()); + } + + #[TestDox('getPaEmittente()')] + public function testGetPaEmittente() + { + $this->assertNull($this->paypal->getPaEmittente()); + } + + #[TestDox('getCanale()')] + public function testGetCanale() + { + $this->assertEquals('88888888888_01', $this->paypal->getCanale()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertNull($this->paypal->getPaymentsCount()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $this->assertNull($this->paypal->getCcps()); + } + + #[TestDox('getNoticeNumber()')] + public function testGetNoticeNumber() + { + $this->assertNull($this->paypal->getNoticeNumber()); + } + + #[TestDox('getCcp()')] + public function testGetCcp() + { + $this->assertNull($this->paypal->getCcp()); + } + + #[TestDox('getToken()')] + public function testGetToken() + { + $this->assertNull($this->paypal->getToken()); + } + + #[TestDox('getBrokerPsp()')] + public function testGetBrokerPsp() + { + $this->assertEquals('88888888888', $this->paypal->getBrokerPsp()); + } + + #[TestDox('getTransferAmount()')] + public function testGetTransferAmount() + { + $this->assertNull($this->paypal->getTransferAmount()); + } + + #[TestDox('getTransferId()')] + public function testGetTransferId() + { + $this->assertNull($this->paypal->getTransferId()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $this->assertNull($this->paypal->getIuvs()); + } + + #[TestDox('isValidPayload()')] + public function testIsValidPayload() + { + $this->assertTrue($this->paypal->isValidPayload()); + $this->assertFalse($this->error_json->isValidPayload()); + } + + #[TestDox('getBrokerPa()')] + public function testGetBrokerPa() + { + $this->assertNull($this->paypal->getBrokerPa()); + } + + #[TestDox('getPaymentMetaDataCount()')] + public function testGetPaymentMetaDataCount() + { + $this->assertNull($this->paypal->getPaymentMetaDataCount()); + } + + #[TestDox('getIuv()')] + public function testGetIuv() + { + $this->assertNull($this->paypal->getIuv()); + } + + #[TestDox('isBollo()')] + public function testIsBollo() + { + $this->assertFalse($this->paypal->isBollo()); + } + + #[TestDox('getTransferMetaDataCount()')] + public function testGetTransferMetaDataCount() + { + $this->assertNull($this->paypal->getTransferMetaDataCount()); + } + + #[TestDox('getTransferIban()')] + public function testGetTransferIban() + { + $this->assertNull($this->paypal->getTransferIban()); + } + + #[TestDox('getAllTokens()')] + public function testGetAllTokens() + { + $this->assertNull($this->paypal->getAllTokens()); + } + + #[TestDox('getPaymentMetaDataKey()')] + public function testGetPaymentMetaDataKey() + { + $this->assertNull($this->paypal->getPaymentMetaDataKey()); + } + + #[TestDox('getTransferMetaDataValue()')] + public function testGetTransferMetaDataValue() + { + $this->assertNull($this->paypal->getTransferMetaDataValue()); + } + + #[TestDox('getStazione()')] + public function testGetStazione() + { + $this->assertNull($this->paypal->getStazione()); + } + + #[TestDox('getPsp()')] + public function testGetPsp() + { + $this->assertEquals('AGID_01', $this->paypal->getPsp()); + } + + #[TestDox('getPaymentMetaDataValue()')] + public function testGetPaymentMetaDataValue() + { + $this->assertNull($this->paypal->getPaymentMetaDataValue()); + } +} diff --git a/src/tests/pagopa/methods/resp/nodoInoltraEsitoPagamentoPayPalTest.php b/src/tests/pagopa/methods/resp/nodoInoltraEsitoPagamentoPayPalTest.php new file mode 100644 index 00000000..6b1f746e --- /dev/null +++ b/src/tests/pagopa/methods/resp/nodoInoltraEsitoPagamentoPayPalTest.php @@ -0,0 +1,275 @@ +ok_paypal = new nodoInoltraEsitoPagamentoPayPal(base64_decode('eyJlc2l0byI6Ik9LIn0=')); + $this->fail_paypal = new nodoInoltraEsitoPagamentoPayPal(base64_decode('ewogICAgImRlc2NyaXppb25lIjogIlJpc3Bvc3RhIG5lZ2F0aXZhIGRlbCBDYW5hbGUiLAogICAgImVycm9yQ29kZSI6ICJSSUZQU1AiLAogICAgImVzaXRvIjogIktPIgp9')); + } + + #[TestDox('getImporto()')] + public function testGetImporto() + { + $this->assertNull($this->ok_paypal->getImporto()); + $this->assertNull($this->fail_paypal->getImporto()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $this->assertNull($this->ok_paypal->getPaEmittenti()); + $this->assertNull($this->fail_paypal->getPaEmittenti()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->ok_paypal->getTransferCount()); + $this->assertNull($this->fail_paypal->getTransferCount()); + } + + #[TestDox('getImportoTotale()')] + public function testGetImportoTotale() + { + $this->assertNull($this->ok_paypal->getImportoTotale()); + $this->assertNull($this->fail_paypal->getImportoTotale()); + } + + #[TestDox('getTransferPa()')] + public function testGetTransferPa() + { + $this->assertNull($this->ok_paypal->getTransferPa()); + $this->assertNull($this->fail_paypal->getTransferPa()); + } + + #[TestDox('getAllNoticesNumbers()')] + public function testGetAllNoticesNumbers() + { + $this->assertNull($this->ok_paypal->getAllNoticesNumbers()); + $this->assertNull($this->fail_paypal->getAllNoticesNumbers()); + } + + #[TestDox('outcome()')] + public function testOutcome() + { + $this->assertEquals('OK', $this->ok_paypal->outcome()); + $this->assertEquals('KO', $this->fail_paypal->outcome()); + } + + #[TestDox('getTransferMetaDataKey()')] + public function testGetTransferMetaDataKey() + { + $this->assertNull($this->ok_paypal->getTransferMetaDataKey()); + $this->assertNull($this->fail_paypal->getTransferMetaDataKey()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertNull($this->ok_paypal->getPaymentsCount()); + $this->assertNull($this->fail_paypal->getPaymentsCount()); + } + + #[TestDox('getFaultCode()')] + public function testGetFaultCode() + { + $this->assertNull($this->ok_paypal->getFaultCode()); + $this->assertEquals('RIFPSP', $this->fail_paypal->getFaultCode()); + } + + #[TestDox('getPaEmittente()')] + public function testGetPaEmittente() + { + $this->assertNull($this->ok_paypal->getPaEmittente()); + $this->assertNull($this->fail_paypal->getPaEmittente()); + } + + #[TestDox('getCanale()')] + public function testGetCanale() + { + $this->assertNull($this->ok_paypal->getCanale()); + $this->assertNull($this->fail_paypal->getCanale()); + } + + #[TestDox('getFaultString()')] + public function testGetFaultString() + { + $this->assertNull($this->ok_paypal->getFaultString()); + $this->assertNull($this->fail_paypal->getFaultString()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $this->assertNull($this->ok_paypal->getCcps()); + $this->assertNull($this->fail_paypal->getCcps()); + } + + #[TestDox('getNoticeNumber()')] + public function testGetNoticeNumber() + { + $this->assertNull($this->ok_paypal->getNoticeNumber()); + $this->assertNull($this->fail_paypal->getNoticeNumber()); + } + + #[TestDox('getCcp()')] + public function testGetCcp() + { + $this->assertNull($this->ok_paypal->getCcp()); + $this->assertNull($this->fail_paypal->getCcp()); + } + + #[TestDox('getToken()')] + public function testGetToken() + { + $this->assertNull($this->ok_paypal->getToken()); + $this->assertNull($this->fail_paypal->getToken()); + } + + #[TestDox('isFaultEvent()')] + public function testIsFaultEvent() + { + $this->assertFalse($this->ok_paypal->isFaultEvent()); + $this->assertTrue($this->fail_paypal->isFaultEvent()); + } + + #[TestDox('getBrokerPsp()')] + public function testGetBrokerPsp() + { + $this->assertNull($this->ok_paypal->getBrokerPsp()); + $this->assertNull($this->fail_paypal->getBrokerPsp()); + } + + #[TestDox('getTransferAmount()')] + public function testGetTransferAmount() + { + $this->assertNull($this->ok_paypal->getTransferAmount()); + $this->assertNull($this->fail_paypal->getTransferAmount()); + } + + #[TestDox('getTransferId()')] + public function testGetTransferId() + { + $this->assertNull($this->ok_paypal->getTransferId()); + $this->assertNull($this->fail_paypal->getTransferId()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $this->assertNull($this->ok_paypal->getIuvs()); + $this->assertNull($this->fail_paypal->getIuvs()); + } + + #[TestDox('isValidPayload()')] + public function testIsValidPayload() + { + $this->assertTrue($this->ok_paypal->isValidPayload()); + $this->assertTrue($this->fail_paypal->isValidPayload()); + } + + #[TestDox('getBrokerPa()')] + public function testGetBrokerPa() + { + $this->assertNull($this->ok_paypal->getBrokerPa()); + $this->assertNull($this->fail_paypal->getBrokerPa()); + } + + #[TestDox('getPaymentMetaDataCount()')] + public function testGetPaymentMetaDataCount() + { + $this->assertNull($this->ok_paypal->getPaymentMetaDataCount()); + $this->assertNull($this->fail_paypal->getPaymentMetaDataCount()); + } + + #[TestDox('getIuv()')] + public function testGetIuv() + { + $this->assertNull($this->ok_paypal->getIuv()); + $this->assertNull($this->fail_paypal->getIuv()); + } + + #[TestDox('isBollo()')] + public function testIsBollo() + { + $this->assertFalse($this->ok_paypal->isBollo()); + $this->assertFalse($this->fail_paypal->isBollo()); + } + + #[TestDox('getFaultDescription()')] + public function testGetFaultDescription() + { + $this->assertNull($this->ok_paypal->getFaultDescription()); + $this->assertNull($this->fail_paypal->getFaultDescription()); + } + + #[TestDox('getTransferMetaDataCount()')] + public function testGetTransferMetaDataCount() + { + $this->assertNull($this->ok_paypal->getTransferMetaDataCount()); + $this->assertNull($this->fail_paypal->getTransferMetaDataCount()); + } + + #[TestDox('getTransferIban()')] + public function testGetTransferIban() + { + $this->assertNull($this->ok_paypal->getTransferIban()); + $this->assertNull($this->fail_paypal->getTransferIban()); + } + + #[TestDox('getAllTokens()')] + public function testGetAllTokens() + { + $this->assertNull($this->ok_paypal->getAllTokens()); + $this->assertNull($this->fail_paypal->getAllTokens()); + } + + #[TestDox('getPaymentMetaDataKey()')] + public function testGetPaymentMetaDataKey() + { + $this->assertNull($this->ok_paypal->getPaymentMetaDataKey()); + $this->assertNull($this->fail_paypal->getPaymentMetaDataKey()); + } + + #[TestDox('getTransferMetaDataValue()')] + public function testGetTransferMetaDataValue() + { + $this->assertNull($this->ok_paypal->getTransferMetaDataValue()); + $this->assertNull($this->fail_paypal->getTransferMetaDataValue()); + } + + #[TestDox('getStazione()')] + public function testGetStazione() + { + $this->assertNull($this->ok_paypal->getStazione()); + $this->assertNull($this->fail_paypal->getStazione()); + } + + #[TestDox('getPsp()')] + public function testGetPsp() + { + $this->assertNull($this->ok_paypal->getPsp()); + $this->assertNull($this->fail_paypal->getPsp()); + } + + #[TestDox('getPaymentMetaDataValue()')] + public function testGetPaymentMetaDataValue() + { + $this->assertNull($this->ok_paypal->getPaymentMetaDataValue()); + $this->assertNull($this->fail_paypal->getPaymentMetaDataValue()); + } +} diff --git a/src/tests/phpunit.xml b/src/tests/phpunit.xml index 7cdc8431..aebd0f39 100644 --- a/src/tests/phpunit.xml +++ b/src/tests/phpunit.xml @@ -26,7 +26,7 @@ - process/crawler/cdInfoWisp/T00063_WorkFlowWithcdInfoWisp.php + process/crawler/nodoInoltraEsitoPagamentoPayPal/T00062_WorkFlowWithNodoInoltraEsitoPagamentoPayPal.php process/crawler/activatePaymentNotice/SingleEvent/T00001_CreateAttemptAllInfoInEvent.php @@ -82,7 +82,8 @@ process/crawler/nodoInoltraEsitoPagamentoCarta/T00060_WorkFlowWithNodoInoltraEsitoPagamento.php process/crawler/nodoChiediAvanzamentoPagamento/T00061_WorkFlowWithNodoChiediAvanzamentoPagamento.php process/crawler/closePaymentV1/T00062_WorkFlowWithClosePaymentV1.php - process/crawler/cdInfoWisp/T00063_WorkFlowWithcdInfoWisp.php + process/crawler/cdInfoWisp/T00063_WorkFlowWithCdInfoWisp.php + process/crawler/nodoInoltraEsitoPagamentoPayPal/T00064_WorkFlowWithNodoInoltraEsitoPagamentoPayPal.php @@ -109,6 +110,7 @@ pagopa/methods/req/nodoInoltraEsitoPagamentoCartaTest.php pagopa/methods/req/nodoChiediAvanzamentoPagamentoTest.php pagopa/methods/req/cdInfoWispTest.php + pagopa/methods/req/nodoInoltraEsitoPagamentoPayPalTest.php pagopa/methods/resp/activatePaymentNoticeTest.php @@ -130,6 +132,7 @@ pagopa/methods/resp/nodoInoltraEsitoPagamentoCartaTest.php pagopa/methods/resp/nodoChiediAvanzamentoPagamentoTest.php pagopa/methods/resp/cdInfoWispTest.php + pagopa/methods/resp/nodoInoltraEsitoPagamentoPayPalTest.php @@ -152,6 +155,7 @@ pagopa/events/req/nodoInoltraEsitoPagamentoCartaTest.php pagopa/events/req/nodoChiediAvanzamentoPagamentoTest.php pagopa/events/req/cdInfoWispTest.php + pagopa/events/req/nodoInoltraEsitoPagamentoPayPalTest.php pagopa/events/resp/activatePaymentNoticeTest.php @@ -172,6 +176,7 @@ pagopa/events/resp/nodoInoltraEsitoPagamentoCartaTest.php pagopa/events/resp/nodoChiediAvanzamentoPagamentoTest.php pagopa/events/resp/cdInfoWispTest.php + pagopa/events/resp/nodoInoltraEsitoPagamentoPayPalTest.php process/normal/T0001.php diff --git a/src/tests/process/crawler/cdInfoWisp/T00063_WorkFlowWithcdInfoWisp.php b/src/tests/process/crawler/cdInfoWisp/T00063_WorkFlowWithCdInfoWisp.php similarity index 99% rename from src/tests/process/crawler/cdInfoWisp/T00063_WorkFlowWithcdInfoWisp.php rename to src/tests/process/crawler/cdInfoWisp/T00063_WorkFlowWithCdInfoWisp.php index 440e7d38..cf1a1740 100644 --- a/src/tests/process/crawler/cdInfoWisp/T00063_WorkFlowWithcdInfoWisp.php +++ b/src/tests/process/crawler/cdInfoWisp/T00063_WorkFlowWithCdInfoWisp.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; #[TestDox('[T00063] Valuta un workflow con la cdInfoWisp')] -class T00063_WorkFlowWithcdInfoWisp extends TestCase +class T00063_WorkFlowWithCdInfoWisp extends TestCase { protected static \GetInfoFromDb $db; diff --git a/src/tests/process/crawler/nodoInoltraEsitoPagamentoPayPal/T00064_WorkFlowWithNodoInoltraEsitoPagamentoPayPal.php b/src/tests/process/crawler/nodoInoltraEsitoPagamentoPayPal/T00064_WorkFlowWithNodoInoltraEsitoPagamentoPayPal.php new file mode 100644 index 00000000..63580315 --- /dev/null +++ b/src/tests/process/crawler/nodoInoltraEsitoPagamentoPayPal/T00064_WorkFlowWithNodoInoltraEsitoPagamentoPayPal.php @@ -0,0 +1,197 @@ +getTransaction(new \DateTime('2024-03-10'), '01000000000000185'); + $this->assertEquals('2024-03-10 15:42:00.197', $transaction->getColumnValue('inserted_timestamp')); + $this->assertEquals('01000000000000185', $transaction->getColumnValue('iuv')); + $this->assertEquals('77777777777', $transaction->getColumnValue('pa_emittente')); + $this->assertEquals('t0000000000000000000000000000185', $transaction->getColumnValue('token_ccp')); + $this->assertEquals('50.00', $transaction->getColumnValue('importo')); + $this->assertEquals('77777777777_01', $transaction->getColumnValue('stazione')); + $this->assertEquals('AGID_01', $transaction->getColumnValue('id_psp')); + $this->assertEquals('88888888888_01', $transaction->getColumnValue('canale')); + $this->assertEquals('APP_IO', $transaction->getColumnValue('touchpoint')); + $this->assertEquals('OK', $transaction->getColumnValue('esito')); + $this->assertEquals('PPAL', $transaction->getColumnValue('payment_type')); + $this->assertNull($transaction->getReadyColumnValue('id_carrello')); + + } + + + #[TestDox('[DETAILS] Verifica assenza dettagli')] + public function testTransactionDetails() + { + $transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000185' ); + + $details = self::$db->getTransactionDetails($transaction, 0); + $this->assertEquals(1, $details->getColumnValue('id_transfer')); + $this->assertEquals('77777777777', $details->getColumnValue('pa_transfer')); + $this->assertEquals('IT18U0000000000000000000001', $details->getColumnValue('iban_transfer')); + $this->assertEquals('50.00', $details->getColumnValue('amount_transfer')); + $this->assertNull($details->getColumnValue('iur')); + $this->assertFalse($details->getColumnValue('is_bollo')); + + } + + #[TestDox('[WORKFLOW] Verifica presenza eventi Workflow')] + public function testWorkFlow() + { + $transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000185'); + + $workflow = self::$db->getWorkFlow($transaction, 0); + $this->assertEquals(MapEvents::getMethodId('activateIOPayment', 'REQ'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 15:42:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000230', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertNull($workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 1); + $this->assertEquals(MapEvents::getMethodId('activateIOPayment', 'RESP'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 15:42:01.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000231', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertEquals('OK', $workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 2); + $this->assertEquals(MapEvents::getMethodId('nodoChiediInformazioniPagamento', 'REQ'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 15:43:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000232', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertNull($workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 3); + $this->assertEquals(MapEvents::getMethodId('nodoChiediInformazioniPagamento', 'RESP'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 15:43:01.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000233', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertNull($workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 4); + $this->assertEquals(MapEvents::getMethodId('nodoInoltraEsitoPagamentoPayPal', 'REQ'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 15:44:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000234', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertNull($workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 5); + $this->assertEquals(MapEvents::getMethodId('pspNotifyPayment', 'REQ'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 15:44:10.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000236', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertNull($workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 6); + $this->assertEquals(MapEvents::getMethodId('pspNotifyPayment', 'RESP'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 15:44:30.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000237', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertEquals('OK', $workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 7); + $this->assertEquals(MapEvents::getMethodId('nodoInoltraEsitoPagamentoPayPal', 'RESP'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 15:44:50.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000235', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertEquals('OK', $workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 8); + $this->assertEquals(MapEvents::getMethodId('sendPaymentOutcome', 'REQ'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 15:46:10.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000238', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertEquals('OK', $workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 9); + $this->assertEquals(MapEvents::getMethodId('sendPaymentOutcome', 'RESP'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 15:46:30.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000239', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertEquals('OK', $workflow->getColumnValue('outcome')); + + } + + #[TestDox('[EXTRA INFO] Verifica delle informazioni extra')] + public function testExtraInfo() + { + $transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000185'); + $extra_info_rrn = self::$db->getExtraInfo($transaction, 'transactionId'); + $this->assertEquals('222222222', $extra_info_rrn->getColumnValue('info_value')); + $extra_info_rrn = self::$db->getExtraInfo($transaction, 'pspTransactionId'); + $this->assertEquals('99999999999999', $extra_info_rrn->getColumnValue('info_value')); + } + #[TestDox('[ReEvent] Verifica stato evento')] + public function testEvent() + { + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 230); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 231); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 232); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 233); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 234); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 235); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 236); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 237); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 238); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 239); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + } + +}