From 2c8ecd00b33e336264c0fc7c04941fc29122754e Mon Sep 17 00:00:00 2001 From: esposimo Date: Sun, 14 Apr 2024 20:10:17 +0200 Subject: [PATCH] add nodoAttivaRPT to the crawler --- src/mock_crawler.php | 7 + src/mock_insert.php | 199 +++++++++++ src/sql/05_2024_insert_data.sql | 2 + src/src/crawler/events/req/nodoAttivaRPT.php | 213 ++++++++++++ src/src/crawler/events/resp/nodoAttivaRPT.php | 180 ++++++++++ src/src/crawler/events/resp/nodoInviaRPT.php | 1 - src/src/crawler/methods/req/nodoAttivaRPT.php | 296 ++++++++++++++++ .../crawler/methods/resp/nodoAttivaRPT.php | 319 ++++++++++++++++++ .../paymentlist/AbstractPaymentList.php | 2 +- .../crawler/paymentlist/req/nodoAttivaRPT.php | 58 ++++ .../crawler/paymentlist/req/nodoInviaRPT.php | 25 +- .../paymentlist/resp/nodoAttivaRPT.php | 54 +++ .../pagopa/events/req/nodoAttivaRPTTest.php | 194 +++++++++++ .../pagopa/events/resp/nodoAttivaRPTTest.php | 171 ++++++++++ .../pagopa/methods/req/nodoAttivaRPTTest.php | 205 +++++++++++ .../pagopa/methods/resp/nodoAttivaRPTTest.php | 268 +++++++++++++++ src/tests/phpunit.xml | 8 +- ...T00045_nodoAttivaRPT_PreviousAttivaRPT.php | 124 +++++++ ...oAttivaRPT_PreviousAttivaRPT_FaultCode.php | 84 +++++ ...oTransferWithSessionIdOriginalNotFound.php | 2 +- 20 files changed, 2406 insertions(+), 6 deletions(-) create mode 100644 src/src/crawler/events/req/nodoAttivaRPT.php create mode 100644 src/src/crawler/events/resp/nodoAttivaRPT.php create mode 100644 src/src/crawler/methods/req/nodoAttivaRPT.php create mode 100644 src/src/crawler/methods/resp/nodoAttivaRPT.php create mode 100644 src/src/crawler/paymentlist/req/nodoAttivaRPT.php create mode 100644 src/src/crawler/paymentlist/resp/nodoAttivaRPT.php create mode 100644 src/tests/pagopa/events/req/nodoAttivaRPTTest.php create mode 100644 src/tests/pagopa/events/resp/nodoAttivaRPTTest.php create mode 100644 src/tests/pagopa/methods/req/nodoAttivaRPTTest.php create mode 100644 src/tests/pagopa/methods/resp/nodoAttivaRPTTest.php create mode 100644 src/tests/process/crawler/nodoAttivaRPT/T00045_nodoAttivaRPT_PreviousAttivaRPT.php create mode 100644 src/tests/process/crawler/nodoAttivaRPT/T00046_nodoAttivaRPT_PreviousAttivaRPT_FaultCode.php diff --git a/src/mock_crawler.php b/src/mock_crawler.php index a7dd6ff2..a0c98f7f 100644 --- a/src/mock_crawler.php +++ b/src/mock_crawler.php @@ -85,6 +85,13 @@ $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(); diff --git a/src/mock_insert.php b/src/mock_insert.php index 3e1d57ea..84830fd0 100644 --- a/src/mock_insert.php +++ b/src/mock_insert.php @@ -2143,3 +2143,202 @@ Capsule::statement($render_query, $data_resp); + + + + + + + + + + + + + + +$data_req = [ + ':id' => 90, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 12:45:00.197', + ':tipoevento' => 'nodoAttivaRPT', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000090', + ':ccp' => 'c0000000000000000000000000000090', + ':noticenumber' => '', + ':creditorreferenceid' => '', + ':paymenttoken' => '', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000090', + ':sessionidoriginal' => 'session_id_original_000090', + ':uniqueid' => 'T000090', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTg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ODg4ODg4ODg4PC9pZGVudGlmaWNhdGl2b0ludGVybWVkaWFyaW9QU1BQYWdhbWVudG8+CgkJCTxpZGVudGlmaWNhdGl2b0NhbmFsZVBhZ2FtZW50bz44ODg4ODg4ODg4OF8wMTwvaWRlbnRpZmljYXRpdm9DYW5hbGVQYWdhbWVudG8+CgkJCTxjb2RpZmljYUluZnJhc3RydXR0dXJhUFNQPlFSLUNPREU8L2NvZGlmaWNhSW5mcmFzdHJ1dHR1cmFQU1A+CgkJCTxjb2RpY2VJZFJQVD4KCQkJCTxxcmM6UXJDb2RlPgoJCQkJCTxxcmM6Q0Y+Nzc3Nzc3Nzc3Nzc8L3FyYzpDRj4KCQkJCQk8cXJjOkF1eERpZ2l0PjM8L3FyYzpBdXhEaWdpdD4KCQkJCQk8cXJjOkNvZElVVj4wMTAwMDAwMDAwMDAwMDA5MDwvcXJjOkNvZElVVj4KCQkJCTwvcXJjOlFyQ29kZT4KCQkJPC9jb2RpY2VJZFJQVD4KCQkJPGRhdGlQYWdhbWVudG9QU1A+CgkJCQk8aW1wb3J0b1NpbmdvbG9WZXJzYW1lbnRvPjMzLjEwPC9pbXBvcnRvU2luZ29sb1ZlcnNhbWVudG8+CgkJCTwvZGF0aVBhZ2FtZW50b1BTUD4KCQk8L3BwdDpub2RvQXR0aXZhUlBUPgoJPC9zb2FwOkJvZHk+Cjwvc29hcDpFbnZlbG9wZT4=', +]; + +$data_resp = [ + ':id' => 91, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 12:46:01.197', + ':tipoevento' => 'nodoAttivaRPT', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000090', + ':ccp' => 'c0000000000000000000000000000090', + ':noticenumber' => '01000000000000090', + ':creditorreferenceid' => '', + ':paymenttoken' => '', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000090', + ':sessionidoriginal' => 'session_id_original_000090', + ':uniq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MDAwMDAwMDAwMTwvaWJhbkFjY3JlZGl0bz4KCQkJCQk8ZW50ZUJlbmVmaWNpYXJpbz4KCQkJCQkJPHBheV9pOmlkZW50aWZpY2F0aXZvVW5pdm9jb0JlbmVmaWNpYXJpbz4KCQkJCQkJCTxwYXlfaTp0aXBvSWRlbnRpZmljYXRpdm9Vbml2b2NvPkc8L3BheV9pOnRpcG9JZGVudGlmaWNhdGl2b1VuaXZvY28+CgkJCQkJCQk8cGF5X2k6Y29kaWNlSWRlbnRpZmljYXRpdm9Vbml2b2NvPjc3Nzc3Nzc3Nzc3PC9wYXlfaTpjb2RpY2VJZGVudGlmaWNhdGl2b1VuaXZvY28+CgkJCQkJCTwvcGF5X2k6aWRlbnRpZmljYXRpdm9Vbml2b2NvQmVuZWZpY2lhcmlvPgoJCQkJCQk8cGF5X2k6ZGVub21pbmF6aW9uZUJlbmVmaWNpYXJpbz54eHh4eHg8L3BheV9pOmRlbm9taW5hemlvbmVCZW5lZmljaWFyaW8+CgkJCQkJPC9lbnRlQmVuZWZpY2lhcmlvPgoJCQkJCTxjYXVzYWxlVmVyc2FtZW50bz54eHh4eHg8L2NhdXNhbGVWZXJzYW1lbnRvPgoJCQkJPC9kYXRpUGFnYW1lbnRvUEE+CgkJCTwvbm9kb0F0dGl2YVJQVFJpc3Bvc3RhPgoJCTwvcHB0Om5vZG9BdHRpdmFSUFRSaXNwb3N0YT4KCTwvc29hcGVudjpCb2R5Pgo8L3NvYXBlbnY6RW52ZWxvcGU+', +]; + +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + +$data_req = [ + ':id' => 92, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 12:47:00.197', + ':tipoevento' => 'nodoInviaRPT', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000090', + ':ccp' => 'c0000000000000000000000000000090', + ':noticenumber' => '', + ':creditorreferenceid' => '', + ':paymenttoken' => '', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000091', + ':sessionidoriginal' => 'session_id_original_000090', + ':uniqueid' => 'T000092', + ':payload' => 'PHNvYXA6RW52ZWxvcGUgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iPgoJPHNvYXA6SGVhZGVyPgoJCTxuczQ6aW50ZXN0YXppb25lUFBUIFNPQVAtRU5WOmFjdG9yPSJodHRwOi8vcGRkNGoub3JnL3BvcnRhZG9taW5pbyIgU09BUC1FTlY6bXVzdFVuZGVyc3RhbmQ9IjEiIHhtbG5zPSIiIHhtbG5zOlNPQVAtRU5WPSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VudmVsb3BlLyIgeG1sbnM6bnMzPSJodHRwOi8vd3d3LmRpZ2l0cGEuZ292Lml0L3NjaGVtYXMvMjAxMS9QYWdhbWVudGkvIiB4bWxuczpuczQ9Imh0dHA6Ly93cy5wYWdhbWVudGkudGVsZW1hdGljaS5nb3YvcHB0aGVhZCIgeG1sbnM6bnM1PSJodHRwOi8vd3MucGFnYW1lbnRpLnRlbGVtYXRpY2kuZ292LyI+CgkJCTxpZGVudGlmaWNhdGl2b0ludGVybWVkaWFyaW9QQT43Nzc3Nzc3Nzc3NzwvaWRlbnRpZmljYXRpdm9JbnRlcm1lZGlhcmlvUEE+CgkJCTxpZGVudGlmaWNhdGl2b1N0YXppb25lSW50ZXJtZWRpYXJpb1BBPjc3Nzc3Nzc3Nzc3XzAxPC9pZGVudGlmaWNhdGl2b1N0YXppb25lSW50ZXJtZWRpYXJpb1BBPgoJCQk8aWRlbnRpZmljYXRpdm9Eb21pbmlvPjc3Nzc3Nzc3Nzc3PC9pZGVudGlmaWNhdGl2b0RvbWluaW8+CgkJCTxpZGVudGlmaWNhdGl2b1VuaXZvY29WZXJzYW1lbnRvPjAxMDAwMDAwMDAwMDAwMDkwPC9pZGVudGl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ScFUzQmxZMmxtYVdOcFVtbHpZMjl6YzJsdmJtVStDaUFnSUNBZ0lDQWdQQzlrWVhScFUybHVaMjlzYjFabGNuTmhiV1Z1ZEc4K0NpQWdJQ0E4TDJSaGRHbFdaWEp6WVcxbGJuUnZQZ284TDFKUVZENEs8L3JwdD4KCQk8L25zNTpub2RvSW52aWFSUFQ+Cgk8L3NvYXA6Qm9keT4KPC9zb2FwOkVudmVsb3BlPg==', +]; + +$data_resp = [ + ':id' => 93, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 12:48:01.197', + ':tipoevento' => 'nodoInviaRPT', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000090', + ':ccp' => 'c0000000000000000000000000000090', + ':noticenumber' => '', + ':creditorreferenceid' => '', + ':paymenttoken' => '', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000091', + ':sessionidoriginal' => 'session_id_original_000090', + ':uniqueid' => 'T000093', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpwcHQ9Imh0dHA6Ly93cy5wYWdhbWVudGkudGVsZW1hdGljaS5nb3YvIiB4bWxuczpwcHRoZWFkPSJodHRwOi8vd3MucGFnYW1lbnRpLnRlbGVtYXRpY2kuZ292L3BwdGhlYWQiIHhtbG5zOnNvYXBlbnY9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIiB4bWxuczp0bnM9Imh0dHA6Ly9Ob2RvUGFnYW1lbnRpU1BDLnNwY29vcC5nb3YuaXQvc2Vydml6aS9QYWdhbWVudGlUZWxlbWF0aWNpUlBUIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIj4KCTxzb2FwZW52OkJvZHk+CgkJPHBwdDpub2RvSW52aWFSUFRSaXNwb3N0YT4KCQkJPGVzaXRvPk9LPC9lc2l0bz4KCQkJPHJlZGlyZWN0PjE8L3JlZGlyZWN0PgoJCQk8dXJsPmh0dHBzOi8vd2lzcDIucGFnb3BhLmdvdi5pdC93YWxsZXQvd2VsY29tZT9pZFNlc3Npb249eHh4eHh4PC91cmw+CgkJPC9wcHQ6bm9kb0ludmlhUlBUUmlzcG9zdGE+Cgk8L3NvYXBlbnY6Qm9keT4KPC9zb2FwZW52OkVudmVsb3BlPg==', +]; + +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + +$data_req = [ + ':id' => 94, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 12:49:00.197', + ':tipoevento' => 'nodoInviaRPT', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000090', + ':ccp' => 'c0000000000000000000000000000090', + ':noticenumber' => '', + ':creditorreferenceid' => '', + ':paymenttoken' => '', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000092', + ':sessionidoriginal' => 'session_id_original_000090', + ':uniqueid' => 'T000094', + ':payload' => 'PHNvYXA6RW52ZWxvcGUgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iPgoJPHNvYXA6SGVhZGVyPgoJCTxuczQ6aW50ZXN0YXppb25lUFBUIFNPQVAtRU5WOmFjdG9yPSJodHRwOi8vcGRkNGoub3JnL3BvcnRhZG9taW5pbyIgU09BUC1FTlY6bXVzdFVuZGVyc3RhbmQ9IjEiIHhtbG5zPSIiIHhtbG5zOlNPQVAtRU5WPSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VudmVsb3BlLyIgeG1sbnM6bnMzPSJodHRwOi8vd3d3LmRpZ2l0cGEuZ292L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lEeG1hWEp0WVZKcFkyVjJkWFJoUGpBOEwyWnBjbTFoVW1salpYWjFkR0UrQ2lBZ0lDQWdJQ0FnUEdSaGRHbFRhVzVuYjJ4dlZtVnljMkZ0Wlc1MGJ6NEtJQ0FnSUNBZ0lDQWdJQ0FnUEdsdGNHOXlkRzlUYVc1bmIyeHZWbVZ5YzJGdFpXNTBiejR6TXk0eE1Ed3ZhVzF3YjNKMGIxTnBibWR2Ykc5V1pYSnpZVzFsYm5SdlBnb2dJQ0FnSUNBZ0lDQWdJQ0E4YVdKaGJrRmpZM0psWkdsMGJ6NUpWREF3TURBd01EQXdNREF3TURBd01EQXdNREF3TURBd01ERThMMmxpWVc1QlkyTnlaV1JwZEc4K0NpQWdJQ0FnSUNBZ0lDQWdJRHhqWVhWellXeGxWbVZ5YzJGdFpXNTBiejU0ZUhoNGVIZzhMMk5oZFhOaGJHVldaWEp6WVcxbGJuUnZQZ29nSUNBZ0lDQWdJQ0FnSUNBOFpHRjBhVk53WldOcFptbGphVkpwYzJOdmMzTnBiMjVsUG5oNGVIaDRQQzlrWVhScFUzQmxZMmxtYVdOcFVtbHpZMjl6YzJsdmJtVStDaUFnSUNBZ0lDQWdQQzlrWVhScFUybHVaMjlzYjFabGNuTmhiV1Z1ZEc4K0NpQWdJQ0E4TDJSaGRHbFdaWEp6WVcxbGJuUnZQZ284TDFKUVZENEs8L3JwdD4KCQk8L25zNTpub2RvSW52aWFSUFQ+Cgk8L3NvYXA6Qm9keT4KPC9zb2FwOkVudmVsb3BlPg==', +]; + +$data_resp = [ + ':id' => 95, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 12:50:01.197', + ':tipoevento' => 'nodoInviaRPT', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000090', + ':ccp' => 'c0000000000000000000000000000090', + ':noticenumber' => '', + ':creditorreferenceid' => '', + ':paymenttoken' => '', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000092', + ':sessionidoriginal' => 'session_id_original_000090', + ':uniqueid' => 'T000095', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpwcHQ9Imh0dHA6Ly93cy5wYWdhbWVudGkudGVsZW1hdGljaS5nb3YvIiB4bWxuczpwcHRoZWFkPSJodHRwOi8vd3MucGFnYW1lbnRpLnRlbGVtYXRpY2kuZ292L3BwdGhlYWQiIHhtbG5zOnNvYXBlbnY9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIiB4bWxuczp0bnM9Imh0dHA6Ly9Ob2RvUGFnYW1lbnRpU1BDLnNwY29vcC5nb3YuaXQvc2Vydml6aS9QYWdhbWVudGlUZWxlbWF0aWNpUlBUIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIj4KCTxzb2FwZW52OkJvZHk+CgkJPHBwdDpub2RvSW52aWFSUFRSaXNwb3N0YT4KCQkJPGVzaXRvPk9LPC9lc2l0bz4KCQkJPHJlZGlyZWN0PjE8L3JlZGlyZWN0PgoJCQk8dXJsPmh0dHBzOi8vd2lzcDIucGFnb3BhLmdvdi5pdC93YWxsZXQvd2VsY29tZT9pZFNlc3Npb249eHh4eHh4PC91cmw+CgkJPC9wcHQ6bm9kb0ludmlhUlBUUmlzcG9zdGE+Cgk8L3NvYXBlbnY6Qm9keT4KPC9zb2FwZW52OkVudmVsb3BlPg==', +]; + +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + + + + +$data_req = [ + ':id' => 96, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 12:51:00.197', + ':tipoevento' => 'nodoAttivaRPT', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000091', + ':ccp' => 'c0000000000000000000000000000091', + ':noticenumber' => '', + ':creditorreferenceid' => '', + ':paymenttoken' => '', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000093', + ':sessionidoriginal' => 'session_id_original_000091', + ':uniqueid' => 'T000096', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHNvYXA6RW52ZWxvcGUgeG1sbnM6cGF5X2k9Imh0dHA6Ly93d3cuZGlnaXRwYS5nb3YuaXQvc2NoZW1hcy8yMDExL1BhZ2FtZW50aS8iIHhtbG5zOnBwdD0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi8iIHhtbG5zOnFyYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L1FyQ29kZSIgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOnRucz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L3NlcnZpemkvUGFnYW1lbnRpVGVsZW1hdGljaVBzcE5vZG8iIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiPgoJPHNvYXA6Qm9keT4KCQk8cHB0Om5vZG9BdHRpdmFSUFQgeG1sbnM6cHB0PSJodHRwOi8vd3MucGFnYW1lbnRpLnRlbGVtYXRpY2kuZ292LyI+CgkJCTxpZGVudGlmaWNhdGl2b1BTUD5BR0lEXzAxPC9pZGVudGlmaWNhdGl2b1BTUD4KCQkJPGlkZW50aWZpY2F0aXZvSW50ZXJtZWRpYXJpb1BTUD44ODg4ODg4ODg4ODwvaWRlbnRpZmljYXRpdm9JbnRlcm1lZGlhcmlvUFNQPgoJCQk8aWRlbnRpZmljYXRp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197', + ':tipoevento' => 'nodoAttivaRPT', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000091', + ':ccp' => 'c0000000000000000000000000000091', + ':noticenumber' => '', + ':creditorreferenceid' => '', + ':paymenttoken' => '', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000093', + ':sessionidoriginal' => 'session_id_original_000091', + ':uniqueid' => 'T000097', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpiYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L0JhckNvZGVfR1MxXzEyOF9Nb2RpZmllZCIgeG1sbnM6cGF5X2k9Imh0dHA6Ly93d3cuZGlnaXRwYS5nb3YuaXQvc2NoZW1hcy8yMDExL1BhZ2FtZW50aS8iIHhtbG5zOnBwdD0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi8iIHhtbG5zOnFyYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L1FyQ29kZSIgeG1sbnM6c29hcGVudj0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOnRucz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L3NlcnZpemkvUGFnYW1lbnRpVGVsZW1hdGljaVBzcE5vZG8iIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSI+Cgk8c29hcGVudjpCb2R5PgoJCTxwcHQ6bm9kb0F0dGl2YVJQVFJpc3Bvc3RhPgoJCQk8bm9kb0F0dGl2YVJQVFJpc3Bvc3RhPgoJCQkJPGZhdWx0PgoJCQkJCTxmYXVsdENvZGU+UFBUX01VTFRJX0JFTkVGSUNJQVJJTzwvZmF1bHRDb2RlPgoJCQkJCTxmYXVsdFN0cmluZz5MYSBjaGlhbWF0YSBub24gw6ggY29tcGF0aWJpbGUgY29uIGlsIG51b3ZvIG1vZGVsbG8gUFNQLjwvZmF1bHRTdHJpbmc+CgkJCQkJPGlkPk5vZG9EZWlQYWdhbWVudGlTUEM8L2lkPgoJCQkJCTxkZXNjcmlwdGlvbj5MYSBjaGlhbWF0YSBub24gw6ggY29tcGF0aWJpbGUgY29uIGlsIG51b3ZvIG1vZGVsbG8gUFNQLjwvZGVzY3JpcHRpb24+CgkJCQk8L2ZhdWx0PgoJCQkJPGVzaXRvPktPPC9lc2l0bz4KCQkJPC9ub2RvQXR0aXZhUlBUUmlzcG9zdGE+CgkJPC9wcHQ6bm9kb0F0dGl2YVJQVFJpc3Bvc3RhPgoJPC9zb2FwZW52OkJvZHk+Cjwvc29hcGVudjpFbnZlbG9wZT4=', +]; + +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); \ No newline at end of file diff --git a/src/sql/05_2024_insert_data.sql b/src/sql/05_2024_insert_data.sql index 6be9f5e5..5d71a73d 100644 --- a/src/sql/05_2024_insert_data.sql +++ b/src/sql/05_2024_insert_data.sql @@ -11,6 +11,8 @@ INSERT INTO mapped_events(tipo_evento,sotto_tipo_evento ,fk_event) values ('pspInviaCarrelloRPTCarte' , 'RESP', 10); ('nodoInviaRPT' , 'REQ' , 11); ('nodoInviaRPT' , 'RESP', 12); + ('nodoAttivaRPT' , 'REQ' , 13); + ('nodoAttivaRPT' , 'RESP', 14); insert into mapped_payment_methods (tipoversamento, descrizione) values ('CC', 'Carta di Credito'), diff --git a/src/src/crawler/events/req/nodoAttivaRPT.php b/src/src/crawler/events/req/nodoAttivaRPT.php new file mode 100644 index 00000000..c4e00f92 --- /dev/null +++ b/src/src/crawler/events/req/nodoAttivaRPT.php @@ -0,0 +1,213 @@ +method = new Payload($this->data['payload']); + } + /** + * @inheritDoc + */ + public function getIuvs(): array|null + { + $value = $this->getIuv(); + return (is_null($value)) ? $this->getMethodInterface()->getIuvs() : array($value); + } + + /** + * @inheritDoc + */ + public function getPaEmittenti(): array|null + { + $value = $this->getPaEmittente(); + return (is_null($value)) ? $this->getMethodInterface()->getPaEmittenti() : array($value); + } + + /** + * @inheritDoc + */ + public function getCcps(): array|null + { + $value = $this->getCcp(); + return (is_null($value)) ? $this->getMethodInterface()->getCcps() : array($value); + } + + /** + * @inheritDoc + */ + public function transaction(int $index = 0): Transaction|null + { + $iuv = $this->getIuv($index); + $pa_emittente = $this->getPaEmittente($index); + $token = $this->getPaymentToken($index); + $date_event = $this->getInsertedTimestamp()->format('Y-m-d'); + + $notice_id = $this->getNoticeNumber($index); + + + + $psp_id = $this->getPsp(); + $canale = $this->getCanale(); + $stazione = $this->getStazione(); + + $importo = $this->getMethodInterface()->getImporto(0); + + $transaction = new Transaction($this->getInsertedTimestamp()); + $transaction->setIuv($iuv); + $transaction->setPaEmittente($pa_emittente); + $transaction->setTokenCcp($token); + $transaction->setInsertedTimestamp($this->getInsertedTimestamp()); + $transaction->setNewColumnValue('date_event', $date_event); + $transaction->setTouchPoint('TOUCHPOINT_EC_OLD'); + + if (!is_null($notice_id)) + { + $transaction->setNoticeId($notice_id); + } + + if (!is_null($psp_id)) + { + $transaction->setPsp($psp_id); + } + + if (!is_null($canale)) + { + $transaction->setCanale($canale); + } + + if (!is_null($stazione)) + { + $transaction->setStazione($stazione); + } + + return $transaction; + } + + 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(): string + { + $iuv = $this->getIuv(0); + $pa_emittente = $this->getPaEmittente(0); + + return base64_encode(sprintf('payment_%s_%s', $iuv, $pa_emittente)); + } + + /** + * @inheritDoc + */ + public function getCacheKeyAttempt(): string + { + $iuv = $this->getIuv(0); + $pa_emittente = $this->getPaEmittente(0); + $token = $this->getCcp(0); + + return base64_encode(sprintf('attempt_%s_%s_%s', $iuv, $pa_emittente, $token)); + } + + /** + * @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/nodoAttivaRPT.php b/src/src/crawler/events/resp/nodoAttivaRPT.php new file mode 100644 index 00000000..05871491 --- /dev/null +++ b/src/src/crawler/events/resp/nodoAttivaRPT.php @@ -0,0 +1,180 @@ +method = new Payload($this->data['payload']); + } + + /** + * @inheritDoc + */ + public function getIuvs(): array|null + { + $value = $this->getIuv(); + return (is_null($value)) ? $this->getMethodInterface()->getIuvs() : array($value); + } + + /** + * @inheritDoc + */ + public function getPaEmittenti(): array|null + { + $value = $this->getPaEmittente(); + return (is_null($value)) ? $this->getMethodInterface()->getPaEmittenti() : array($value); + } + + /** + * @inheritDoc + */ + public function getCcps(): array|null + { + $value = $this->getCcp(); + return (is_null($value)) ? $this->getMethodInterface()->getCcps() : 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->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 1; + } + + /** + * @inheritDoc + */ + public function getCacheKeyPayment(): string + { + $iuv = $this->getIuv(0); + $pa_emittente = $this->getPaEmittente(0); + + return base64_encode(sprintf('payment_%s_%s', $iuv, $pa_emittente)); + } + + /** + * @inheritDoc + */ + public function getCacheKeyAttempt(): string + { + $iuv = $this->getIuv(0); + $pa_emittente = $this->getPaEmittente(0); + $token = $this->getCcp(0); + + return base64_encode(sprintf('attempt_%s_%s_%s', $iuv, $pa_emittente, $token)); + } + + /** + * @inheritDoc + */ + public function isFaultEvent(): bool + { + return $this->getMethodInterface()->isFaultEvent(); + } + + /** + * @inheritDoc + */ + public function getFaultCode(): string|null + { + return $this->getMethodInterface()->getFaultCode(); + } + + /** + * @inheritDoc + */ + public function getFaultString(): string|null + { + return $this->getMethodInterface()->getFaultString(); + } + + /** + * @inheritDoc + */ + public function getFaultDescription(): string|null + { + return $this->getMethodInterface()->getFaultDescription(); + } +} \ No newline at end of file diff --git a/src/src/crawler/events/resp/nodoInviaRPT.php b/src/src/crawler/events/resp/nodoInviaRPT.php index 2f878d62..f646c58d 100644 --- a/src/src/crawler/events/resp/nodoInviaRPT.php +++ b/src/src/crawler/events/resp/nodoInviaRPT.php @@ -4,7 +4,6 @@ use pagopa\crawler\AbstractEvent; use pagopa\crawler\MapEvents; -use pagopa\crawler\methods\MethodInterface; use pagopa\database\sherlock\Transaction; use pagopa\database\sherlock\TransactionDetails; use pagopa\database\sherlock\Workflow; diff --git a/src/src/crawler/methods/req/nodoAttivaRPT.php b/src/src/crawler/methods/req/nodoAttivaRPT.php new file mode 100644 index 00000000..14b0058f --- /dev/null +++ b/src/src/crawler/methods/req/nodoAttivaRPT.php @@ -0,0 +1,296 @@ +payload = $payload; + } + + + private function getElementFromPayload(string $element) : string|null + { + $xml = new XMLReader(); + $xml->XML($this->payload); + while($xml->read()) + { + if (($xml->nodeType == XMLReader::ELEMENT) && (strtolower($xml->localName) == strtolower($element))) + { + return $xml->readString(); + } + } + return null; + } + + /** + * @inheritDoc + */ + public function getPaymentsCount(): int|null + { + return null; + } + + /** + * @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 getAllTokens(): array|null + { + return $this->getCcps(); + } + + /** + * @inheritDoc + */ + public function getAllNoticesNumbers(): array|null + { + $value = $this->getNoticeNumber(); + return (is_null($value)) ? null : array($value); + } + + /** + * @inheritDoc + */ + public function getIuv(int $index = 0): string|null + { + return $this->getElementFromPayload('CodIUV'); + } + + /** + * @inheritDoc + */ + public function getPaEmittente(int $index = 0): string|null + { + return $this->getElementFromPayload('CF'); + } + + /** + * @inheritDoc + */ + public function getCcp(int $index = 0): string|null + { + return $this->getElementFromPayload('codiceContestoPagamento'); + } + + /** + * @inheritDoc + */ + public function getToken(int $index = 0): string|null + { + return $this->getCcp(); + } + + /** + * @inheritDoc + */ + public function getNoticeNumber(int $index = 0): string|null + { + $auxdigit = $this->getElementFromPayload('AuxDigit'); + $iuv = $this->getElementFromPayload('CodIUV'); + if ((!is_null($auxdigit)) && (!is_null($iuv))) + { + return sprintf('%s%s', $auxdigit, $iuv); + } + return null; + } + + /** + * @inheritDoc + */ + public function getImportoTotale(): string|null + { + return $this->getElementFromPayload('importoSingoloVersamento'); + } + + /** + * @inheritDoc + */ + public function getImporto(int $index = 0): string|null + { + return $this->getElementFromPayload('importoSingoloVersamento'); + } + + /** + * @inheritDoc + */ + public function getTransferAmount(int $transfer = 0, int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferPa(int $transfer = 0, int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferIban(int $transfer = 0, int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferId(int $transfer = 0, int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferCount(int $index = 0): int|null + { + return null; + } + + /** + * @inheritDoc + */ + public function isBollo(int $transfer = 0, int $index = 0): bool + { + return false; + } + + /** + * @inheritDoc + */ + public function getPsp(): string|null + { + return $this->getElementFromPayload('identificativoPSP'); + } + + /** + * @inheritDoc + */ + public function getBrokerPsp(): string|null + { + return $this->getElementFromPayload('identificativoIntermediarioPSP'); + } + + /** + * @inheritDoc + */ + public function getCanale(): string|null + { + return $this->getElementFromPayload('identificativoCanale'); + } + + /** + * @inheritDoc + */ + public function getBrokerPa(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getStazione(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function outcome(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getPaymentMetaDataCount(int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getPaymentMetaDataKey(int $index = 0, int $metaKey = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getPaymentMetaDataValue(int $index = 0, int $metaKey = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferMetaDataCount(int $transfer = 0, int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferMetaDataKey(int $transfer = 0, int $index = 0, int $metaKey = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferMetaDataValue(int $transfer = 0, int $index = 0, int $metaKey = 0): string|null + { + return null; + } +} \ No newline at end of file diff --git a/src/src/crawler/methods/resp/nodoAttivaRPT.php b/src/src/crawler/methods/resp/nodoAttivaRPT.php new file mode 100644 index 00000000..62fc81d5 --- /dev/null +++ b/src/src/crawler/methods/resp/nodoAttivaRPT.php @@ -0,0 +1,319 @@ +payload = $payload; + } + + private function getElementFromPayload(string $element) : string|null + { + $xml = new XMLReader(); + $xml->XML($this->payload); + while($xml->read()) + { + if (($xml->nodeType == XMLReader::ELEMENT) && (strtolower($xml->localName) == strtolower($element))) + { + return $xml->readString(); + } + } + return null; + } + + /** + * @inheritDoc + */ + public function getPaymentsCount(): int|null + { + return 1; + } + + /** + * @inheritDoc + */ + public function getIuvs(): array|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getPaEmittenti(): array|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getCcps(): array|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getAllTokens(): array|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getAllNoticesNumbers(): array|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getIuv(int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getPaEmittente(int $index = 0): string|null + { + // potrei restituire codiceIdentificativoUnivoco, ma servirebbe a poco + return null; + } + + /** + * @inheritDoc + */ + public function getCcp(int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getToken(int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getNoticeNumber(int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getImportoTotale(): string|null + { + return $this->getElementFromPayload('importoSingoloVersamento'); + } + + /** + * @inheritDoc + */ + public function getImporto(int $index = 0): string|null + { + return $this->getElementFromPayload('importoSingoloVersamento'); + } + + /** + * @inheritDoc + */ + public function getTransferAmount(int $transfer = 0, int $index = 0): string|null + { + // inutile prendere l'importo totale, i versamenti di una attivaRPT li prendo dalla RPT + return null; + } + + /** + * @inheritDoc + */ + public function getTransferPa(int $transfer = 0, int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferIban(int $transfer = 0, int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferId(int $transfer = 0, int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferCount(int $index = 0): int|null + { + return null; + } + + /** + * @inheritDoc + */ + public function isBollo(int $transfer = 0, int $index = 0): bool + { + return false; + } + + /** + * @inheritDoc + */ + public function getPsp(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getBrokerPsp(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getCanale(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getBrokerPa(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getStazione(): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function outcome(): string|null + { + return $this->getElementFromPayload('esito'); + } + + /** + * @inheritDoc + */ + public function getPaymentMetaDataCount(int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getPaymentMetaDataKey(int $index = 0, int $metaKey = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getPaymentMetaDataValue(int $index = 0, int $metaKey = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferMetaDataCount(int $transfer = 0, int $index = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferMetaDataKey(int $transfer = 0, int $index = 0, int $metaKey = 0): string|null + { + return null; + } + + /** + * @inheritDoc + */ + public function getTransferMetaDataValue(int $transfer = 0, int $index = 0, int $metaKey = 0): string|null + { + return null; + } + + /** + * @return bool + */ + public function isFaultEvent(): bool + { + return $this->getElementFromPayload('esito') == 'KO'; + } + + /** + * @return string|null + */ + public function getFaultCode(): string|null + { + return $this->getElementFromPayload('faultCode'); + } + + /** + * @return string|null + */ + public function getFaultString(): string|null + { + return $this->getElementFromPayload('faultString'); + } + + /** + * @return string|null + */ + public function getFaultDescription(): string|null + { + return $this->getElementFromPayload('description'); + } +} \ No newline at end of file diff --git a/src/src/crawler/paymentlist/AbstractPaymentList.php b/src/src/crawler/paymentlist/AbstractPaymentList.php index 13a7f102..107e2ccc 100644 --- a/src/src/crawler/paymentlist/AbstractPaymentList.php +++ b/src/src/crawler/paymentlist/AbstractPaymentList.php @@ -353,7 +353,7 @@ public function runAnalysisSingleEvent() : void { // se non è in cache e non riguarda un tentativo, c'è un problema $state = 'TO_SEARCH'; - $message = 'Evento non associabile a nessun pagamento in cache, va ricercato'; + $message = 'Evento non associabile a nessun tentativo in cache, va ricercato'; } } } diff --git a/src/src/crawler/paymentlist/req/nodoAttivaRPT.php b/src/src/crawler/paymentlist/req/nodoAttivaRPT.php new file mode 100644 index 00000000..9586e1c2 --- /dev/null +++ b/src/src/crawler/paymentlist/req/nodoAttivaRPT.php @@ -0,0 +1,58 @@ +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)); + } + + public function createTransaction(int $index = 0) : array|null + { + $date_event = $this->getEvent()->getInsertedTimestamp()->format('Y-m-d'); + $token = $this->getEvent()->getCcp($index); + + $transaction = $this->getEvent()->transaction($index); + $transaction->setTokenCcp($token); + $transaction->insert(); + DB::statement($transaction->getQuery(), $transaction->getBindParams()); + $last_inserted_id = DB::connection()->getPdo()->lastInsertId(); + + $cache_value = CacheObject::createInstance(); + $cache_value->setDateEvent($date_event); + $cache_value->setId($last_inserted_id); + $cache_value->setIuv($this->getEvent()->getIuv(0)); + $cache_value->setPaEmittente($this->getEvent()->getPaEmittente(0)); + $cache_value->setToken($token); + + return $cache_value->getCacheData(); + } +} \ No newline at end of file diff --git a/src/src/crawler/paymentlist/req/nodoInviaRPT.php b/src/src/crawler/paymentlist/req/nodoInviaRPT.php index bed40136..281d0914 100644 --- a/src/src/crawler/paymentlist/req/nodoInviaRPT.php +++ b/src/src/crawler/paymentlist/req/nodoInviaRPT.php @@ -5,6 +5,7 @@ use Illuminate\Database\Capsule\Manager as DB; use pagopa\crawler\CacheObject; use pagopa\crawler\paymentlist\AbstractPaymentList; +use pagopa\database\sherlock\Transaction; use pagopa\database\sherlock\TransactionRe; class nodoInviaRPT extends AbstractPaymentList @@ -124,14 +125,16 @@ public function detailsTransaction(CacheObject $cache, int $index = 0): array|nu 'pa_transfer' => $this->getEvent()->getMethodInterface()->getTransferPa($i, $index), 'bollo' => true, 'amount_transfer' => $this->getEvent()->getMethodInterface()->getTransferAmount($i, $index), - 'iban_transfer' => '' + 'iban_transfer' => '', + 'id' => $last_inserted_transfer_id ]; } else { $transfer_add[] = [ 'pa_transfer' => $this->getEvent()->getMethodInterface()->getTransferPa($i, $index), 'bollo' => false, 'amount_transfer' => $this->getEvent()->getMethodInterface()->getTransferAmount($i, $index), - 'iban_transfer' => $this->getEvent()->getMethodInterface()->getTransferIban($i, $index) + 'iban_transfer' => $this->getEvent()->getMethodInterface()->getTransferIban($i, $index), + 'id' => $last_inserted_transfer_id ]; } } @@ -141,4 +144,22 @@ public function detailsTransaction(CacheObject $cache, int $index = 0): array|nu return $cache->getCacheData(); } + + + public function updateTransaction(CacheObject $cache, int $index = 0): array|null + { + if ($cache->getAmountUpdate()) + { + return $cache->getCacheData(); + } + + $id = $cache->getId(); + $date_event = $cache->getDateEvent(); + $transaction = Transaction::getTransactionByIdAndDateEvent($id, $date_event); + $transaction->setImporto($this->getEvent()->getMethodInterface()->getImporto()); + $transaction->update(); + DB::statement($transaction->getQuery(), $transaction->getBindParams()); + $cache->setAmountUpdate(true); + return $cache->getCacheData(); + } } \ No newline at end of file diff --git a/src/src/crawler/paymentlist/resp/nodoAttivaRPT.php b/src/src/crawler/paymentlist/resp/nodoAttivaRPT.php new file mode 100644 index 00000000..d42af0bd --- /dev/null +++ b/src/src/crawler/paymentlist/resp/nodoAttivaRPT.php @@ -0,0 +1,54 @@ +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()->getCcp(0)); + } + + public function updateTransaction(CacheObject $cache, int $index = 0): array|null + { + if (($cache->getAmountUpdate()) || ($this->getEvent()->isFaultEvent())) + { + return $cache->getCacheData(); + } + $id = $cache->getId(); + $date_event = $cache->getDateEvent(); + $transaction = Transaction::getTransactionByIdAndDateEvent($id, $date_event); + $transaction->setImporto($this->getEvent()->getMethodInterface()->getImporto()); + $transaction->update(); + DB::statement($transaction->getQuery(), $transaction->getBindParams()); + $cache->setAmountUpdate(true); + return parent::updateTransaction($cache, $index); + } + +} \ No newline at end of file diff --git a/src/tests/pagopa/events/req/nodoAttivaRPTTest.php b/src/tests/pagopa/events/req/nodoAttivaRPTTest.php new file mode 100644 index 00000000..e4794784 --- /dev/null +++ b/src/tests/pagopa/events/req/nodoAttivaRPTTest.php @@ -0,0 +1,194 @@ +data_instance = new nodoAttivaRPT([ + 'date_event' => '2023-09-01', + 'inserted_timestamp' => '2023-09-01 07:37:50', + 'tipoevento' => 'nodoAttivaRPT', + 'sottotipoevento' => 'REQ', + 'psp' => 'AGID_01', + 'stazione' => '77777777777_01', + 'canale' => '88888888888_01', + 'sessionid' => '6c9ce650-3542-4a10-b8bb-9c3331d2ebef', + 'sessionidoriginal' => '6c9ce650-3542-4a10-b8bb-9c3331d2ebef', + 'uniqueid' => 'event_ok', + 'iddominio' => '77777777777', + 'iuv' => '01000000000000010', + 'ccp' => 'c0000000000000000000000000000010', + 'noticeNumber' => '301000000000000010', + 'creditorreferenceid' => '01000000000000010', + 'paymenttoken' => 'c0000000000000000000000000000010', + 'payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHNvYXA6RW52ZWxvcGUgeG1sbnM6cGF5X2k9Imh0dHA6Ly93d3cuZGlnaXRwYS5nb3YuaXQvc2NoZW1hcy8yMDExL1BhZ2FtZW50aS8iIHhtbG5zOnBwdD0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi8iIHhtbG5zOnFyYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L1FyQ29kZSIgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOnRucz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L3NlcnZpemkvUGFnYW1lbnRpVGVsZW1hdGljaVBzcE5vZG8iIHhtbG5zOnhzaT0iaHR0cDovL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wvcXJjOkNvZElVVj4KCQkJCTwvcXJjOlFyQ29kZT4KCQkJPC9jb2RpY2VJZFJQVD4KCQkJPGRhdGlQYWdhbWVudG9QU1A+CgkJCQk8aW1wb3J0b1NpbmdvbG9WZXJzYW1lbnRvPjI4LjAwPC9pbXBvcnRvU2luZ29sb1ZlcnNhbWVudG8+CgkJCTwvZGF0aVBhZ2FtZW50b1BTUD4KCQk8L3BwdDpub2RvQXR0aXZhUlBUPgoJPC9zb2FwOkJvZHk+Cjwvc29hcDpFbnZlbG9wZT4=' + ]); + + $this->no_data_instance = new nodoAttivaRPT([ + 'date_event' => '2023-09-01', + 'inserted_timestamp' => '2023-09-01 07:37:50', + 'tipoevento' => 'nodoAttivaRPT', + 'sottotipoevento' => 'REQ', + 'psp' => '', + 'stazione' => '', + 'canale' => '', + 'sessionid' => '6c9ce650-3542-4a10-b8bb-9c3331d2ebef', + 'sessionidoriginal' => '6c9ce650-3542-4a10-b8bb-9c3331d2ebef', + 'uniqueid' => 'event_no_data', + 'iddominio' => '', + 'iuv' => '', + 'ccp' => '', + 'noticeNumber' => '', + 'creditorreferenceid' => '', + 'paymenttoken' => '', + 'payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHNvYXA6RW52ZWxvcGUgeG1sbnM6cGF5X2k9Imh0dHA6Ly93d3cuZGlnaXRwYS5nb3YuaXQvc2NoZW1hcy8yMDExL1BhZ2FtZW50aS8iIHhtbG5zOnBwdD0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi8iIHhtbG5zOnFyYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L1FyQ29kZSIgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOnRucz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L3Nlcn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3FyYzpBdXhEaWdpdD4KCQkJCQk8cXJjOkNvZElVVj4wMTAwMDAwMDAwMDAwMDAxMDwvcXJjOkNvZElVVj4KCQkJCTwvcXJjOlFyQ29kZT4KCQkJPC9jb2RpY2VJZFJQVD4KCQkJPGRhdGlQYWdhbWVudG9QU1A+CgkJCQk8aW1wb3J0b1NpbmdvbG9WZXJzYW1lbnRvPjI4LjAwPC9pbXBvcnRvU2luZ29sb1ZlcnNhbWVudG8+CgkJCTwvZGF0aVBhZ2FtZW50b1BTUD4KCQk8L3BwdDpub2RvQXR0aXZhUlBUPgoJPC9zb2FwOkJvZHk+Cjwvc29hcDpFbnZlbG9wZT4=' + ]); + } + + #[TestDox('getFaultCode()')] + public function testGetFaultCode() + { + $this->assertNull($this->data_instance->getFaultCode()); + $this->assertNull($this->no_data_instance->getFaultCode()); + } + + #[TestDox('workflowEvent()')] + public function testWorkflowEvent() + { + $workflow = $this->data_instance->workflowEvent(); + $this->assertEquals(13, $workflow->getReadyColumnValue('fk_tipoevento')); + $this->assertEquals('2023-09-01 07:37:50.000', $workflow->getReadyColumnValue('event_timestamp')); + $this->assertEquals('event_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')); + + + $workflow = $this->no_data_instance->workflowEvent(); + $this->assertEquals(13, $workflow->getReadyColumnValue('fk_tipoevento')); + $this->assertEquals('2023-09-01 07:37:50.000', $workflow->getReadyColumnValue('event_timestamp')); + $this->assertEquals('event_no_data', $workflow->getReadyColumnValue('event_id')); + $this->assertEquals('AGID_01', $workflow->getReadyColumnValue('id_psp')); + $this->assertNull($workflow->getReadyColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getReadyColumnValue('canale')); + $this->assertNull($workflow->getReadyColumnValue('faultcode')); + $this->assertNull($workflow->getReadyColumnValue('outcome')); + + } + + #[TestDox('getMethodInterface()')] + public function testGetMethodInterface() + { + $this->assertInstanceOf(\pagopa\crawler\methods\req\nodoAttivaRPT::class, $this->data_instance->getMethodInterface()); + $this->assertInstanceOf(\pagopa\crawler\methods\req\nodoAttivaRPT::class, $this->no_data_instance->getMethodInterface()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $this->assertEquals(['01000000000000010'], $this->data_instance->getIuvs()); + $this->assertEquals(['01000000000000010'], $this->no_data_instance->getIuvs()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $this->assertEquals(['77777777777'], $this->data_instance->getPaEmittenti()); + $this->assertEquals(['77777777777'], $this->no_data_instance->getPaEmittenti()); + } + + #[TestDox('transactionDetails()')] + public function testTransactionDetails() + { + $this->assertNull($this->data_instance->transactionDetails(0)); + $this->assertNull($this->no_data_instance->transactionDetails(0)); + } + + #[TestDox('isFaultEvent()')] + public function testIsFaultEvent() + { + $this->assertFalse($this->data_instance->isFaultEvent()); + $this->assertFalse($this->no_data_instance->isFaultEvent()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $this->assertEquals(['c0000000000000000000000000000010'], $this->data_instance->getCcps()); + $this->assertEquals(['c0000000000000000000000000000010'], $this->no_data_instance->getCcps()); + } + + #[TestDox('getFaultString()')] + public function testGetFaultString() + { + $this->assertNull($this->data_instance->getFaultString()); + $this->assertNull($this->no_data_instance->getFaultString()); + } + + #[TestDox('getFaultDescription()')] + public function testGetFaultDescription() + { + $this->assertNull($this->data_instance->getFaultDescription()); + $this->assertNull($this->no_data_instance->getFaultDescription()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertEquals(1, $this->data_instance->getPaymentsCount()); + $this->assertEquals(1, $this->no_data_instance->getPaymentsCount()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->data_instance->getTransferCount()); + $this->assertNull($this->no_data_instance->getTransferCount()); + } + + #[TestDox('transaction()')] + public function testTransaction() + { + $transaction = $this->data_instance->transaction(); + $this->assertEquals('01000000000000010', $transaction->getReadyColumnValue('iuv')); + $this->assertEquals('77777777777', $transaction->getReadyColumnValue('pa_emittente')); + $this->assertEquals('c0000000000000000000000000000010', $transaction->getReadyColumnValue('token_ccp')); + $this->assertEquals('301000000000000010', $transaction->getReadyColumnValue('notice_id')); + $this->assertEquals('77777777777_01', $transaction->getReadyColumnValue('stazione')); + $this->assertEquals('88888888888_01', $transaction->getReadyColumnValue('canale')); + $this->assertEquals('TOUCHPOINT_EC_OLD', $transaction->getReadyColumnValue('touchpoint')); + $this->assertNull($transaction->getReadyColumnValue('id_carrello')); + $this->assertNull($transaction->getReadyColumnValue('importo')); + $this->assertNull($transaction->getReadyColumnValue('esito')); + $this->assertNull($transaction->getReadyColumnValue('date_wf')); + $this->assertNull($transaction->getReadyColumnValue('payment_type')); + + + $transaction = $this->no_data_instance->transaction(); + $this->assertEquals('01000000000000010', $transaction->getReadyColumnValue('iuv')); + $this->assertEquals('77777777777', $transaction->getReadyColumnValue('pa_emittente')); + $this->assertEquals('c0000000000000000000000000000010', $transaction->getReadyColumnValue('token_ccp')); + $this->assertEquals('301000000000000010', $transaction->getReadyColumnValue('notice_id')); + $this->assertEquals('88888888888_01', $transaction->getReadyColumnValue('canale')); + $this->assertEquals('TOUCHPOINT_EC_OLD', $transaction->getReadyColumnValue('touchpoint')); + $this->assertNull($transaction->getReadyColumnValue('id_carrello')); + $this->assertNull($transaction->getReadyColumnValue('stazione')); + $this->assertNull($transaction->getReadyColumnValue('importo')); + $this->assertNull($transaction->getReadyColumnValue('esito')); + $this->assertNull($transaction->getReadyColumnValue('date_wf')); + $this->assertNull($transaction->getReadyColumnValue('payment_type')); + } +} diff --git a/src/tests/pagopa/events/resp/nodoAttivaRPTTest.php b/src/tests/pagopa/events/resp/nodoAttivaRPTTest.php new file mode 100644 index 00000000..6f2291a7 --- /dev/null +++ b/src/tests/pagopa/events/resp/nodoAttivaRPTTest.php @@ -0,0 +1,171 @@ +ok_instance = new nodoAttivaRPT( + [ + 'date_event' => '2023-09-01', + 'inserted_timestamp' => '2023-09-01 07:37:50', + 'tipoevento' => 'nodoAttivaRPT', + 'sottotipoevento' => 'RESP', + 'psp' => 'AGID_01', + 'stazione' => '77777777777_01', + 'canale' => '88888888888_01', + 'sessionid' => '6c9ce650-3542-4a10-b8bb-9c3331d2ebef', + 'sessionidoriginal' => '6c9ce650-3542-4a10-b8bb-9c3331d2ebef', + 'uniqueid' => 'event_ok', + 'iddominio' => '77777777777', + 'iuv' => '01000000000000010', + 'ccp' => 'c0000000000000000000000000000010', + 'noticeNumber' => '301000000000000010', + 'creditorreferenceid' => '01000000000000010', + 'paymenttoken' => 'c0000000000000000000000000000010', + 'payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpiYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L0JhckNvZGVfR1MxXzEyOF9Nb2RpZmllZCIgeG1sbnM6cGF5X2k9Imh0dHA6Ly93d3cuZGlnaXRwYS5nb3YuaXQvc2NoZW1hcy8yMDExL1BhZ2FtZW50aS8iIHhtbG5zOnBwdD0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi8iIHhtbG5zOnFyYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L1FyQ29kZSIgeG1sbnM6c29hcGVudj0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOnRucz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L3NlcnZpemkvUGFnYW1lbnRpVGVsZW1hdGljaV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GVWZXJzYW1lbnRvPgoJCQkJPC9kYXRpUGFnYW1lbnRvUEE+CgkJCTwvbm9kb0F0dGl2YVJQVFJpc3Bvc3RhPgoJCTwvcHB0Om5vZG9BdHRpdmFSUFRSaXNwb3N0YT4KCTwvc29hcGVudjpCb2R5Pgo8L3NvYXBlbnY6RW52ZWxvcGU+' + ] + ); + + $this->ko_instance = new nodoAttivaRPT( + [ + 'date_event' => '2023-09-01', + 'inserted_timestamp' => '2023-09-01 07:37:50', + 'tipoevento' => 'nodoAttivaRPT', + 'sottotipoevento' => 'RESP', + 'psp' => '', + 'stazione' => '', + 'canale' => '', + 'sessionid' => '6c9ce650-3542-4a10-b8bb-9c3331d2ebef', + 'sessionidoriginal' => '6c9ce650-3542-4a10-b8bb-9c3331d2ebef', + 'uniqueid' => 'event_ko', + 'iddominio' => '', + 'iuv' => '', + 'ccp' => '', + 'noticeNumber' => '', + 'creditorreferenceid' => '', + 'paymenttoken' => '', + 'payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpiYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L0JhckNvZGVfR1MxXzEyOF9Nb2RpZmllZCIgeG1sbnM6cGF5X2k9Imh0dHA6Ly93d3cuZGlnaXRwYS5nb3YuaXQvc2NoZW1hcy8yMDExL1BhZ2FtZW50aS8iIHhtbG5zOnBwdD0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi8iIHhtbG5zOnFyYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L1FyQ29kZSIgeG1sbnM6c29hcGVudj0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOnRucz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L3NlcnZpemkvUGFnYW1lbnRpVGVsZW1hdGljaVBzcE5vZG8iIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSI+Cgk8c29hcGVudjpCb2R5PgoJCTxwcHQ6bm9kb0F0dGl2YVJQVFJpc3Bvc3RhPgoJCQk8bm9kb0F0dGl2YVJQVFJpc3Bvc3RhPgoJCQkJPGZhdWx0PgoJCQkJCTxmYXVsdENvZGU+UFBUX01VTFRJX0JFTkVGSUNJQVJJTzwvZmF1bHRDb2RlPgoJCQkJCTxmYXVsdFN0cmluZz5MYSBjaGlhbWF0YSBub24gw6ggY29tcGF0aWJpbGUgY29uIGlsIG51b3ZvIG1vZGVsbG8gUFNQLjwvZmF1bHRTdHJpbmc+CgkJCQkJPGlkPk5vZG9EZWlQYWdhbWVudGlTUEM8L2lkPgoJCQkJCTxkZXNjcmlwdGlvbj5MYSBjaGlhbWF0YSBub24gw6ggY29tcGF0aWJpbGUgY29uIGlsIG51b3ZvIG1vZGVsbG8gUFNQLjwvZGVzY3JpcHRpb24+CgkJCQk8L2ZhdWx0PgoJCQkJPGVzaXRvPktPPC9lc2l0bz4KCQkJPC9ub2RvQXR0aXZhUlBUUmlzcG9zdGE+CgkJPC9wcHQ6bm9kb0F0dGl2YVJQVFJpc3Bvc3RhPgoJPC9zb2FwZW52OkJvZHk+Cjwvc29hcGVudjpFbnZlbG9wZT4=' + ] + ); + } + + #[TestDox('transaction()')] + public function testTransaction() + { + $transaction = $this->ok_instance->transaction(); + $this->assertNull($transaction); + + $transaction = $this->ko_instance->transaction(); + $this->assertNull($transaction); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $this->assertEquals(['01000000000000010'], $this->ok_instance->getIuvs()); + $this->assertNull($this->ko_instance->getIuvs()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertEquals(1, $this->ok_instance->getTransferCount()); + $this->assertEquals(1, $this->ko_instance->getTransferCount()); + } + + #[TestDox('getFaultString()')] + public function testGetFaultString() + { + $this->assertNull($this->ok_instance->getFaultString()); + $this->assertEquals('La chiamata non è compatibile con il nuovo modello PSP.', $this->ko_instance->getFaultString()); + } + + #[TestDox('getFaultCode()')] + public function testGetFaultCode() + { + $this->assertNull($this->ok_instance->getFaultString()); + $this->assertEquals('PPT_MULTI_BENEFICIARIO', $this->ko_instance->getFaultCode()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $this->assertEquals(['77777777777'], $this->ok_instance->getPaEmittenti()); + $this->assertNull($this->ko_instance->getPaEmittenti()); + } + + #[TestDox('getFaultDescription()')] + public function testGetFaultDescription() + { + $this->assertNull($this->ok_instance->getFaultDescription()); + $this->assertEquals('La chiamata non è compatibile con il nuovo modello PSP.', $this->ko_instance->getFaultDescription()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $this->assertEquals(['c0000000000000000000000000000010'], $this->ok_instance->getCcps()); + $this->assertNull($this->ko_instance->getCcps()); + } + + #[TestDox('transactionDetails()')] + public function testTransactionDetails() + { + $this->assertNull($this->ok_instance->transactionDetails(0)); + $this->assertNull($this->ko_instance->transactionDetails(0)); + } + + #[TestDox('workflowEvent()')] + public function testWorkflowEvent() + { + $workflow = $this->ok_instance->workflowEvent(); + $this->assertEquals(14, $workflow->getReadyColumnValue('fk_tipoevento')); + $this->assertEquals('2023-09-01 07:37:50.000', $workflow->getReadyColumnValue('event_timestamp')); + $this->assertEquals('event_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->assertEquals('OK', $workflow->getReadyColumnValue('outcome')); + $this->assertNull($workflow->getReadyColumnValue('faultcode')); + + $workflow = $this->ko_instance->workflowEvent(); + $this->assertEquals(14, $workflow->getReadyColumnValue('fk_tipoevento')); + $this->assertEquals('2023-09-01 07:37:50.000', $workflow->getReadyColumnValue('event_timestamp')); + $this->assertEquals('event_ko', $workflow->getReadyColumnValue('event_id')); + $this->assertNull($workflow->getReadyColumnValue('id_psp')); + $this->assertNull($workflow->getReadyColumnValue('stazione')); + $this->assertNull($workflow->getReadyColumnValue('canale')); + $this->assertEquals('PPT_MULTI_BENEFICIARIO', $workflow->getReadyColumnValue('faultcode')); + $this->assertEquals('KO', $workflow->getReadyColumnValue('outcome')); + + } + + #[TestDox('isFaultEvent()')] + public function testIsFaultEvent() + { + + } + + #[TestDox('getMethodInterface()')] + public function testGetMethodInterface() + { + + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + + } +} diff --git a/src/tests/pagopa/methods/req/nodoAttivaRPTTest.php b/src/tests/pagopa/methods/req/nodoAttivaRPTTest.php new file mode 100644 index 00000000..35722ee1 --- /dev/null +++ b/src/tests/pagopa/methods/req/nodoAttivaRPTTest.php @@ -0,0 +1,205 @@ +instance = new nodoAttivaRPT(base64_decode('PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHNvYXA6RW52ZWxvcGUgeG1sbnM6cGF5X2k9Imh0dHA6Ly93d3cuZGlnaXRwYS5nb3YuaXQvc2NoZW1hcy8yMDExL1BhZ2FtZW50aS8iIHhtbG5zOnBwdD0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi8iIHhtbG5zOnFyYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L1FyQ29kZSIgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOnRucz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L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PjM8L3FyYzpBdXhEaWdpdD4KCQkJCQk8cXJjOkNvZElVVj4wMTAwMDAwMDAwMDAwMDAxMDwvcXJjOkNvZElVVj4KCQkJCTwvcXJjOlFyQ29kZT4KCQkJPC9jb2RpY2VJZFJQVD4KCQkJPGRhdGlQYWdhbWVudG9QU1A+CgkJCQk8aW1wb3J0b1NpbmdvbG9WZXJzYW1lbnRvPjI4LjAwPC9pbXBvcnRvU2luZ29sb1ZlcnNhbWVudG8+CgkJCTwvZGF0aVBhZ2FtZW50b1BTUD4KCQk8L3BwdDpub2RvQXR0aXZhUlBUPgoJPC9zb2FwOkJvZHk+Cjwvc29hcDpFbnZlbG9wZT4=')); + } + + #[TestDox('getTransferMetaDataValue()')] + public function testGetTransferMetaDataValue() + { + $this->assertNull($this->instance->getTransferMetaDataValue()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $this->assertEquals('c0000000000000000000000000000010', $this->instance->getCcp()); + } + + #[TestDox('getImporto()')] + public function testGetImporto() + { + $this->assertEquals('28.00', $this->instance->getImporto()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->instance->getTransferCount()); + } + + #[TestDox('getTransferPa()')] + public function testGetTransferPa() + { + $this->assertNull($this->instance->getTransferPa()); + } + + #[TestDox('getStazione()')] + public function testGetStazione() + { + $this->assertNull($this->instance->getStazione()); + } + + #[TestDox('getTransferMetaDataKey()')] + public function testGetTransferMetaDataKey() + { + $this->assertNull($this->instance->getTransferMetaDataKey()); + } + + #[TestDox('getToken()')] + public function testGetToken() + { + $this->assertEquals('c0000000000000000000000000000010', $this->instance->getToken()); + } + + #[TestDox('getBrokerPa()')] + public function testGetBrokerPa() + { + $this->assertNull($this->instance->getBrokerPa()); + } + + #[TestDox('getImportoTotale()')] + public function testGetImportoTotale() + { + $this->assertEquals('28.00', $this->instance->getImportoTotale()); + } + + #[TestDox('getTransferAmount()')] + public function testGetTransferAmount() + { + $this->assertNull($this->instance->getTransferAmount()); + } + + #[TestDox('isBollo()')] + public function testIsBollo() + { + $this->assertFalse($this->instance->isBollo()); + } + + #[TestDox('getPaymentMetaDataValue()')] + public function testGetPaymentMetaDataValue() + { + $this->assertNull($this->instance->getPaymentMetaDataValue()); + } + + #[TestDox('getTransferId()')] + public function testGetTransferId() + { + $this->assertNull($this->instance->getTransferId()); + } + + #[TestDox('getPsp()')] + public function testGetPsp() + { + $this->assertEquals('AGID_01', $this->instance->getPsp()); + } + + #[TestDox('getPaymentMetaDataKey()')] + public function testGetPaymentMetaDataKey() + { + $this->assertNull($this->instance->getPaymentMetaDataKey()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $this->assertEquals(['01000000000000010'], $this->instance->getIuvs()); + } + + #[TestDox('getCcp()')] + public function testGetCcp() + { + $this->assertEquals('c0000000000000000000000000000010', $this->instance->getCcp()); + } + + #[TestDox('getCanale()')] + public function testGetCanale() + { + $this->assertEquals('88888888888_01', $this->instance->getCanale()); + } + + #[TestDox('getBrokerPsp()')] + public function testGetBrokerPsp() + { + $this->assertEquals('88888888888', $this->instance->getBrokerPsp()); + } + + #[TestDox('getTransferMetaDataCount()')] + public function testGetTransferMetaDataCount() + { + $this->assertNull($this->instance->getTransferMetaDataCount()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertNull($this->instance->getPaymentsCount()); + } + + #[TestDox('getPaEmittente()')] + public function testGetPaEmittente() + { + $this->assertEquals('77777777777', $this->instance->getPaEmittente()); + } + + #[TestDox('getTransferIban()')] + public function testGetTransferIban() + { + $this->assertNull($this->instance->getTransferIban()); + } + + #[TestDox('getAllTokens()')] + public function testGetAllTokens() + { + $this->assertEquals(['c0000000000000000000000000000010'], $this->instance->getAllTokens()); + } + + #[TestDox('getIuv()')] + public function testGetIuv() + { + $this->assertEquals('01000000000000010', $this->instance->getIuv()); + } + + #[TestDox('getNoticeNumber()')] + public function testGetNoticeNumber() + { + $this->assertEquals('301000000000000010', $this->instance->getNoticeNumber()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $this->assertEquals(['77777777777'], $this->instance->getPaEmittenti()); + } + + #[TestDox('getAllNoticesNumbers()')] + public function testGetAllNoticesNumbers() + { + $this->assertEquals(['301000000000000010'], $this->instance->getAllNoticesNumbers()); + } + + #[TestDox('getPaymentMetaDataCount()')] + public function testGetPaymentMetaDataCount() + { + $this->assertNull($this->instance->getPaymentMetaDataCount()); + } + + #[TestDox('outcome()')] + public function testOutcome() + { + $this->assertNull($this->instance->outcome()); + } +} diff --git a/src/tests/pagopa/methods/resp/nodoAttivaRPTTest.php b/src/tests/pagopa/methods/resp/nodoAttivaRPTTest.php new file mode 100644 index 00000000..699faca5 --- /dev/null +++ b/src/tests/pagopa/methods/resp/nodoAttivaRPTTest.php @@ -0,0 +1,268 @@ +ok_instance = new nodoAttivaRPT(base64_decode('PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpiYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L0JhckNvZGVfR1MxXzEyOF9Nb2RpZmllZCIgeG1sbnM6cGF5X2k9Imh0dHA6Ly93d3cuZGlnaXRwYS5nb3YuaXQvc2NoZW1hcy8yMDExL1BhZ2FtZW50aS8iIHhtbG5zOnBwdD0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi8iIHhtbG5zOnFyYz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L1FyQ29kZSIgeG1sbnM6c29hcGVudj0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOnRucz0iaHR0cDovL1B1bnRvQWNjZXNzb1BTUC5zcGNvb3AuZ292Lml0L3NlcnZpemkvUGFnYW1lbnRpVGVsZW1hdGljaVBzcE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hdWx0PgoJCQkJCTxmYXVsdENvZGU+UFBUX01VTFRJX0JFTkVGSUNJQVJJTzwvZmF1bHRDb2RlPgoJCQkJCTxmYXVsdFN0cmluZz5MYSBjaGlhbWF0YSBub24gw6ggY29tcGF0aWJpbGUgY29uIGlsIG51b3ZvIG1vZGVsbG8gUFNQLjwvZmF1bHRTdHJpbmc+CgkJCQkJPGlkPk5vZG9EZWlQYWdhbWVudGlTUEM8L2lkPgoJCQkJCTxkZXNjcmlwdGlvbj5MYSBjaGlhbWF0YSBub24gw6ggY29tcGF0aWJpbGUgY29uIGlsIG51b3ZvIG1vZGVsbG8gUFNQLjwvZGVzY3JpcHRpb24+CgkJCQk8L2ZhdWx0PgoJCQkJPGVzaXRvPktPPC9lc2l0bz4KCQkJPC9ub2RvQXR0aXZhUlBUUmlzcG9zdGE+CgkJPC9wcHQ6bm9kb0F0dGl2YVJQVFJpc3Bvc3RhPgoJPC9zb2FwZW52OkJvZHk+Cjwvc29hcGVudjpFbnZlbG9wZT4=')); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $this->assertNull($this->ok_instance->getIuvs()); + $this->assertNull($this->ko_intance->getIuvs()); + } + + #[TestDox('getImportoTotale()')] + public function testGetImportoTotale() + { + $this->assertEquals('27.00', $this->ok_instance->getImportoTotale()); + $this->assertNull($this->ko_intance->getImportoTotale()); + } + + #[TestDox('getFaultDescription()')] + public function testGetFaultDescription() + { + $this->assertNull($this->ok_instance->getFaultDescription()); + $this->assertEquals('La chiamata non è compatibile con il nuovo modello PSP.', $this->ko_intance->getFaultDescription()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $this->assertNull($this->ok_instance->getCcps()); + $this->assertNull($this->ko_intance->getCcps()); + } + + #[TestDox('getStazione()')] + public function testGetStazione() + { + $this->assertNull($this->ok_instance->getStazione()); + $this->assertNull($this->ko_intance->getStazione()); + } + + #[TestDox('getTransferMetaDataKey()')] + public function testGetTransferMetaDataKey() + { + $this->assertNull($this->ok_instance->getTransferMetaDataKey()); + $this->assertNull($this->ko_intance->getTransferMetaDataKey()); + } + + #[TestDox('getFaultString()')] + public function testGetFaultString() + { + $this->assertNull($this->ok_instance->getFaultString()); + $this->assertEquals('La chiamata non è compatibile con il nuovo modello PSP.', $this->ko_intance->getFaultString()); + } + + #[TestDox('getFaultCode()')] + public function testGetFaultCode() + { + $this->assertNull($this->ok_instance->getFaultCode()); + $this->assertEquals('PPT_MULTI_BENEFICIARIO', $this->ko_intance->getFaultCode()); + } + + #[TestDox('isBollo()')] + public function testIsBollo() + { + $this->assertFalse($this->ok_instance->isBollo()); + $this->assertFalse($this->ko_intance->isBollo()); + } + + #[TestDox('getTransferIban()')] + public function testGetTransferIban() + { + $this->assertNull($this->ok_instance->getTransferIban()); + $this->assertNull($this->ko_intance->getTransferIban()); + } + + #[TestDox('getPaymentMetaDataValue()')] + public function testGetPaymentMetaDataValue() + { + $this->assertNull($this->ok_instance->getPaymentMetaDataValue()); + $this->assertNull($this->ko_intance->getPaymentMetaDataValue()); + } + + #[TestDox('getCcp()')] + public function testGetCcp() + { + $this->assertNull($this->ok_instance->getCcp()); + $this->assertNull($this->ko_intance->getCcp()); + } + + #[TestDox('getAllTokens()')] + public function testGetAllTokens() + { + $this->assertNull($this->ok_instance->getAllTokens()); + $this->assertNull($this->ko_intance->getAllTokens()); + } + + #[TestDox('getAllNoticesNumbers()')] + public function testGetAllNoticesNumbers() + { + $this->assertNull($this->ok_instance->getAllNoticesNumbers()); + $this->assertNull($this->ko_intance->getAllNoticesNumbers()); + } + + #[TestDox('getTransferMetaDataCount()')] + public function testGetTransferMetaDataCount() + { + $this->assertNull($this->ok_instance->getTransferMetaDataCount()); + $this->assertNull($this->ko_intance->getTransferMetaDataCount()); + } + + #[TestDox('getTransferPa()')] + public function testGetTransferPa() + { + $this->assertNull($this->ok_instance->getTransferPa()); + $this->assertNull($this->ko_intance->getTransferPa()); + } + + #[TestDox('getPaymentMetaDataCount()')] + public function testGetPaymentMetaDataCount() + { + $this->assertNull($this->ok_instance->getPaymentMetaDataCount()); + $this->assertNull($this->ko_intance->getPaymentMetaDataCount()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertEquals(1, $this->ok_instance->getPaymentsCount()); + $this->assertEquals(1, $this->ko_intance->getPaymentsCount()); + } + + #[TestDox('getPaEmittente()')] + public function testGetPaEmittente() + { + $this->assertNull($this->ok_instance->getPaEmittente()); + $this->assertNull($this->ko_intance->getPaEmittente()); + } + + #[TestDox('getPaymentMetaDataKey()')] + public function testGetPaymentMetaDataKey() + { + $this->assertNull($this->ok_instance->getPaymentMetaDataKey()); + $this->assertNull($this->ko_intance->getPaymentMetaDataKey()); + } + + #[TestDox('getTransferAmount()')] + public function testGetTransferAmount() + { + $this->assertNull($this->ok_instance->getTransferAmount()); + $this->assertNull($this->ko_intance->getTransferAmount()); + } + + #[TestDox('getIuv()')] + public function testGetIuv() + { + $this->assertNull($this->ok_instance->getIuv()); + $this->assertNull($this->ko_intance->getIuv()); + } + + #[TestDox('getBrokerPsp()')] + public function testGetBrokerPsp() + { + $this->assertNull($this->ok_instance->getBrokerPsp()); + $this->assertNull($this->ko_intance->getBrokerPsp()); + } + + #[TestDox('outcome()')] + public function testOutcome() + { + $this->assertEquals('OK', $this->ok_instance->outcome()); + $this->assertEquals('KO', $this->ko_intance->outcome()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->ok_instance->getTransferCount()); + $this->assertNull($this->ko_intance->getTransferCount()); + } + + #[TestDox('getBrokerPa()')] + public function testGetBrokerPa() + { + $this->assertNull($this->ok_instance->getBrokerPa()); + $this->assertNull($this->ko_intance->getBrokerPa()); + } + + #[TestDox('getTransferId()')] + public function testGetTransferId() + { + $this->assertNull($this->ok_instance->getTransferId()); + $this->assertNull($this->ko_intance->getTransferId()); + } + + #[TestDox('getImporto()')] + public function testGetImporto() + { + $this->assertEquals('27.00', $this->ok_instance->getImporto()); + $this->assertNull($this->ko_intance->getImporto()); + } + + #[TestDox('getNoticeNumber()')] + public function testGetNoticeNumber() + { + $this->assertNull($this->ok_instance->getNoticeNumber()); + $this->assertNull($this->ko_intance->getNoticeNumber()); + } + + #[TestDox('isFaultEvent()')] + public function testIsFaultEvent() + { + $this->assertFalse($this->ok_instance->isFaultEvent()); + $this->assertTrue($this->ko_intance->isFaultEvent()); + } + + #[TestDox('getPsp()')] + public function testGetPsp() + { + $this->assertNull($this->ok_instance->getPsp()); + $this->assertNull($this->ko_intance->getPsp()); + } + + #[TestDox('getTransferMetaDataValue()')] + public function testGetTransferMetaDataValue() + { + $this->assertNull($this->ok_instance->getTransferMetaDataValue()); + $this->assertNull($this->ko_intance->getTransferMetaDataValue()); + } + + #[TestDox('getToken()')] + public function testGetToken() + { + $this->assertNull($this->ok_instance->getToken()); + $this->assertNull($this->ko_intance->getToken()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $this->assertNull($this->ok_instance->getPaEmittenti()); + $this->assertNull($this->ko_intance->getPaEmittenti()); + } + + #[TestDox('getCanale()')] + public function testGetCanale() + { + $this->assertNull($this->ok_instance->getCanale()); + $this->assertNull($this->ko_intance->getCanale()); + } +} diff --git a/src/tests/phpunit.xml b/src/tests/phpunit.xml index 80697dea..5dd92fa7 100644 --- a/src/tests/phpunit.xml +++ b/src/tests/phpunit.xml @@ -26,7 +26,7 @@ - process/crawler/nodoInviaRPT/T00044_nodoInviaRPT_NoPreviousAttivaRPT.php + process/crawler/nodoAttivaRPT/T00046_nodoAttivaRPT_PreviousAttivaRPT_FaultCode.php process/crawler/activatePaymentNotice/SingleEvent/T00001_CreateAttemptAllInfoInEvent.php @@ -64,6 +64,8 @@ process/crawler/pspInviaCarrelloRPT/T00042_UpdatePspWithNodoInviaCarrelloRPT_2_RPT.php process/crawler/pspInviaCarrelloRPTCarte/T00043_UpdatePspWithNodoInviaCarrelloRPT_1_RPT_ExtraInfo.php process/crawler/nodoInviaRPT/T00044_nodoInviaRPT_NoPreviousAttivaRPT.php + process/crawler/nodoAttivaRPT/T00045_nodoAttivaRPT_PreviousAttivaRPT.php + process/crawler/nodoAttivaRPT/T00046_nodoAttivaRPT_PreviousAttivaRPT_FaultCode.php @@ -74,6 +76,7 @@ pagopa/methods/req/pspInviaCarrelloRPTTest.php pagopa/methods/req/pspInviaCarrelloRPTCarteTest.php pagopa/methods/req/nodoInviaRPTTest.php + pagopa/methods/req/nodoAttivaRPTTest.php pagopa/methods/resp/activatePaymentNoticeTest.php @@ -82,6 +85,7 @@ pagopa/methods/resp/pspInviaCarrelloRPTTest.php pagopa/methods/resp/pspInviaCarrelloRPTCarteTest.php pagopa/methods/resp/nodoInviaRPTTest.php + pagopa/methods/resp/nodoAttivaRPTTest.php pagopa/events/req/activatePaymentNoticeTest.php @@ -90,6 +94,7 @@ pagopa/events/req/pspInviaCarrelloRPTTest.php pagopa/events/req/pspInviaCarrelloRPTCarteTest.php pagopa/events/req/nodoInviaRPTTest.php + pagopa/events/req/nodoAttivaRPTTest.php pagopa/events/resp/activatePaymentNoticeTest.php @@ -98,6 +103,7 @@ pagopa/events/resp/pspInviaCarrelloRPTTest.php pagopa/events/resp/pspInviaCarrelloRPTCarteTest.php pagopa/events/resp/nodoInviaRPTTest.php + pagopa/events/resp/nodoAttivaRPTTest.php process/normal/T0001.php diff --git a/src/tests/process/crawler/nodoAttivaRPT/T00045_nodoAttivaRPT_PreviousAttivaRPT.php b/src/tests/process/crawler/nodoAttivaRPT/T00045_nodoAttivaRPT_PreviousAttivaRPT.php new file mode 100644 index 00000000..dcb3f970 --- /dev/null +++ b/src/tests/process/crawler/nodoAttivaRPT/T00045_nodoAttivaRPT_PreviousAttivaRPT.php @@ -0,0 +1,124 @@ +getTransaction(new \DateTime('2024-03-10'), '01000000000000090'); + $this->assertEquals('2024-03-10 12:45:00.197', $transaction->getColumnValue('inserted_timestamp')); + $this->assertEquals('01000000000000090', $transaction->getColumnValue('iuv')); + $this->assertEquals('77777777777', $transaction->getColumnValue('pa_emittente')); + $this->assertEquals('c0000000000000000000000000000090', $transaction->getColumnValue('token_ccp')); + $this->assertEquals('301000000000000090', $transaction->getColumnValue('notice_id')); + $this->assertEquals('33.10', $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('TOUCHPOINT_EC_OLD', $transaction->getColumnValue('touchpoint')); + $this->assertNull($transaction->getColumnValue('id_carrello')); + $this->assertNull($transaction->getColumnValue('payment_type')); + } + + + #[TestDox('[DETAILS] Verifica assenza dettagli')] + public function testTransactionDetails() + { + $transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000090' ); + $details = self::$db->getTransactionDetails($transaction, 0); + + $this->assertNull($details->getColumnValue('iur')); + $this->assertNull($details->getColumnValue('id_transfer')); + $this->assertEquals('77777777777', $details->getColumnValue('pa_transfer')); + $this->assertEquals('IT0000000000000000000000001', $details->getColumnValue('iban_transfer')); + $this->assertEquals('33.10', $details->getColumnValue('amount_transfer')); + $this->assertFalse($details->getColumnValue('is_bollo')); + } + + #[TestDox('[WORKFLOW] Verifica presenza eventi Workflow')] + public function testWorkFlow() + { + $transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000090'); + + $workflow = self::$db->getWorkFlow($transaction, 0); + $this->assertEquals('13', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 12:45:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000090', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + + $workflow = self::$db->getWorkFlow($transaction, 1); + $this->assertEquals('14', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 12:46:01.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000091', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('OK', $workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 2); + $this->assertEquals('11', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 12:47:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000092', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + + $workflow = self::$db->getWorkFlow($transaction, 3); + $this->assertEquals('12', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 12:48:01.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000093', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('OK', $workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 4); + $this->assertEquals('11', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 12:49:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000094', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + + $workflow = self::$db->getWorkFlow($transaction, 5); + $this->assertEquals('12', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 12:50:01.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000095', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('OK', $workflow->getColumnValue('outcome')); + + } + + #[TestDox('[ReEvent] Verifica stato evento')] + public function testEvent() + { + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 90); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 91); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 92); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 93); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 94); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 95); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + } + +} diff --git a/src/tests/process/crawler/nodoAttivaRPT/T00046_nodoAttivaRPT_PreviousAttivaRPT_FaultCode.php b/src/tests/process/crawler/nodoAttivaRPT/T00046_nodoAttivaRPT_PreviousAttivaRPT_FaultCode.php new file mode 100644 index 00000000..57c7e867 --- /dev/null +++ b/src/tests/process/crawler/nodoAttivaRPT/T00046_nodoAttivaRPT_PreviousAttivaRPT_FaultCode.php @@ -0,0 +1,84 @@ +getTransaction(new \DateTime('2024-03-10'), '01000000000000091'); + $this->assertEquals('2024-03-10 12:51:00.197', $transaction->getColumnValue('inserted_timestamp')); + $this->assertEquals('01000000000000091', $transaction->getColumnValue('iuv')); + $this->assertEquals('77777777777', $transaction->getColumnValue('pa_emittente')); + $this->assertEquals('c0000000000000000000000000000091', $transaction->getColumnValue('token_ccp')); + $this->assertEquals('301000000000000091', $transaction->getColumnValue('notice_id')); + $this->assertEquals('77777777777_01', $transaction->getColumnValue('stazione')); + $this->assertEquals('AGID_01', $transaction->getColumnValue('id_psp')); + $this->assertEquals('88888888888_01', $transaction->getColumnValue('canale')); + $this->assertEquals('TOUCHPOINT_EC_OLD', $transaction->getColumnValue('touchpoint')); + $this->assertNull($transaction->getColumnValue('id_carrello')); + $this->assertNull($transaction->getColumnValue('payment_type')); + $this->assertNull($transaction->getColumnValue('import')); + } + + + #[TestDox('[DETAILS] Verifica assenza dettagli')] + public function testTransactionDetails() + { + $transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000091' ); + $details = self::$db->getTransactionDetails($transaction, 0); + + $this->assertNull($details); + } + + #[TestDox('[WORKFLOW] Verifica presenza eventi Workflow')] + public function testWorkFlow() + { + $transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000091'); + + $workflow = self::$db->getWorkFlow($transaction, 0); + $this->assertEquals('13', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 12:51:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000096', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + + $workflow = self::$db->getWorkFlow($transaction, 1); + $this->assertEquals('14', $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 12:52:01.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000097', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('KO', $workflow->getColumnValue('outcome')); + $this->assertEquals('PPT_MULTI_BENEFICIARIO', $workflow->getColumnValue('faultcode')); + + $workflow = self::$db->getWorkFlow($transaction, 2); + $this->assertNull($workflow); + } + + #[TestDox('[ReEvent] Verifica stato evento')] + public function testEvent() + { + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 96); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 97); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + } + +} diff --git a/src/tests/process/crawler/nodoInviaCarrelloRPT/BothEvents/T00029_CreateAttemptOneRPTTwoTransferWithSessionIdOriginalNotFound.php b/src/tests/process/crawler/nodoInviaCarrelloRPT/BothEvents/T00029_CreateAttemptOneRPTTwoTransferWithSessionIdOriginalNotFound.php index b1f8d73e..e7cbd7c1 100644 --- a/src/tests/process/crawler/nodoInviaCarrelloRPT/BothEvents/T00029_CreateAttemptOneRPTTwoTransferWithSessionIdOriginalNotFound.php +++ b/src/tests/process/crawler/nodoInviaCarrelloRPT/BothEvents/T00029_CreateAttemptOneRPTTwoTransferWithSessionIdOriginalNotFound.php @@ -207,7 +207,7 @@ public function testEvent() $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 36); $this->assertEquals('TO_SEARCH', $event->getColumnValue('state')); - $this->assertEquals('Evento non associabile a nessun pagamento in cache, va ricercato', $event->getColumnValue('message')); + $this->assertEquals('Evento non associabile a nessun tentativo in cache, va ricercato', $event->getColumnValue('message')); }