From 35be95fedbf913e69814cf94aaa4f4b595db6756 Mon Sep 17 00:00:00 2001 From: esposimo Date: Thu, 2 May 2024 00:38:45 +0200 Subject: [PATCH] add nodoChiediInformazioniPagamento --- src/mock_crawler.php | 20 +- src/mock_insert.php | 205 +++++++++++++++ src/sql/02_2024_create_table.sql | 2 +- src/src/crawler/events/req/closePaymentV1.php | 135 ++++++++++ .../req/nodoChiediInformazioniPagamento.php | 203 +++++++++++++++ .../resp/nodoChiediInformazioniPagamento.php | 202 +++++++++++++++ .../crawler/methods/AbstractJsonPayload.php | 9 +- .../crawler/methods/req/closePaymentV1.php | 61 +++++ .../crawler/methods/req/closePaymentV2.php | 3 +- .../req/nodoChiediInformazioniPagamento.php | 20 ++ .../crawler/methods/resp/closePaymentV1.php | 20 ++ .../resp/nodoChiediInformazioniPagamento.php | 27 ++ .../req/nodoChiediInformazioniPagamento.php | 34 +++ .../resp/nodoChiediInformazioniPagamento.php | 34 +++ .../nodoChiediInformazioniPagamentoTest.php | 129 ++++++++++ .../nodoChiediInformazioniPagamentoTest.php | 119 +++++++++ .../pagopa/methods/req/closePaymentV1Test.php | 212 ++++++++++++++++ .../nodoChiediInformazioniPagamentoTest.php | 218 ++++++++++++++++ .../methods/resp/closePaymentV1Test.php | 230 +++++++++++++++++ .../nodoChiediInformazioniPagamentoTest.php | 235 ++++++++++++++++++ src/tests/phpunit.xml | 8 + ...lowWithNodoChiediInformazioniPagamento.php | 172 +++++++++++++ 22 files changed, 2288 insertions(+), 10 deletions(-) create mode 100644 src/src/crawler/events/req/closePaymentV1.php create mode 100644 src/src/crawler/events/req/nodoChiediInformazioniPagamento.php create mode 100644 src/src/crawler/events/resp/nodoChiediInformazioniPagamento.php create mode 100644 src/src/crawler/methods/req/closePaymentV1.php create mode 100644 src/src/crawler/methods/req/nodoChiediInformazioniPagamento.php create mode 100644 src/src/crawler/methods/resp/closePaymentV1.php create mode 100644 src/src/crawler/methods/resp/nodoChiediInformazioniPagamento.php create mode 100644 src/src/crawler/paymentlist/req/nodoChiediInformazioniPagamento.php create mode 100644 src/src/crawler/paymentlist/resp/nodoChiediInformazioniPagamento.php create mode 100644 src/tests/pagopa/events/req/nodoChiediInformazioniPagamentoTest.php create mode 100644 src/tests/pagopa/events/resp/nodoChiediInformazioniPagamentoTest.php create mode 100644 src/tests/pagopa/methods/req/closePaymentV1Test.php create mode 100644 src/tests/pagopa/methods/req/nodoChiediInformazioniPagamentoTest.php create mode 100644 src/tests/pagopa/methods/resp/closePaymentV1Test.php create mode 100644 src/tests/pagopa/methods/resp/nodoChiediInformazioniPagamentoTest.php create mode 100644 src/tests/process/crawler/nodoChiediInformazioniPagamento/T00059_WorkFlowWithNodoChiediInformazioniPagamento.php diff --git a/src/mock_crawler.php b/src/mock_crawler.php index 410a52d0..871c49b4 100644 --- a/src/mock_crawler.php +++ b/src/mock_crawler.php @@ -99,6 +99,17 @@ $a = new \pagopa\crawler\paymentlist\resp\nodoInviaCarrelloRPT(new \DateTime('2024-03-11'),'nodoInviaCarrelloRPT', 'RESP', $redis_cache); $a->run(); +$a = new \pagopa\crawler\paymentlist\req\nodoAttivaRPT(new \DateTime('2024-03-10'), 'nodoAttivaRPT', 'REQ', $redis_cache); +$a->run(); + +$a = new \pagopa\crawler\paymentlist\resp\nodoAttivaRPT(new \DateTime('2024-03-10'), 'nodoAttivaRPT', 'RESP', $redis_cache); +$a->run(); + +$a = new \pagopa\crawler\paymentlist\req\nodoInviaRPT(new \DateTime('2024-03-10'), 'nodoInviaRPT', 'REQ', $redis_cache); +$a->run(); + +$a = new \pagopa\crawler\paymentlist\resp\nodoInviaRPT(new \DateTime('2024-03-10'), 'nodoInviaRPT', 'RESP', $redis_cache); +$a->run(); @@ -114,18 +125,15 @@ $a = new \pagopa\crawler\paymentlist\resp\pspInviaCarrelloRPTCarte(new DateTime('2024-03-10'), 'pspInviaCarrelloRPTCarte', 'RESP', $redis_cache); $a->run(); -$a = new \pagopa\crawler\paymentlist\req\nodoAttivaRPT(new \DateTime('2024-03-10'), 'nodoAttivaRPT', 'REQ', $redis_cache); -$a->run(); -$a = new \pagopa\crawler\paymentlist\resp\nodoAttivaRPT(new \DateTime('2024-03-10'), 'nodoAttivaRPT', 'RESP', $redis_cache); -$a->run(); -$a = new \pagopa\crawler\paymentlist\req\nodoInviaRPT(new \DateTime('2024-03-10'), 'nodoInviaRPT', 'REQ', $redis_cache); +$a = new \pagopa\crawler\paymentlist\req\nodoChiediInformazioniPagamento(new DateTime('2024-03-10'), 'nodoChiediInformazioniPagamento', 'REQ', $redis_cache); $a->run(); -$a = new \pagopa\crawler\paymentlist\resp\nodoInviaRPT(new \DateTime('2024-03-10'), 'nodoInviaRPT', 'RESP', $redis_cache); +$a = new \pagopa\crawler\paymentlist\resp\nodoChiediInformazioniPagamento(new DateTime('2024-03-10'), 'nodoChiediInformazioniPagamento', 'RESP', $redis_cache); $a->run(); + $a = new \pagopa\crawler\paymentlist\req\pspNotifyPayment(new \DateTime('2024-03-10'), 'pspNotifyPayment', 'REQ', $redis_cache); $a->run(); diff --git a/src/mock_insert.php b/src/mock_insert.php index f50a02ce..2b4dd3fd 100644 --- a/src/mock_insert.php +++ b/src/mock_insert.php @@ -4225,5 +4225,210 @@ ]; +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + +$data_req = [ + ':id' => 182, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 11:28:00.197', + ':tipoevento' => 'activatePaymentNotice', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000180', + ':ccp' => 't0000000000000000000000000000180', + ':noticenumber' => '301000000000000180', + ':creditorreferenceid' => '01000000000000180', + ':paymenttoken' => 't0000000000000000000000000000180', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100180', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000182', + ':payload' => 'PHNvYXBlbnY6RW52ZWxvcGUgeG1sbnM6bm9kPSJodHRwOi8vcGFnb3BhLWFwaS5wYWdvcGEuZ292Lml0L25vZGUvbm9kZUZvclBzcC54c2QiIHhtbG5zOnNvYXBlbnY9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIj4KICA8c29hcGVudjpIZWFkZXIvPgogIDxzb2FwZW52OkJvZHk+CiAgICA8bm9kOmFjdGl2YXRlUGF5bWVudE5vdGljZVJlcT4KICAgICAgPGlkUFNQPkFHSURfMDE8L2lkUFNQPgogICAgICA8aWRCcm9rZXJQU1A+ODg4ODg4ODg4ODg8L2lkQnJva2VyUFNQPgogICAgICA8aWRDaGFubmVsPjg4ODg4ODg4ODg4XzAxPC9pZENoYW5uZWw+CiAgICAgIDxwYXNzd29yZD4qKioqKjwvcGFzc3dvcmQ+CiAgICAgIDxxckNvZGU+CiAgICAgICAgPGZpc2NhbENvZGU+Nzc3Nzc3Nzc3Nzc8L2Zpc2NhbENvZGU+CiAgICAgICAgPG5vdGljZU51bWJlcj4zMDEwMDAwMDAwMDAwMDAxODA8L25vdGljZU51bWJlcj4KICAgICAgPC9xckNvZGU+CiAgICAgIDxhbW91bnQ+MC4wMDwvYW1vdW50PgogICAgPC9ub2Q6YWN0aXZhdGVQYXltZW50Tm90aWNlUmVxPgogIDwvc29hcGVudjpCb2R5Pgo8L3NvYXBlbnY6RW52ZWxvcGU+', +]; + +$data_resp = [ + ':id' => 183, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 11:28:01.197', + ':tipoevento' => 'activatePaymentNotice', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000180', + ':ccp' => 't0000000000000000000000000000180', + ':noticenumber' => '301000000000000180', + ':creditorreferenceid' => '01000000000000180', + ':paymenttoken' => 't0000000000000000000000000000180', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100180', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000183', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpjb21tb249Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQveHNkL2NvbW1vbi10eXBlcy92MS4wLjAvIiB4bWxuczpuZnA9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvbm9kZS9ub2RlRm9yUHNwLnhzZCIgeG1sbnM6c29hcGVudj0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSI+Cgk8c29hcGVudjpCb2R5PgoJCTxuZnA6YWN0aXZhdGVQYXltZW50Tm90aWNlUmVzPgoJCQk8b3V0Y29tZT5PSzwvb3V0Y29tZT4KCQkJPHRvdGFsQW1vdW50PjgwLjAwPC90b3RhbEFtb3VudD4KCQkJPHBheW1lbnREZXNjcmlwdGlvbj54eHh4eHh4PC9wYXltZW50RGVzY3JpcHRpb24+CgkJCTxmaXNjYWxDb2RlUEE+Nzc3Nzc3Nzc3Nzc8L2Zpc2NhbENvZGVQQT4KCQkJPGNvbXBhbnlOYW1lPnh4eHh4eHg8L2NvbXBhbnlOYW1lPgoJCQk8cGF5bWVudFRva2VuPnQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMTgwPC9wYXltZW50VG9rZW4+CgkJCTx0cmFuc2Zlckxpc3Q+CgkJCQk8dHJhbnNmZXI+CgkJCQkJPGlkVHJhbnNmZXI+MTwvaWRUcmFuc2Zlcj4KCQkJCQk8dHJhbnNmZXJBbW91bnQ+ODAuMDA8L3RyYW5zZmVyQW1vdW50PgoJCQkJCTxmaXNjYWxDb2RlUEE+Nzc3Nzc3Nzc3Nzc8L2Zpc2NhbENvZGVQQT4KCQkJCQk8SUJBTj5JVDE4VTAwMDAwMDAwMDAwMDAwMDAwMDAwMDE8L0lCQU4+CgkJCQkJPHJlbWl0dGFuY2VJbmZvcm1hdGlvbj54eHh4PC9yZW1pdHRhbmNlSW5mb3JtYXRpb24+CgkJCQk8L3RyYW5zZmVyPgoJCQk8L3RyYW5zZmVyTGlzdD4KCQkJPGNyZWRpdG9yUmVmZXJlbmNlSWQ+MDEwMDAwMDAwMDAwMDAxODA8L2NyZWRpdG9yUmVmZXJlbmNlSWQ+CgkJPC9uZnA6YWN0aXZhdGVQYXltZW50Tm90aWNlUmVzPgoJPC9zb2FwZW52OkJvZHk+Cjwvc29hcGVudjpFbnZlbG9wZT4=', +]; + + +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + + + + + + + + +$data_req = [ + ':id' => 184, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 11:29:00.197', + ':tipoevento' => 'nodoChiediInformazioniPagamento', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000180', + ':ccp' => 't0000000000000000000000000000180', + ':noticenumber' => '301000000000000180', + ':creditorreferenceid' => '01000000000000180', + ':paymenttoken' => 't0000000000000000000000000000180', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100181', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000184', + ':payload' => '', +]; + +$data_resp = [ + ':id' => 185, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 11:29:01.197', + ':tipoevento' => 'nodoChiediInformazioniPagamento', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000180', + ':ccp' => 't0000000000000000000000000000180', + ':noticenumber' => '301000000000000180', + ':creditorreferenceid' => '01000000000000180', + ':paymenttoken' => 't0000000000000000000000000000180', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100181', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000185', + ':payload' => 'ewogICAgIklCQU4iOiAiSVQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDEwIiwKICAgICJib2xsb0RpZ2l0YWxlIjogZmFsc2UsCiAgICAiY29kaWNlRmlzY2FsZSI6ICJYWFhYWFhYWFhYWFhYWFhYIiwKICAgICJkZXR0YWdsaSI6IFsKICAgICAgICB7CiAgICAgICAgICAgICJDQ1AiOiAidDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxODAiLAogICAgICAgICAgICAiSVVWIjogIjAxMDAwMDAwMDAwMDAwMTgwIiwKICAgICAgICAgICAgImNvZGljZVBhZ2F0b3JlIjogIlhYWFhYWFhYWFhYWFhYWFgiLAogICAgICAgICAgICAiZW50ZUJlbmVmaWNpYXJpbyI6ICJ4eHh4eHgiLAogICAgICAgICAgICAiaWREb21pbmlvIjogIjc3Nzc3Nzc3Nzc3IiwKICAgICAgICAgICAgImltcG9ydG8iOiA4MC4wLAogICAgICAgICAgICAibm9tZVBhZ2F0b3JlIjogInh4eHgiLAogICAgICAgICAgICAidGlwb1BhZ2F0b3JlIjogIkYiCiAgICAgICAgfQogICAgXSwKICAgICJpbXBvcnRvVG90YWxlIjogODAuMCwKICAgICJvZ2dldHRvUGFnYW1lbnRvIjogInh4eCIsCiAgICAicmFnaW9uZVNvY2lhbGUiOiAieHh4IiwKICAgICJ1cmxSZWRpcmVjdEVDIjogImh0dHBzOi8vZXhhbXBsZS5jb20iCn0=', +]; + + +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + + + + + + + +$data_req = [ + ':id' => 186, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 11:30:00.197', + ':tipoevento' => 'pspNotifyPayment', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000180', + ':ccp' => 't0000000000000000000000000000180', + ':noticenumber' => '301000000000000180', + ':creditorreferenceid' => '01000000000000180', + ':paymenttoken' => 't0000000000000000000000000000180', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100182', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000186', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpjb21tb249Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQveHNkL2NvbW1vbi10eXBlcy92MS4wLjAvIiB4bWxuczpwZm49Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvcHNwL3BzcEZvck5vZGUueHNkIiB4bWxuczpzb2FwZW52PSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VudmVsb3BlLyIgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIj4KCTxzb2FwZW52OkJvZHk+CgkJPHBmbjpwc3BOb3RpZnlQYXltZW50UmVxPgoJCQk8aWRQU1A+QUdJRF8wMTwvaWRQU1A+CgkJCTxpZEJyb2tlclBTUD44ODg4ODg4ODg4ODwvaWRCcm9rZXJQU1A+CgkJCTxpZENoYW5uZWw+ODg4ODg4ODg4ODhfMDE8L2lkQ2hhbm5lbD4KCQkJPHBheW1lbnRUb2tlbj50MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDE4MDwvcGF5bWVudFRva2VuPgoJCQk8cGF5bWVudERlc2NyaXB0aW9uPnBhZ2FtZW50byBtdWx0aWJlbmVmaWNpYXJpbzwvcGF5bWVudERlc2NyaXB0aW9uPgoJCQk8ZmlzY2FsQ29kZVBBPjc3Nzc3Nzc3Nzc3PC9maXNjYWxDb2RlUEE+CgkJCTxjb21wYW55TmFtZT54eHh4eHh4PC9jb21wYW55TmFtZT4KCQkJPGNyZWRpdG9yUmVmZXJlbmNlSWQ+MDEwMDAwMDAwMDAwMDAxODA8L2NyZWRpdG9yUmVmZXJlbmNlSWQ+CgkJCTxkZWJ0QW1vdW50PjE1MC4wMDwvZGVidEFtb3VudD4KCQkJPHRyYW5zZmVyTGlzdD4KCQkJCTx0cmFuc2Zlcj4KCQkJCQk8aWRUcmFuc2Zlcj4xPC9pZFRyYW5zZmVyPgoJCQkJCTx0cmFuc2ZlckFtb3VudD44MC4wMDwvdHJhbnNmZXJBbW91bnQ+CgkJCQkJPGZpc2NhbENvZGVQQT43Nzc3Nzc3Nzc3NzwvZmlzY2FsQ29kZVBBPgoJCQkJCTxJQkFOPklUMThVMDAwMDAwMDAwMDAwMDAwMDAwMDAwMTwvSUJBTj4KCQkJCQk8cmVtaXR0YW5jZUluZm9ybWF0aW9uPnh4eHg8L3JlbWl0dGFuY2VJbmZvcm1hdGlvbj4KCQkJCTwvdHJhbnNmZXI+CgkJCTwvdHJhbnNmZXJMaXN0PgoJCQk8Y3JlZGl0Q2FyZFBheW1lbnQ+CgkJCQk8cnJuPjExMTExMTExMTExMTwvcnJuPgoJCQkJPG91dGNvbWVQYXltZW50R2F0ZXdheT5PSzwvb3V0Y29tZVBheW1lbnRHYXRld2F5PgoJCQkJPHRvdGFsQW1vdW50PjgxLjMwPC90b3RhbEFtb3VudD4KCQkJCTxmZWU+MS4zMDwvZmVlPgoJCQkJPHRpbWVzdGFtcE9wZXJhdGlvbj4yMDI0LTA0LTEwVDIxOjE0OjQ3PC90aW1lc3RhbXBPcGVyYXRpb24+CgkJCQk8YXV0aG9yaXphdGlvbkNvZGU+MTExMTE1PC9hdXRob3JpemF0aW9uQ29kZT4KCQkJPC9jcmVkaXRDYXJkUGF5bWVudD4KCQk8L3Bmbjpwc3BOb3RpZnlQYXltZW50UmVxPgoJPC9zb2FwZW52OkJvZHk+Cjwvc29hcGVudjpFbnZlbG9wZT4=', +]; + +$data_resp = [ + ':id' => 187, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 11:30:01.197', + ':tipoevento' => 'pspNotifyPayment', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000180', + ':ccp' => 't0000000000000000000000000000180', + ':noticenumber' => '301000000000000180', + ':creditorreferenceid' => '01000000000000180', + ':paymenttoken' => 't0000000000000000000000000000180', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100182', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000187', + ':payload' => 'PFNPQVAtRU5WOkVudmVsb3BlIHhtbG5zOlNPQVAtRU5WPSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VudmVsb3BlLyI+PFNPQVAtRU5WOkhlYWRlci8+PFNPQVAtRU5WOkJvZHk+PG5zMzpwc3BOb3RpZnlQYXltZW50UmVzIHhtbG5zOm5zMz0iaHR0cDovL3BhZ29wYS1hcGkucGFnb3BhLmdvdi5pdC9wc3AvcHNwRm9yTm9kZS54c2QiPjxvdXRjb21lPk9LPC9vdXRjb21lPjwvbnMzOnBzcE5vdGlmeVBheW1lbnRSZXM+PC9TT0FQLUVOVjpCb2R5PjwvU09BUC1FTlY6RW52ZWxvcGU+', +]; + + +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + + + + + +$data_req = [ + ':id' => 188, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 11:31:00.197', + ':tipoevento' => 'sendPaymentOutcome', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000180', + ':ccp' => 't0000000000000000000000000000180', + ':noticenumber' => '301000000000000180', + ':creditorreferenceid' => '01000000000000180', + ':paymenttoken' => 't0000000000000000000000000000180', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100183', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000188', + ':payload' => 'PHNvYXA6RW52ZWxvcGUgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iPgoJPHNvYXA6Qm9keT4KCQk8bnMyOnNlbmRQYXltZW50T3V0Y29tZVJlcSB4bWxuczpuczI9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvbm9kZS9ub2RlRm9yUHNwLnhzZCIgeG1sbnM6bnMzPSJodHRwOi8vd3MucGFnYW1lbnRpLnRlbGVtYXRpY2kuZ292LyI+CgkJCTxpZFBTUD5BR0lEXzAxPC9pZFBTUD4KCQkJPGlkQnJva2VyUFNQPjg4ODg4ODg4ODg4PC9pZEJyb2tlclBTUD4KCQkJPGlkQ2hhbm5lbD44ODg4ODg4ODg4OF8wMTwvaWRDaGFubmVsPgoJCQk8cGFzc3dvcmQ+eHh4eHh4eHg8L3Bhc3N3b3JkPgoJCQk8cGF5bWVudFRva2VuPnQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMTgwPC9wYXltZW50VG9rZW4+CgkJCTxvdXRjb21lPk9LPC9vdXRjb21lPgoJCQk8ZGV0YWlscz4KCQkJCTxwYXltZW50TWV0aG9kPm90aGVyPC9wYXltZW50TWV0aG9kPgoJCQkJPGZlZT4xLjAwPC9mZWU+CgkJCQk8YXBwbGljYXRpb25EYXRlPjIwMjQtMDQtMDI8L2FwcGxpY2F0aW9uRGF0ZT4KCQkJCTx0cmFuc2ZlckRhdGU+MjAyNC0wNC0wMzwvdHJhbnNmZXJEYXRlPgoJCQk8L2RldGFpbHM+CgkJPC9uczI6c2VuZFBheW1lbnRPdXRjb21lUmVxPgoJPC9zb2FwOkJvZHk+Cjwvc29hcDpFbnZlbG9wZT4=', +]; + +$data_resp = [ + ':id' => 189, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 11:31:01.197', + ':tipoevento' => 'sendPaymentOutcome', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000180', + ':ccp' => 't0000000000000000000000000000180', + ':noticenumber' => '301000000000000180', + ':creditorreferenceid' => '01000000000000180', + ':paymenttoken' => 't0000000000000000000000000000180', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_100183', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000189', + ':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 ebf40bed..ffd28b1d 100644 --- a/src/sql/02_2024_create_table.sql +++ b/src/sql/02_2024_create_table.sql @@ -57,7 +57,7 @@ create table if not exists public.transaction_re_2024 ( id bigint default nextval('public.transaction_re_2024_id_seq'::regclass) not null, date_event date not null, inserted_timestamp timestamp not null, - tipoevento varchar(30) null, + tipoevento varchar(40) null, sottotipoevento varchar(15) null, iddominio varchar(30) null, iuv varchar(50) null, diff --git a/src/src/crawler/events/req/closePaymentV1.php b/src/src/crawler/events/req/closePaymentV1.php new file mode 100644 index 00000000..b5eb600b --- /dev/null +++ b/src/src/crawler/events/req/closePaymentV1.php @@ -0,0 +1,135 @@ +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; + } + + /** + * @inheritDoc + */ + public function isFaultEvent(): bool + { + return false; + } + + /** + * @inheritDoc + */ + public function getFaultCode(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getFaultString(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getFaultDescription(): string|null + { + return null; + } +} \ No newline at end of file diff --git a/src/src/crawler/events/resp/nodoChiediInformazioniPagamento.php b/src/src/crawler/events/resp/nodoChiediInformazioniPagamento.php new file mode 100644 index 00000000..9138ba14 --- /dev/null +++ b/src/src/crawler/events/resp/nodoChiediInformazioniPagamento.php @@ -0,0 +1,202 @@ +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; + } + + /** + * @inheritDoc + */ + public function isFaultEvent(): bool + { + return false; + } + + /** + * @inheritDoc + */ + public function getFaultCode(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getFaultString(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getFaultDescription(): string|null + { + return null; + } +} \ No newline at end of file diff --git a/src/src/crawler/methods/AbstractJsonPayload.php b/src/src/crawler/methods/AbstractJsonPayload.php index 31eed21d..7fb75aca 100644 --- a/src/src/crawler/methods/AbstractJsonPayload.php +++ b/src/src/crawler/methods/AbstractJsonPayload.php @@ -428,7 +428,12 @@ public function getNoticeNumber(int $index = 0): string|null */ public function getImportoTotale(): string|null { - return (static::JPATH_TOTAL_CART_AMOUNT == null) ? null : $this->getElement(static::JPATH_TOTAL_CART_AMOUNT); + if (static::JPATH_TOTAL_CART_AMOUNT == null) + { + return null; + } + $value = $this->getElement(static::JPATH_TOTAL_CART_AMOUNT); + return ($value == null) ? null : number_format($value, 2, '.', ''); } /** @@ -441,7 +446,7 @@ public function getImporto(int $index = 0): string|null { return null; } - return (static::JPATH_SINGLE_PAYMENT_IMPORT == null) ? null : $this->getElement(static::JPATH_SINGLE_PAYMENT_IMPORT, $index); + return (static::JPATH_SINGLE_PAYMENT_IMPORT == null) ? null : number_format($this->getElement(static::JPATH_SINGLE_PAYMENT_IMPORT, $index), 2, '.', ''); } /** diff --git a/src/src/crawler/methods/req/closePaymentV1.php b/src/src/crawler/methods/req/closePaymentV1.php new file mode 100644 index 00000000..5fae3962 --- /dev/null +++ b/src/src/crawler/methods/req/closePaymentV1.php @@ -0,0 +1,61 @@ +getElement(self::JPATH_TOTAL_CART_AMOUNT); + $fee = (float) $this->getElement('fee'); + $onlyPayment = ($totalAmount - $fee); + return number_format($onlyPayment, 2, '.', ''); + } + + public function getImporto(int $index = 0): string|null + { + return $this->getImportoTotale(); + } + + public function getPaymentsCount(): int|null + { + return 1; + } + + public function getRRN() : string|null + { + return null; + } + + public function getAuthCode() : string|null + { + return $this->getElement('additionalPaymentInformations->authorizationCode'); + } + + + +} \ No newline at end of file diff --git a/src/src/crawler/methods/req/closePaymentV2.php b/src/src/crawler/methods/req/closePaymentV2.php index e1197bbc..f417459e 100644 --- a/src/src/crawler/methods/req/closePaymentV2.php +++ b/src/src/crawler/methods/req/closePaymentV2.php @@ -34,7 +34,8 @@ public function getImportoTotale(): string|null { $totalAmount = (float) $this->getElement(self::JPATH_TOTAL_CART_AMOUNT); $fee = (float) $this->getElement('fee'); - return ($totalAmount - $fee); + $onlyPayment = ($totalAmount - $fee); + return number_format($onlyPayment, 2, '.', ''); } diff --git a/src/src/crawler/methods/req/nodoChiediInformazioniPagamento.php b/src/src/crawler/methods/req/nodoChiediInformazioniPagamento.php new file mode 100644 index 00000000..8efcd941 --- /dev/null +++ b/src/src/crawler/methods/req/nodoChiediInformazioniPagamento.php @@ -0,0 +1,20 @@ +getImportoTotale(); + } + + public function getPaymentsCount(): int|null + { + return null; + } +} \ No newline at end of file diff --git a/src/src/crawler/paymentlist/req/nodoChiediInformazioniPagamento.php b/src/src/crawler/paymentlist/req/nodoChiediInformazioniPagamento.php new file mode 100644 index 00000000..8e52ae6d --- /dev/null +++ b/src/src/crawler/paymentlist/req/nodoChiediInformazioniPagamento.php @@ -0,0 +1,34 @@ +setEvent($event); + } + + /** + * @inheritDoc + */ + public function isValidPayment(int $index = 0): bool + { + return ($this->getEvent()->getIuv(0) && $this->getEvent()->getPaEmittente(0)); + } + + /** + * @inheritDoc + */ + public function isAttempt(int $index = 0): bool + { + return ($this->getEvent()->getIuv(0) && $this->getEvent()->getPaEmittente(0) && $this->getEvent()->getPaymentToken(0)); + } +} \ No newline at end of file diff --git a/src/src/crawler/paymentlist/resp/nodoChiediInformazioniPagamento.php b/src/src/crawler/paymentlist/resp/nodoChiediInformazioniPagamento.php new file mode 100644 index 00000000..84a68a15 --- /dev/null +++ b/src/src/crawler/paymentlist/resp/nodoChiediInformazioniPagamento.php @@ -0,0 +1,34 @@ +setEvent($event); + } + + /** + * @inheritDoc + */ + public function isValidPayment(int $index = 0): bool + { + return ($this->getEvent()->getIuv(0) && $this->getEvent()->getPaEmittente(0)); + } + + /** + * @inheritDoc + */ + public function isAttempt(int $index = 0): bool + { + 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/nodoChiediInformazioniPagamentoTest.php b/src/tests/pagopa/events/req/nodoChiediInformazioniPagamentoTest.php new file mode 100644 index 00000000..ec4f4fd1 --- /dev/null +++ b/src/tests/pagopa/events/req/nodoChiediInformazioniPagamentoTest.php @@ -0,0 +1,129 @@ +event = new nodoChiediInformazioniPagamento([ + 'date_event' => '2023-09-01', + 'inserted_timestamp' => '2023-09-01 07:37:50', + 'tipoevento' => 'nodoChiediInformazioniPagamento', + 'sottotipoevento' => 'REQ', + 'psp' => 'AGID_01', + 'stazione' => '77777777777_01', + 'canale' => '88888888888_01', + 'sessionid' => 'sessid_0010', + 'sessionidoriginal' => '', + 'uniqueid' => 'unique_id_activateIO_OK', + 'state' => 'TO_LOAD', + 'iddominio' => '77777777777', + 'iuv' => '01000000000000010', + 'ccp' => 't0000000000000000000000000000010', + 'noticeNumber' => '301000000000000010', + 'creditorreferenceid' => '01000000000000010', + 'paymenttoken' => 't0000000000000000000000000000010', + 'payload' => '' + ]); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $value = ['77777777777']; + $this->assertEquals($value, $this->event->getPaEmittenti()); + } + + #[TestDox('workflowEvent()')] + public function testWorkflowEvent() + { + $workflow = $this->event->workflowEvent(); + $this->assertEquals(31, $workflow->getReadyColumnValue('fk_tipoevento')); + $this->assertEquals('2023-09-01 07:37:50.000', $workflow->getReadyColumnValue('event_timestamp')); + $this->assertEquals('unique_id_activateIO_OK', $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('getCcps()')] + public function testGetCcps() + { + $value = ['t0000000000000000000000000000010']; + $this->assertEquals($value, $this->event->getCcps()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $value = ['01000000000000010']; + $this->assertEquals($value, $this->event->getIuvs()); + } + + #[TestDox('getMethodInterface()')] + public function testGetMethodInterface() + { + $this->assertInstanceOf(\pagopa\crawler\methods\req\nodoChiediInformazioniPagamento::class, $this->event->getMethodInterface()); + } + + #[TestDox('transactionDetails()')] + public function testTransactionDetails() + { + $this->assertNull($this->event->transactionDetails(0)); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->event->getTransferCount()); + } + + #[TestDox('isFaultEvent()')] + public function testIsFaultEvent() + { + $this->assertFalse($this->event->isFaultEvent()); + } + + #[TestDox('getFaultString()')] + public function testGetFaultString() + { + $this->assertNull($this->event->getFaultString()); + } + + #[TestDox('getFaultDescription()')] + public function testGetFaultDescription() + { + $this->assertNull($this->event->getFaultDescription()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertEquals(1, $this->event->getPaymentsCount()); + } + + #[TestDox('getFaultCode()')] + public function testGetFaultCode() + { + $this->assertNull($this->event->getFaultCode()); + } + + #[TestDox('transaction()')] + public function testTransaction() + { + $this->assertNull($this->event->transaction()); + } +} diff --git a/src/tests/pagopa/events/resp/nodoChiediInformazioniPagamentoTest.php b/src/tests/pagopa/events/resp/nodoChiediInformazioniPagamentoTest.php new file mode 100644 index 00000000..c8ff4fb0 --- /dev/null +++ b/src/tests/pagopa/events/resp/nodoChiediInformazioniPagamentoTest.php @@ -0,0 +1,119 @@ +event = new nodoChiediInformazioniPagamento([ + 'date_event' => '2023-09-01', + 'inserted_timestamp' => '2023-09-01 07:37:50', + 'tipoevento' => 'nodoChiediInformazioniPagamento', + 'sottotipoevento' => 'RESP', + 'psp' => 'AGID_01', + 'stazione' => '77777777777_01', + 'canale' => '88888888888_01', + 'sessionid' => 'sessid_0010', + 'sessionidoriginal' => '', + 'uniqueid' => 'unique_id_activateIO_OK', + 'state' => 'TO_LOAD', + 'iddominio' => '77777777777', + 'iuv' => '01000000000000010', + 'ccp' => 't0000000000000000000000000000010', + 'noticeNumber' => '301000000000000010', + 'creditorreferenceid' => '01000000000000010', + 'paymenttoken' => 't0000000000000000000000000000010', + 'payload' => 'ewogICAgIklCQU4iOiAiSVQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxIiwKICAgICJib2xsb0RpZ2l0YWxlIjogZmFsc2UsCiAgICAiY29kaWNlRmlzY2FsZSI6ICJYWFhYWFhYWFhYWFhYWFgiLAogICAgImRldHRhZ2xpIjogWwogICAgICAgIHsKICAgICAgICAgICAgIkNDUCI6ICJjMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxMCIsCiAgICAgICAgICAgICJJVVYiOiAiMDEwMDAwMDAwMDAwMDAwMTAiLAogICAgICAgICAgICAiY29kaWNlUGFnYXRvcmUiOiAiWFhYWFhYWFhYWFhYWFhYIiwKICAgICAgICAgICAgImVudGVCZW5lZmljaWFyaW8iOiAieHh4eHgiLAogICAgICAgICAgICAiaWREb21pbmlvIjogIjc3Nzc3Nzc3Nzc3IiwKICAgICAgICAgICAgImltcG9ydG8iOiA3NS41MCwKICAgICAgICAgICAgIm5vbWVQYWdhdG9yZSI6ICJ4eHh4eCIsCiAgICAgICAgICAgICJ0aXBvUGFnYXRvcmUiOiAiRiIKICAgICAgICB9CiAgICBdLAogICAgImltcG9ydG9Ub3RhbGUiOiA3NS41MCwKICAgICJvZ2dldHRvUGFnYW1lbnRvIjogIlBBR0FNRU5UTyBUQVJJIFJBVEEgMSIsCiAgICAicmFnaW9uZVNvY2lhbGUiOiAieHh4eHgiLAogICAgInVybFJlZGlyZWN0RUMiOiAiaHR0cDovL2V4YW1wbGUuY29tIgp9' + ]); + } + + #[TestDox('transactionDetails()')] + public function testTransactionDetails() + { + $this->assertNull($this->event->transactionDetails(0)); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $value = ['t0000000000000000000000000000010']; + $this->assertEquals($value, $this->event->getCcps()); + } + + #[TestDox('transaction()')] + public function testTransaction() + { + $this->assertNull($this->event->transaction()); + } + + #[TestDox('workflowEvent()')] + public function testWorkflowEvent() + { + + } + + #[TestDox('getFaultCode()')] + public function testGetFaultCode() + { + $this->assertNull($this->event->getFaultCode()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $value = ['77777777777']; + $this->assertEquals($value, $this->event->getPaEmittenti()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->event->getTransferCount()); + } + + #[TestDox('isFaultEvent()')] + public function testIsFaultEvent() + { + $this->assertFalse($this->event->isFaultEvent()); + } + #[TestDox('getFaultString()')] + public function testGetFaultString() + { + $this->assertNull($this->event->getFaultString()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $value = ['01000000000000010']; + $this->assertEquals($value, $this->event->getIuvs()); + } + + #[TestDox('getMethodInterface()')] + public function testGetMethodInterface() + { + $this->assertInstanceOf(\pagopa\crawler\methods\resp\nodoChiediInformazioniPagamento::class, $this->event->getMethodInterface()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertEquals(1, $this->event->getPaymentsCount()); + } + + #[TestDox('getFaultDescription()')] + public function testGetFaultDescription() + { + $this->assertNull($this->event->getFaultDescription()); + } +} diff --git a/src/tests/pagopa/methods/req/closePaymentV1Test.php b/src/tests/pagopa/methods/req/closePaymentV1Test.php new file mode 100644 index 00000000..5739167c --- /dev/null +++ b/src/tests/pagopa/methods/req/closePaymentV1Test.php @@ -0,0 +1,212 @@ +payment = new closePaymentV1(base64_decode('ewogICAgImFkZGl0aW9uYWxQYXltZW50SW5mb3JtYXRpb25zIjogewogICAgICAgICJhdXRob3JpemF0aW9uQ29kZSI6ICIwMDAwMDAwMDAwMDAwMDAwMDAwMDAxMCIsCiAgICAgICAgIm91dGNvbWVQYXltZW50R2F0ZXdheSI6ICIwIiwKICAgICAgICAidHJhbnNhY3Rpb25JZCI6ICIxMTExMTExMTIiCiAgICB9LAogICAgImZlZSI6IDAuNSwKICAgICJpZGVudGlmaWNhdGl2b0NhbmFsZSI6ICI4ODg4ODg4ODg4OF8wMSIsCiAgICAiaWRlbnRpZmljYXRpdm9JbnRlcm1lZGlhcmlvIjogIjg4ODg4ODg4ODg4IiwKICAgICJpZGVudGlmaWNhdGl2b1BzcCI6ICJBR0lEXzAxIiwKICAgICJvdXRjb21lIjogIk9LIiwKICAgICJwYXltZW50VG9rZW5zIjogWwogICAgICAgICJ0MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxMCIKICAgIF0sCiAgICAicHNwVHJhbnNhY3Rpb25JZCI6ICIxMTExMTExMTIiLAogICAgInRpbWVzdGFtcE9wZXJhdGlvbiI6ICIyMDI0LTA0LTMwVDIxOjE4OjAwLjM3OVoiLAogICAgInRpcG9WZXJzYW1lbnRvIjogIkJQQVkiLAogICAgInRvdGFsQW1vdW50IjogNzUuNQp9')); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertEquals(1, $this->payment->getPaymentsCount()); + } + + #[TestDox('isBollo()')] + public function testIsBollo() + { + $this->assertFalse($this->payment->isBollo(0, 0)); + } + + #[TestDox('getPaEmittente()')] + public function testGetPaEmittente() + { + $this->assertNull($this->payment->getPaEmittente()); + } + + #[TestDox('getImporto()')] + public function testGetImporto() + { + $this->assertEquals('75.00', $this->payment->getImporto()); + } + + #[TestDox('getTransferId()')] + public function testGetTransferId() + { + $this->assertNull($this->payment->getTransferId(0, 0)); + } + + #[TestDox('getPaymentMetaDataCount()')] + public function testGetPaymentMetaDataCount() + { + $this->assertNull($this->payment->getPaymentMetaDataCount(0)); + } + + #[TestDox('getTransferMetaDataValue()')] + public function testGetTransferMetaDataValue() + { + $this->assertNull($this->payment->getTransferMetaDataValue(0, 0, 0)); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->payment->getTransferCount(0)); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $this->assertEquals(['t0000000000000000000000000000010'], $this->payment->getCcps()); + } + + #[TestDox('getPsp()')] + public function testGetPsp() + { + $this->assertEquals('AGID_01', $this->payment->getPsp()); + } + + #[TestDox('getPaymentMetaDataValue()')] + public function testGetPaymentMetaDataValue() + { + $this->assertNull($this->payment->getPaymentMetaDataValue(0, 0)); + } + + #[TestDox('getTransferMetaDataKey()')] + public function testGetTransferMetaDataKey() + { + $this->assertNull($this->payment->getTransferMetaDataKey(0, 0, 0)); + } + + #[TestDox('getAllTokens()')] + public function testGetAllTokens() + { + $this->assertEquals(['t0000000000000000000000000000010'], $this->payment->getAllTokens()); + } + + #[TestDox('getStazione()')] + public function testGetStazione() + { + $this->assertNull($this->payment->getStazione()); + } + + #[TestDox('getNoticeNumber()')] + public function testGetNoticeNumber() + { + $this->assertNull($this->payment->getNoticeNumber()); + } + + #[TestDox('getPaymentMetaDataKey()')] + public function testGetPaymentMetaDataKey() + { + $this->assertNull($this->payment->getPaymentMetaDataKey(0, 0)); + } + + #[TestDox('getCanale()')] + public function testGetCanale() + { + $this->assertEquals('88888888888_01', $this->payment->getCanale()); + } + + #[TestDox('getBrokerPsp()')] + public function testGetBrokerPsp() + { + $this->assertEquals('88888888888', $this->payment->getBrokerPsp()); + } + + #[TestDox('getAuthCode()')] + public function testGetAuthCode() + { + $this->assertEquals('00000000000000000000010', $this->payment->getAuthCode()); + } + + #[TestDox('getTransferIban()')] + public function testGetTransferIban() + { + $this->assertNull($this->payment->getTransferIban(0, 0)); + } + + #[TestDox('getAllNoticesNumbers()')] + public function testGetAllNoticesNumbers() + { + $this->assertNull($this->payment->getAllNoticesNumbers()); + } + + #[TestDox('getTransferPa()')] + public function testGetTransferPa() + { + $this->assertNull($this->payment->getTransferPa(0, 0)); + } + + #[TestDox('getTransferAmount()')] + public function testGetTransferAmount() + { + $this->assertNull($this->payment->getTransferAmount(0, 0)); + } + + #[TestDox('getIuv()')] + public function testGetIuv() + { + $this->assertNull($this->payment->getIuv()); + } + + #[TestDox('getCcp()')] + public function testGetCcp() + { + $this->assertEquals('t0000000000000000000000000000010', $this->payment->getCcp()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $this->assertNull($this->payment->getIuvs()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $this->assertNull($this->payment->getPaEmittenti()); + } + + #[TestDox('getToken()')] + public function testGetToken() + { + $this->assertEquals('t0000000000000000000000000000010', $this->payment->getToken()); + } + + #[TestDox('getBrokerPa()')] + public function testGetBrokerPa() + { + $this->assertNull($this->payment->getBrokerPa()); + } + + #[TestDox('getImportoTotale()')] + public function testGetImportoTotale() + { + $this->assertEquals('75.00', $this->payment->getImportoTotale()); + } + + #[TestDox('getTransferMetaDataCount()')] + public function testGetTransferMetaDataCount() + { + $this->assertNull($this->payment->getTransferMetaDataCount()); + } + + #[TestDox('outcome()')] + public function testOutcome() + { + $this->assertEquals('OK', $this->payment->outcome()); + } +} diff --git a/src/tests/pagopa/methods/req/nodoChiediInformazioniPagamentoTest.php b/src/tests/pagopa/methods/req/nodoChiediInformazioniPagamentoTest.php new file mode 100644 index 00000000..ce938843 --- /dev/null +++ b/src/tests/pagopa/methods/req/nodoChiediInformazioniPagamentoTest.php @@ -0,0 +1,218 @@ +info = new nodoChiediInformazioniPagamento(''); + } + + #[TestDox('isBollo()')] + public function testIsBollo() + { + $this->assertFalse($this->info->isBollo()); + } + + #[TestDox('getPaEmittente()')] + public function testGetPaEmittente() + { + $this->assertNull($this->info->getPaEmittente()); + } + + #[TestDox('getImporto()')] + public function testGetImporto() + { + $this->assertNull($this->info->getImporto()); + } + + #[TestDox('getTransferId()')] + public function testGetTransferId() + { + $this->assertNull($this->info->getTransferId()); + } + + #[TestDox('getPaymentMetaDataCount()')] + public function testGetPaymentMetaDataCount() + { + $this->assertNull($this->info->getPaymentMetaDataCount()); + } + + #[TestDox('getTransferMetaDataValue()')] + public function testGetTransferMetaDataValue() + { + $this->assertNull($this->info->getTransferMetaDataValue()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->info->getTransferCount()); + } + + #[TestDox('getImportoTotale()')] + public function testGetImportoTotale() + { + $this->assertNull($this->info->getImportoTotale()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $this->assertNull($this->info->getCcps()); + } + + #[TestDox('getPsp()')] + public function testGetPsp() + { + $this->assertNull($this->info->getPsp()); + } + + #[TestDox('getPaymentMetaDataValue()')] + public function testGetPaymentMetaDataValue() + { + $this->assertNull($this->info->getPaymentMetaDataValue()); + } + + #[TestDox('getTransferMetaDataKey()')] + public function testGetTransferMetaDataKey() + { + $this->assertNull($this->info->getTransferMetaDataKey()); + } + + #[TestDox('getAllTokens()')] + public function testGetAllTokens() + { + $this->assertNull($this->info->getAllTokens()); + } + + #[TestDox('getStazione()')] + public function testGetStazione() + { + $this->assertNull($this->info->getStazione()); + } + + #[TestDox('getNoticeNumber()')] + public function testGetNoticeNumber() + { + $this->assertNull($this->info->getNoticeNumber()); + } + + #[TestDox('getPaymentMetaDataKey()')] + public function testGetPaymentMetaDataKey() + { + $this->assertNull($this->info->getPaymentMetaDataKey()); + } + + #[TestDox('getCanale()')] + public function testGetCanale() + { + $this->assertNull($this->info->getCanale()); + } + + #[TestDox('getBrokerPsp()')] + public function testGetBrokerPsp() + { + $this->assertNull($this->info->getBrokerPsp()); + } + + #[TestDox('getTransferIban()')] + public function testGetTransferIban() + { + $this->assertNull($this->info->getTransferIban()); + } + + #[TestDox('getAllNoticesNumbers()')] + public function testGetAllNoticesNumbers() + { + $this->assertNull($this->info->getAllNoticesNumbers()); + } + + #[TestDox('getTransferPa()')] + public function testGetTransferPa() + { + $this->assertNull($this->info->getTransferPa()); + } + + #[TestDox('getTransferAmount()')] + public function testGetTransferAmount() + { + $this->assertNull($this->info->getTransferAmount()); + } + + #[TestDox('getIuv()')] + public function testGetIuv() + { + $this->assertNull($this->info->getIuv()); + } + + #[TestDox('getCcp()')] + public function testGetCcp() + { + $this->assertNull($this->info->getCcp()); + } + + #[TestDox('getElementCount()')] + public function testGetElementCount() + { + $this->assertNull($this->info->getElementCount(0)); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $this->assertNull($this->info->getIuvs()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $this->assertNull($this->info->getPaEmittenti()); + } + + #[TestDox('getToken()')] + public function testGetToken() + { + $this->assertNull($this->info->getToken()); + } + + #[TestDox('getBrokerPa()')] + public function testGetBrokerPa() + { + $this->assertNull($this->info->getBrokerPa()); + } + + #[TestDox('isValidPayload()')] + public function testIsValidPayload() + { + $this->assertFalse($this->info->isValidPayload()); + } + + #[TestDox('getTransferMetaDataCount()')] + public function testGetTransferMetaDataCount() + { + $this->assertNull($this->info->getTransferMetaDataCount()); + } + + #[TestDox('outcome()')] + public function testOutcome() + { + $this->assertNull($this->info->outcome()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertNull($this->info->getPaymentsCount()); + } +} diff --git a/src/tests/pagopa/methods/resp/closePaymentV1Test.php b/src/tests/pagopa/methods/resp/closePaymentV1Test.php new file mode 100644 index 00000000..08aff489 --- /dev/null +++ b/src/tests/pagopa/methods/resp/closePaymentV1Test.php @@ -0,0 +1,230 @@ +payment = new closePaymentV1(base64_decode('ewogICAgImVzaXRvIjogIk9LIgp9')); + } + + #[TestDox('isBollo()')] + public function testIsBollo() + { + $this->assertFalse($this->payment->isBollo()); + } + + #[TestDox('getPaEmittente()')] + public function testGetPaEmittente() + { + $this->assertNull($this->payment->getPaEmittente()); + } + + #[TestDox('getImporto()')] + public function testGetImporto() + { + $this->assertNull($this->payment->getImporto()); + } + + #[TestDox('getTransferId()')] + public function testGetTransferId() + { + $this->assertNull($this->payment->getTransferId()); + } + + #[TestDox('getPaymentMetaDataCount()')] + public function testGetPaymentMetaDataCount() + { + $this->assertNull($this->payment->getPaymentMetaDataCount()); + } + + #[TestDox('getTransferMetaDataValue()')] + public function testGetTransferMetaDataValue() + { + $this->assertNull($this->payment->getTransferMetaDataValue()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->payment->getTransferCount()); + } + + #[TestDox('getImportoTotale()')] + public function testGetImportoTotale() + { + $this->assertNull($this->payment->getImportoTotale()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $this->assertNull($this->payment->getCcps()); + } + + #[TestDox('getPsp()')] + public function testGetPsp() + { + $this->assertNull($this->payment->getPsp()); + } + + #[TestDox('getFaultCode()')] + public function testGetFaultCode() + { + $this->assertNull($this->payment->getFaultCode()); + } + + #[TestDox('getPaymentMetaDataValue()')] + public function testGetPaymentMetaDataValue() + { + $this->assertNull($this->payment->getPaymentMetaDataValue()); + } + + #[TestDox('getTransferMetaDataKey()')] + public function testGetTransferMetaDataKey() + { + $this->assertNull($this->payment->getTransferMetaDataKey()); + } + + #[TestDox('getAllTokens()')] + public function testGetAllTokens() + { + $this->assertNull($this->payment->getAllTokens()); + } + + #[TestDox('getStazione()')] + public function testGetStazione() + { + $this->assertNull($this->payment->getStazione()); + } + + #[TestDox('getNoticeNumber()')] + public function testGetNoticeNumber() + { + $this->assertNull($this->payment->getNoticeNumber()); + } + + #[TestDox('getPaymentMetaDataKey()')] + public function testGetPaymentMetaDataKey() + { + $this->assertNull($this->payment->getPaymentMetaDataKey()); + } + + #[TestDox('getCanale()')] + public function testGetCanale() + { + $this->assertNull($this->payment->getCanale()); + } + + #[TestDox('getBrokerPsp()')] + public function testGetBrokerPsp() + { + $this->assertNull($this->payment->getBrokerPsp()); + } + + #[TestDox('isFaultEvent()')] + public function testIsFaultEvent() + { + $this->assertFalse($this->payment->isFaultEvent()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertNull($this->payment->getPaymentsCount()); + } + + #[TestDox('getTransferIban()')] + public function testGetTransferIban() + { + $this->assertNull($this->payment->getTransferIban()); + } + + #[TestDox('getAllNoticesNumbers()')] + public function testGetAllNoticesNumbers() + { + $this->assertNull($this->payment->getAllNoticesNumbers()); + } + + #[TestDox('getTransferPa()')] + public function testGetTransferPa() + { + $this->assertNull($this->payment->getTransferPa()); + } + + #[TestDox('getTransferAmount()')] + public function testGetTransferAmount() + { + $this->assertNull($this->payment->getTransferAmount()); + } + + #[TestDox('getIuv()')] + public function testGetIuv() + { + $this->assertNull($this->payment->getIuv()); + } + + #[TestDox('getCcp()')] + public function testGetCcp() + { + $this->assertNull($this->payment->getCcp()); + } + + #[TestDox('getFaultDescription()')] + public function testGetFaultDescription() + { + $this->assertNull($this->payment->getFaultDescription()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $this->assertNull($this->payment->getIuvs()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $this->assertNull($this->payment->getPaEmittenti()); + } + + #[TestDox('getToken()')] + public function testGetToken() + { + $this->assertNull($this->payment->getToken()); + } + + #[TestDox('getBrokerPa()')] + public function testGetBrokerPa() + { + $this->assertNull($this->payment->getBrokerPa()); + } + + #[TestDox('getFaultString()')] + public function testGetFaultString() + { + $this->assertNull($this->payment->getFaultString()); + } + + #[TestDox('getTransferMetaDataCount()')] + public function testGetTransferMetaDataCount() + { + $this->assertNull($this->payment->getTransferMetaDataCount()); + } + + #[TestDox('outcome()')] + public function testOutcome() + { + $this->assertEquals('OK', $this->payment->outcome()); + } +} diff --git a/src/tests/pagopa/methods/resp/nodoChiediInformazioniPagamentoTest.php b/src/tests/pagopa/methods/resp/nodoChiediInformazioniPagamentoTest.php new file mode 100644 index 00000000..c99b12cd --- /dev/null +++ b/src/tests/pagopa/methods/resp/nodoChiediInformazioniPagamentoTest.php @@ -0,0 +1,235 @@ +info = new nodoChiediInformazioniPagamento(base64_decode('ewogICAgIklCQU4iOiAiSVQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxIiwKICAgICJib2xsb0RpZ2l0YWxlIjogZmFsc2UsCiAgICAiY29kaWNlRmlzY2FsZSI6ICJYWFhYWFhYWFhYWFhYWFgiLAogICAgImRldHRhZ2xpIjogWwogICAgICAgIHsKICAgICAgICAgICAgIkNDUCI6ICJjMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxMCIsCiAgICAgICAgICAgICJJVVYiOiAiMDEwMDAwMDAwMDAwMDAwMTAiLAogICAgICAgICAgICAiY29kaWNlUGFnYXRvcmUiOiAiWFhYWFhYWFhYWFhYWFhYIiwKICAgICAgICAgICAgImVudGVCZW5lZmljaWFyaW8iOiAieHh4eHgiLAogICAgICAgICAgICAiaWREb21pbmlvIjogIjc3Nzc3Nzc3Nzc3IiwKICAgICAgICAgICAgImltcG9ydG8iOiA3NS41MCwKICAgICAgICAgICAgIm5vbWVQYWdhdG9yZSI6ICJ4eHh4eCIsCiAgICAgICAgICAgICJ0aXBvUGFnYXRvcmUiOiAiRiIKICAgICAgICB9CiAgICBdLAogICAgImltcG9ydG9Ub3RhbGUiOiA3NS41MCwKICAgICJvZ2dldHRvUGFnYW1lbnRvIjogIlBBR0FNRU5UTyBUQVJJIFJBVEEgMSIsCiAgICAicmFnaW9uZVNvY2lhbGUiOiAieHh4eHgiLAogICAgInVybFJlZGlyZWN0RUMiOiAiaHR0cDovL2V4YW1wbGUuY29tIgp9')); + } + + #[TestDox('isBollo()')] + public function testIsBollo() + { + $this->assertFalse($this->info->isBollo(0,0)); + } + + #[TestDox('getPaEmittente()')] + public function testGetPaEmittente() + { + $this->assertNull($this->info->getPaEmittente()); + } + + #[TestDox('getImporto()')] + public function testGetImporto() + { + $this->assertEquals('75.50', $this->info->getImporto()); + } + + #[TestDox('getTransferId()')] + public function testGetTransferId() + { + $this->assertNull($this->info->getTransferId(0,0 )); + } + + #[TestDox('getPaymentMetaDataCount()')] + public function testGetPaymentMetaDataCount() + { + $this->assertNull($this->info->getPaymentMetaDataCount()); + } + + #[TestDox('getTransferMetaDataValue()')] + public function testGetTransferMetaDataValue() + { + $this->assertNull($this->info->getTransferMetaDataValue(0,0 )); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->info->getTransferCount()); + } + + #[TestDox('getImportoTotale()')] + public function testGetImportoTotale() + { + $this->assertEquals('75.50', $this->info->getImportoTotale()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $this->assertNull($this->info->getCcps()); + } + + #[TestDox('getPsp()')] + public function testGetPsp() + { + $this->assertNull($this->info->getPsp()); + } + + #[TestDox('getFaultCode()')] + public function testGetFaultCode() + { + $this->assertNull($this->info->getFaultCode()); + } + + #[TestDox('getPaymentMetaDataValue()')] + public function testGetPaymentMetaDataValue() + { + $this->assertNull($this->info->getPaymentMetaDataValue(0,0 )); + } + + #[TestDox('getTransferMetaDataKey()')] + public function testGetTransferMetaDataKey() + { + $this->assertNull($this->info->getTransferMetaDataKey(0,0 )); + } + + #[TestDox('getAllTokens()')] + public function testGetAllTokens() + { + $this->assertNull($this->info->getAllTokens()); + } + + #[TestDox('getStazione()')] + public function testGetStazione() + { + $this->assertNull($this->info->getStazione()); + } + + #[TestDox('getNoticeNumber()')] + public function testGetNoticeNumber() + { + $this->assertNull($this->info->getNoticeNumber()); + } + + #[TestDox('getPaymentMetaDataKey()')] + public function testGetPaymentMetaDataKey() + { + $this->assertNull($this->info->getPaymentMetaDataKey(0,0 )); + } + + #[TestDox('getCanale()')] + public function testGetCanale() + { + $this->assertNull($this->info->getCanale()); + } + + #[TestDox('getBrokerPsp()')] + public function testGetBrokerPsp() + { + $this->assertNull($this->info->getBrokerPsp()); + } + + #[TestDox('isFaultEvent()')] + public function testIsFaultEvent() + { + $this->assertFalse($this->info->isFaultEvent()); + } + + #[TestDox('getTransferIban()')] + public function testGetTransferIban() + { + $this->assertNull($this->info->getTransferIban()); + } + + #[TestDox('getAllNoticesNumbers()')] + public function testGetAllNoticesNumbers() + { + $this->assertNull($this->info->getAllNoticesNumbers()); + } + + #[TestDox('getTransferPa()')] + public function testGetTransferPa() + { + $this->assertNull($this->info->getTransferPa()); + } + + #[TestDox('getTransferAmount()')] + public function testGetTransferAmount() + { + $this->assertNull($this->info->getTransferAmount()); + } + + #[TestDox('getIuv()')] + public function testGetIuv() + { + $this->assertNull($this->info->getIuv()); + } + + #[TestDox('getCcp()')] + public function testGetCcp() + { + $this->assertNull($this->info->getCcp()); + } + + #[TestDox('getFaultDescription()')] + public function testGetFaultDescription() + { + $this->assertNull($this->info->getFaultDescription()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $this->assertNull($this->info->getIuvs()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $this->assertNull($this->info->getPaEmittenti()); + } + + #[TestDox('getToken()')] + public function testGetToken() + { + $this->assertNull($this->info->getToken()); + } + + #[TestDox('getBrokerPa()')] + public function testGetBrokerPa() + { + $this->assertNull($this->info->getBrokerPa()); + } + + #[TestDox('isValidPayload()')] + public function testIsValidPayload() + { + $this->assertTrue($this->info->isValidPayload()); + } + + #[TestDox('getFaultString()')] + public function testGetFaultString() + { + $this->assertNull($this->info->getFaultString()); + } + + #[TestDox('getTransferMetaDataCount()')] + public function testGetTransferMetaDataCount() + { + $this->assertNull($this->info->getTransferMetaDataCount()); + } + + #[TestDox('outcome()')] + public function testOutcome() + { + $this->assertNull($this->info->outcome()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertNull($this->info->getPaymentsCount()); + } +} diff --git a/src/tests/phpunit.xml b/src/tests/phpunit.xml index 5ba73c28..5f567d17 100644 --- a/src/tests/phpunit.xml +++ b/src/tests/phpunit.xml @@ -26,6 +26,7 @@ + process/crawler/nodoChiediInformazioniPagamento/T00059_WorkFlowWithNodoChiediInformazioniPagamento.php process/crawler/activatePaymentNotice/SingleEvent/T00001_CreateAttemptAllInfoInEvent.php @@ -98,6 +99,8 @@ pagopa/methods/req/activatePaymentNoticeV2Test.php pagopa/methods/req/pspNotifyPaymentV2Test.php pagopa/methods/req/closePaymentV2Test.php + pagopa/methods/req/closePaymentV1Test.php + pagopa/methods/req/nodoChiediInformazioniPagamentoTest.php pagopa/methods/resp/activatePaymentNoticeTest.php @@ -114,6 +117,9 @@ pagopa/methods/resp/activatePaymentNoticeV2Test.php pagopa/methods/resp/pspNotifyPaymentV2Test.php pagopa/methods/resp/closePaymentV2Test.php + pagopa/methods/resp/closePaymentV1Test.php + pagopa/methods/resp/nodoChiediInformazioniPagamentoTest.php + pagopa/events/req/activatePaymentNoticeTest.php @@ -130,6 +136,7 @@ pagopa/events/req/activatePaymentNoticeV2Test.php pagopa/events/req/pspNotifyPaymentV2Test.php pagopa/events/req/closePaymentV2Test.php + pagopa/events/req/nodoChiediInformazioniPagamentoTest.php pagopa/events/resp/activatePaymentNoticeTest.php @@ -145,6 +152,7 @@ pagopa/events/resp/activateIOPaymentTest.php pagopa/events/resp/pspNotifyPaymentV2Test.php pagopa/events/resp/closePaymentV2Test.php + pagopa/events/resp/nodoChiediInformazioniPagamentoTest.php process/normal/T0001.php diff --git a/src/tests/process/crawler/nodoChiediInformazioniPagamento/T00059_WorkFlowWithNodoChiediInformazioniPagamento.php b/src/tests/process/crawler/nodoChiediInformazioniPagamento/T00059_WorkFlowWithNodoChiediInformazioniPagamento.php new file mode 100644 index 00000000..942089e4 --- /dev/null +++ b/src/tests/process/crawler/nodoChiediInformazioniPagamento/T00059_WorkFlowWithNodoChiediInformazioniPagamento.php @@ -0,0 +1,172 @@ +getTransaction(new \DateTime('2024-03-10'), '01000000000000180'); + $this->assertEquals('2024-03-10 11:28:00.197', $transaction->getColumnValue('inserted_timestamp')); + $this->assertEquals('01000000000000180', $transaction->getColumnValue('iuv')); + $this->assertEquals('77777777777', $transaction->getColumnValue('pa_emittente')); + $this->assertEquals('t0000000000000000000000000000180', $transaction->getColumnValue('token_ccp')); + $this->assertEquals('80.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('CHECKOUT', $transaction->getColumnValue('touchpoint')); + $this->assertEquals('OK', $transaction->getColumnValue('esito')); + $this->assertNull($transaction->getReadyColumnValue('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'), '01000000000000180' ); + + $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('80.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'), '01000000000000180'); + + $workflow = self::$db->getWorkFlow($transaction, 0); + $this->assertEquals('1', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 11:28:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000182', $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('2', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 11:28:01.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000183', $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('31', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 11:29:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000184', $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('32', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 11:29:01.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000185', $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('15', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 11:30:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000186', $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('16', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 11:30:01.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000187', $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, 6); + $this->assertEquals('5', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 11:31:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000188', $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('6', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 11:31:01.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000189', $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'), '01000000000000180'); + $extra_info_rrn = self::$db->getExtraInfo($transaction, 'rrn'); + $this->assertEquals('111111111111', $extra_info_rrn->getColumnValue('info_value')); + $extra_info_rrn = self::$db->getExtraInfo($transaction, 'authcode'); + $this->assertEquals('111115', $extra_info_rrn->getColumnValue('info_value')); + } + #[TestDox('[ReEvent] Verifica stato evento')] + public function testEvent() + { + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 182); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 183); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 184); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 185); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 186); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 187); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 188); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 189); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + } + +}