diff --git a/src/mock_crawler.php b/src/mock_crawler.php index d3a2514b..d5432437 100644 --- a/src/mock_crawler.php +++ b/src/mock_crawler.php @@ -230,6 +230,13 @@ $a->run(); +$a = new \pagopa\crawler\paymentlist\req\paSendRT(new \DateTime('2024-03-10'), 'paSendRT', 'REQ', $redis_cache); +$a->run(); + +$a = new \pagopa\crawler\paymentlist\resp\paSendRT(new DateTime('2024-03-10'), 'paSendRT', 'RESP', $redis_cache); +$a->run(); + + $a = new \pagopa\crawler\paymentlist\req\nodoInviaRT(new DateTime('2024-03-10'), 'nodoInviaRT', 'REQ', $redis_cache); $a->run(); diff --git a/src/mock_insert.php b/src/mock_insert.php index 2cb08d48..d9a14efd 100644 --- a/src/mock_insert.php +++ b/src/mock_insert.php @@ -6565,3 +6565,209 @@ ]; Capsule::statement($render_query, $data_req); Capsule::statement($render_query, $data_resp); + + + + + + + + + + +$data_req = [ + ':id' => 262, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 10:40:00.197', + ':tipoevento' => 'activatePaymentNotice', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000260', + ':ccp' => 't0000000000000000000000000000260', + ':noticenumber' => '301000000000000260', + ':creditorreferenceid' => '01000000000000260', + ':paymenttoken' => 't0000000000000000000000000000260', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000260', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000262', + ':payload' => 'PHNvYXBlbnY6RW52ZWxvcGUgeG1sbnM6bm9kPSJodHRwOi8vcGFnb3BhLWFwaS5wYWdvcGEuZ292Lml0L25vZGUvbm9kZUZvclBzcC54c2QiIHhtbG5zOnNvYXBlbnY9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIj4KCTxzb2FwZW52OkhlYWRlci8+Cgk8c29hcGVudjpCb2R5PgoJCTxub2Q6YWN0aXZhdGVQYXltZW50Tm90aWNlUmVxPgoJCQk8aWRQU1A+UFNQXzAxPC9pZFBTUD4KCQkJPGlkQnJva2VyUFNQPjg4ODg4ODg4ODg4PC9pZEJyb2tlclBTUD4KCQkJPGlkQ2hhbm5lbD44ODg4ODg4ODg4OF8wMTwvaWRDaGFubmVsPgoJCQk8cGFzc3dvcmQ+KioqKio8L3Bhc3N3b3JkPgoJCQk8cXJDb2RlPgoJCQkJPGZpc2NhbENvZGU+Nzc3Nzc3Nzc3Nzc8L2Zpc2NhbENvZGU+CgkJCQk8bm90aWNlTnVtYmVyPjMwMTAwMDAwMDAwMDAwMDI2MDwvbm90aWNlTnVtYmVyPgoJCQk8L3FyQ29kZT4KCQkJPGFtb3VudD4wLjAwPC9hbW91bnQ+CgkJPC9ub2Q6YWN0aXZhdGVQYXltZW50Tm90aWNlUmVxPgoJPC9zb2FwZW52OkJvZHk+Cjwvc29hcGVudjpFbnZlbG9wZT4=', +]; +$data_resp = [ + ':id' => 263, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 10:40:10.197', + ':tipoevento' => 'activatePaymentNotice', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000260', + ':ccp' => 't0000000000000000000000000000260', + ':noticenumber' => '301000000000000260', + ':creditorreferenceid' => '01000000000000260', + ':paymenttoken' => 't0000000000000000000000000000260', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000260', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000263', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpjb21tb249Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQveHNkL2NvbW1vbi10eXBlcy92MS4wLjAvIiB4bWxuczpuZnA9Imh0dHA6Ly9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CTwvdHJhbnNmZXJMaXN0PgoJCQk8Y3JlZGl0b3JSZWZlcmVuY2VJZD4wMTAwMDAwMDAwMDAwMDI2MDwvY3JlZGl0b3JSZWZlcmVuY2VJZD4KCQk8L25mcDphY3RpdmF0ZVBheW1lbnROb3RpY2VSZXM+Cgk8L3NvYXBlbnY6Qm9keT4KPC9zb2FwZW52OkVudmVsb3BlPg==', +]; +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + + + + + + + +$data_req = [ + ':id' => 264, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 10:40:02.197', + ':tipoevento' => 'paGetPayment', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000260', + ':ccp' => 't0000000000000000000000000000260', + ':noticenumber' => '301000000000000260', + ':creditorreferenceid' => '01000000000000260', + ':paymenttoken' => 't0000000000000000000000000000260', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000261', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000264', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpjb21tb249Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQveHNkL2NvbW1vbi10eXBlcy92MS4wLjAvIiB4bWxuczpwYWZuPSJodHRwOi8vcGFnb3BhLWFwaS5wYWdvcGEuZ292Lml0L3BhL3BhRm9yTm9kZS54c2QiIHhtbG5zOnNvYXBlbnY9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIiB4bWxuczp0bnM9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvcGFGb3JOb2RlIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIj4KCTxzb2FwZW52OkJvZHk+CgkJPHBhZm46cGFHZXRQYXltZW50UmVxPgoJCQk8aWRQQT43Nzc3Nzc3Nzc3NzwvaWRQQT4KCQkJPGlkQnJva2VyUEE+Nzc3Nzc3Nzc3Nzc8L2lkQnJva2VyUEE+CgkJCTxpZFN0YXRpb24+Nzc3Nzc3Nzc3NzdfMDE8L2lkU3RhdGlvbj4KCQkJPHFyQ29kZT4KCQkJCTxmaXNjYWxDb2RlPjc3Nzc3Nzc3Nzc3PC9maXNjYWxDb2RlPgoJCQkJPG5vdGljZU51bWJlcj4zMDEwMDAwMDAwMDAwMDAyNjA8L25vdGljZU51bWJlcj4KCQkJPC9xckNvZGU+CgkJCTxhbW91bnQ+MC4wMDwvYW1vdW50PgoJCTwvcGFmbjpwYUdldFBheW1lbnRSZXE+Cgk8L3NvYXBlbnY6Qm9keT4KPC9zb2FwZW52OkVudmVsb3BlPg==', +]; +$data_resp = [ + ':id' => 265, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 10:40:05.197', + ':tipoevento' => 'paGetPayment', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000260', + ':ccp' => 't0000000000000000000000000000260', + ':noticenumber' => '301000000000000260', + ':creditorreferenceid' => '01000000000000260', + ':paymenttoken' => 't0000000000000000000000000000260', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000261', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000265', + ':payload' => 'PFNPQVAtRU5WOkVudmVsb3BlIHhtbG5zOlNPQVAtRU5WPSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VudmVsb3BlLyI+Cgk8U09BUC1FTlY6SGVhZGVyLz4KCTxTT0FQLUVOVjpCb2R5PgoJCTxuczM6cGFHZXRQYXltZW50UmVzIHhtbG5zOm5zMz0iaHR0cDovL3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=> 266, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 10:41:02.197', + ':tipoevento' => 'sendPaymentOutcome', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000260', + ':ccp' => 't0000000000000000000000000000260', + ':noticenumber' => '301000000000000260', + ':creditorreferenceid' => '01000000000000260', + ':paymenttoken' => 't0000000000000000000000000000260', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000262', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000266', + ':payload' => 'PHNvYXA6RW52ZWxvcGUgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iPgoJPHNvYXA6Qm9keT4KCQk8bnMyOnNlbmRQYXltZW50T3V0Y29tZVJlcSB4bWxuczpuczI9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvbm9kZS9ub2RlRm9yUHNwLnhzZCIgeG1sbnM6bnMzPSJodHRwOi8vd3MucGFnYW1lbnRpLnRlbGVtYXRpY2kuZ292LyI+CgkJCTxpZFBTUD5BR0lEXzAxPC9pZFBTUD4KCQkJPGlkQnJva2VyUFNQPjg4ODg4ODg4ODg4PC9pZEJyb2tlclBTUD4KCQkJPGlkQ2hhbm5lbD44ODg4ODg4ODg4OF8wMTwvaWRDaGFubmVsPgoJCQk8cGFzc3dvcmQ+eHh4eHh4eHg8L3Bhc3N3b3JkPgoJCQk8cGF5bWVudFRva2VuPnQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMjYwPC9wYXltZW50VG9rZW4+CgkJCTxvdXRjb21lPk9LPC9vdXRjb21lPgoJCQk8ZGV0YWlscz4KCQkJCTxwYXltZW50TWV0aG9kPm90aGVyPC9wYXltZW50TWV0aG9kPgoJCQkJPGZlZT4xLjAwPC9mZWU+CgkJCQk8YXBwbGljYXRpb25EYXRlPjIwMjQtMDQtMDI8L2FwcGxpY2F0aW9uRGF0ZT4KCQkJCTx0cmFuc2ZlckRhdGU+MjAyNC0wNC0wMzwvdHJhbnNmZXJEYXRlPgoJCQk8L2RldGFpbHM+CgkJPC9uczI6c2VuZFBheW1lbnRPdXRjb21lUmVxPgoJPC9zb2FwOkJvZHk+Cjwvc29hcDpFbnZlbG9wZT4=', +]; +$data_resp = [ + ':id' => 267, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 10:41:05.197', + ':tipoevento' => 'sendPaymentOutcome', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000260', + ':ccp' => 't0000000000000000000000000000260', + ':noticenumber' => '301000000000000260', + ':creditorreferenceid' => '01000000000000260', + ':paymenttoken' => 't0000000000000000000000000000260', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000262', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000267', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pjxzb2FwZW52OkVudmVsb3BlIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOnNvYXBlbnY9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOmNvbW1vbj0iaHR0cDovL3BhZ29wYS1hcGkucGFnb3BhLmdvdi5pdC94c2QvY29tbW9uLXR5cGVzL3YxLjAuMC8iIHhtbG5zOm5mcD0iaHR0cDovL3BhZ29wYS1hcGkucGFnb3BhLmdvdi5pdC9ub2RlL25vZGVGb3JQc3AueHNkIj48c29hcGVudjpCb2R5PjxuZnA6c2VuZFBheW1lbnRPdXRjb21lUmVzPjxvdXRjb21lPk9LPC9vdXRjb21lPjwvbmZwOnNlbmRQYXltZW50T3V0Y29tZVJlcz48L3NvYXBlbnY6Qm9keT48L3NvYXBlbnY6RW52ZWxvcGU+', +]; +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + + + + + + + + + + + + +$data_req = [ + ':id' => 268, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 10:42:02.197', + ':tipoevento' => 'paSendRT', + ':sottotipoevento' => 'REQ', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000260', + ':ccp' => 't0000000000000000000000000000260', + ':noticenumber' => '301000000000000260', + ':creditorreferenceid' => '01000000000000260', + ':paymenttoken' => 't0000000000000000000000000000260', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000263', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000268', + ':payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpjb21tb249Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQveHNkL2NvbW1vbi10eXBlcy92MS4wLjAvIiB4bWxuczpwYWZuPSJodHRwOi8vcGFnb3BhLWFwaS5wYWdvcGEuZ292Lml0L3BhL3BhRm9yTm9kZS54c2QiIHhtbG5zOnNvYXBlbnY9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIiB4bWxuczp0bnM9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvcGFGb3JOb2RlIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIj4KCTxzb2FwZW52OkJvZHk+CgkJPHBhZm46cGFTZW5kUlRSZXE+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TwvcGFmbjpwYVNlbmRSVFJlcT4KCTwvc29hcGVudjpCb2R5Pgo8L3NvYXBlbnY6RW52ZWxvcGU+', +]; +$data_resp = [ + ':id' => 269, + ':date_event' => '2024-03-10', + ':inserted_timestamp' => '2024-03-10 10:42:05.197', + ':tipoevento' => 'paSendRT', + ':sottotipoevento' => 'RESP', + ':iddominio' => '77777777777', + ':iuv' => '01000000000000260', + ':ccp' => 't0000000000000000000000000000260', + ':noticenumber' => '301000000000000260', + ':creditorreferenceid' => '01000000000000260', + ':paymenttoken' => 't0000000000000000000000000000260', + ':psp' => 'AGID_01', + ':stazione' => '77777777777_01', + ':canale' => '88888888888_01', + ':sessionid' => 'sessid_000263', + ':sessionidoriginal' => '', + ':uniqueid' => 'T000269', + ':payload' => 'PHNvYXA6RW52ZWxvcGUgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iPgoJPHNvYXA6Qm9keT4KCQk8bnM2OnBhU2VuZFJUUmVzIHhtbG5zOm5zMj0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi8iIHhtbG5zOm5zMz0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOm5zND0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi9wcHRoZWFkIiB4bWxuczpuczU9Imh0dHA6Ly93d3cuZGlnaXRwYS5nb3YuaXQvc2NoZW1hcy8yMDExL1BhZ2FtZW50aS8iIHhtbG5zOm5zNj0iaHR0cDovL3BhZ29wYS1hcGkucGFnb3BhLmdvdi5pdC9wYS9wYUZvck5vZGUueHNkIiB4bWxuczpuczc9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvcGFGb3JOb2RlIj4KCQkJPG91dGNvbWU+T0s8L291dGNvbWU+CgkJPC9uczY6cGFTZW5kUlRSZXM+Cgk8L3NvYXA6Qm9keT4KPC9zb2FwOkVudmVsb3BlPg==', +]; +Capsule::statement($render_query, $data_req); +Capsule::statement($render_query, $data_resp); + diff --git a/src/sql/05_2024_insert_data.sql b/src/sql/05_2024_insert_data.sql index 2c1f4d78..27f1dbbc 100644 --- a/src/sql/05_2024_insert_data.sql +++ b/src/sql/05_2024_insert_data.sql @@ -46,7 +46,9 @@ INSERT INTO mapped_events(tipo_evento,sotto_tipo_evento ,fk_event) values ('nodoChiediCopiaRT' , 'REQ' , 45), ('nodoChiediCopiaRT' , 'RESP', 46), ('paGetPayment' , 'REQ' , 47), - ('paGetPayment' , 'RESP', 48); + ('paGetPayment' , 'RESP', 48), + ('paSendRT' , 'REQ' , 49), + ('paSendRT' , 'RESP', 50); insert into mapped_payment_methods (tipoversamento, descrizione) values ('CC', 'Carta di Credito'), diff --git a/src/src/crawler/events/req/paSendRT.php b/src/src/crawler/events/req/paSendRT.php new file mode 100644 index 00000000..1fdde813 --- /dev/null +++ b/src/src/crawler/events/req/paSendRT.php @@ -0,0 +1,150 @@ +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->setEventId($this->getUniqueId()); + $workflow->setEventTimestamp($this->getInsertedTimestamp()); + if (!is_null($this->getStazione())) + { + $workflow->setStazione($this->getStazione()); + } + if (!is_null($this->getCanale())) + { + $workflow->setCanale($this->getCanale()); + } + if (!is_null($this->getPsp())) + { + $workflow->setPsp($this->getPsp()); + } + $workflow->setFkTipoEvento(MapEvents::getMethodId($this->getTipoEvento(), $this->getSottoTipoEvento())); + 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->getIuv(); + $pa_emittente = $this->getPaEmittente(); + + return sprintf('payment_%s_%s', $iuv, $pa_emittente); + } + + /** + * @inheritDoc + */ + public function getCacheKeyAttempt(int $index = 0): string|null + { + $iuv = $this->getIuv(); + $pa_emittente = $this->getPaEmittente(); + $token = $this->getPaymentToken(); + + return sprintf('attempt_%s_%s_%s', $iuv, $pa_emittente, $token); + } + + /** + * @inheritDoc + */ + public function getCacheKeyList(): array + { + $return = array(); + if (!is_null($this->getSessionId())) + { + $key = sprintf('session_id_%s_%s_%s', $this->getSessionId(), $this->getTipoEvento(), $this->getSottoTipoEvento()); + $return[] = $key; + } + if (!is_null($this->getPaymentToken())) + { + $key = sprintf('token_%s', $this->getPaymentToken()); + $return[] = $key; + } + return $return; + } +} \ No newline at end of file diff --git a/src/src/crawler/events/resp/paSendRT.php b/src/src/crawler/events/resp/paSendRT.php new file mode 100644 index 00000000..7b3e7e2b --- /dev/null +++ b/src/src/crawler/events/resp/paSendRT.php @@ -0,0 +1,167 @@ +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); + } + + if ($this->getMethodInterface()->isFaultEvent()) + { + $workflow->setFaultCode($this->getMethodInterface()->getFaultCode()); + } + if (!is_null($this->getMethodInterface()->outcome())) + { + $workflow->setOutcomeEvent($this->getMethodInterface()->outcome()); + } + 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->getIuv(); + $pa_emittente = $this->getPaEmittente(); + + return sprintf('payment_%s_%s', $iuv, $pa_emittente); + } + + /** + * @inheritDoc + */ + public function getCacheKeyAttempt(int $index = 0): string|null + { + $iuv = $this->getIuv(); + $pa_emittente = $this->getPaEmittente(); + $token = $this->getPaymentToken(); + + return sprintf('attempt_%s_%s_%s', $iuv, $pa_emittente, $token); + } + + /** + * @inheritDoc + */ + public function getCacheKeyList(): array + { + $return = array(); + if (!is_null($this->getSessionId())) + { + $key = sprintf('session_id_%s_%s_%s', $this->getSessionId(), $this->getTipoEvento(), $this->getSottoTipoEvento()); + $return[] = $key; + } + if (!is_null($this->getPaymentToken())) + { + $key = sprintf('token_%s', $this->getPaymentToken()); + $return[] = $key; + } + return $return; + } +} \ No newline at end of file diff --git a/src/src/crawler/methods/req/paSendRT.php b/src/src/crawler/methods/req/paSendRT.php new file mode 100644 index 00000000..4ca95a03 --- /dev/null +++ b/src/src/crawler/methods/req/paSendRT.php @@ -0,0 +1,37 @@ +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/paSendRT.php b/src/src/crawler/paymentlist/resp/paSendRT.php new file mode 100644 index 00000000..11b907ee --- /dev/null +++ b/src/src/crawler/paymentlist/resp/paSendRT.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/paSendRTTest.php b/src/tests/pagopa/events/req/paSendRTTest.php new file mode 100644 index 00000000..80d18b0f --- /dev/null +++ b/src/tests/pagopa/events/req/paSendRTTest.php @@ -0,0 +1,101 @@ +paSendRT = new paSendRT( + [ + 'date_event' => '2023-09-01', + 'inserted_timestamp' => '2023-09-01 07:37:50', + 'tipoevento' => 'paSendRT', + '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' => 'r0209430439039409209312014857300', + 'noticeNumber' => '301000000000000010', + 'creditorreferenceid' => '01000000000000010', + 'paymenttoken' => 'r0209430439039409209312014857300', + 'payload' => 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpjb21tb249Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQveHNkL2NvbW1vbi10eXBlcy92MS4wLjAvIiB4bWxuczpwYWZuPSJodHRwOi8vcGFnb3BhLWFwaS5wYWdvcGEuZ292Lml0L3BhL3BhRm9yTm9kZS54c2QiIHhtbG5zOnNvYXBlbnY9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIiB4bWxuczp0bnM9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvcGFGb3JOb2RlIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIj4KCTxzb2FwZW52OkJvZHk+CgkJPHBhZm46cGFTZW5kUlRSZXE+CgkJCTxpZFBBPjc3Nzc3Nzc3Nzc4PC9pZFBBPgoJCQk8aWRCcm9rZXJQQT43Nzc3Nzc3Nzc3NzwvaWRCcm9rZXJQQT4KCQkJPGlkU3RhdGlvbj43Nzc3Nzc3Nzc3N18wMTwvaWRTdGF0aW9uPgoJCQk8cmVjZWlwdD4KCQkJCTxyZWNlaXB0SWQ+cjAyMDk0MzA0MzkwMzk0MDkyMDkzMTIwMTQ4NTczMDA8L3JlY2VpcHRJZD4KCQkJCTxub3RpY2VOdW1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FuY2VJbmZvcm1hdGlvbj5yZW1pdHRhbmNlPC9yZW1pdHRhbmNlSW5mb3JtYXRpb24+CgkJCQkJCTx0cmFuc2ZlckNhdGVnb3J5Pnh4eHh4PC90cmFuc2ZlckNhdGVnb3J5PgoJCQkJCTwvdHJhbnNmZXI+CgkJCQk8L3RyYW5zZmVyTGlzdD4KCQkJCTxpZFBTUD5BR0lEXzAxPC9pZFBTUD4KCQkJCTxwc3BGaXNjYWxDb2RlPjg4ODg4ODg4ODg4PC9wc3BGaXNjYWxDb2RlPgoJCQkJPFBTUENvbXBhbnlOYW1lPkJhbmNhPC9QU1BDb21wYW55TmFtZT4KCQkJCTxpZENoYW5uZWw+ODg4ODg4ODg4ODhfMDE8L2lkQ2hhbm5lbD4KCQkJCTxjaGFubmVsRGVzY3JpcHRpb24+V0lTUDwvY2hhbm5lbERlc2NyaXB0aW9uPgoJCQkJPHBheW1lbnRNZXRob2Q+Q1A8L3BheW1lbnRNZXRob2Q+CgkJCQk8ZmVlPjAuNTA8L2ZlZT4KCQkJCTxwYXltZW50RGF0ZVRpbWU+MjAyNC0wNS0yMVQyMDoyNzozMzwvcGF5bWVudERhdGVUaW1lPgoJCQkJPGFwcGxpY2F0aW9uRGF0ZT4yMDI0LTA1LTIxPC9hcHBsaWNhdGlvbkRhdGU+CgkJCQk8dHJhbnNmZXJEYXRlPjIwMjQtMDUtMjI8L3RyYW5zZmVyRGF0ZT4KCQkJPC9yZWNlaXB0PgoJCTwvcGFmbjpwYVNlbmRSVFJlcT4KCTwvc29hcGVudjpCb2R5Pgo8L3NvYXBlbnY6RW52ZWxvcGU+' + ] + ); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $value = ['01000000000000010']; + $this->assertEquals($value, $this->paSendRT->getIuvs()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $value = ['r0209430439039409209312014857300']; + $this->assertEquals($value, $this->paSendRT->getCcps()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertEquals(1, $this->paSendRT->getPaymentsCount()); + } + + #[TestDox('workflowEvent()')] + public function testWorkflowEvent() + { + $workflow = $this->paSendRT->workflowEvent(0); + $this->assertEquals(MapEvents::getMethodId('paSendRT', 'REQ'), $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('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->paSendRT->getTransferCount()); + } + + #[TestDox('getMethodInterface()')] + public function testGetMethodInterface() + { + $this->assertInstanceOf(\pagopa\crawler\methods\req\paSendRT::class, $this->paSendRT->getMethodInterface()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $value = ['77777777777']; + $this->assertEquals($value, $this->paSendRT->getPaEmittenti()); + } + + #[TestDox('transaction()')] + public function testTransaction() + { + $this->assertNull($this->paSendRT->transaction()); + } +} diff --git a/src/tests/pagopa/events/resp/paSendRTTest.php b/src/tests/pagopa/events/resp/paSendRTTest.php new file mode 100644 index 00000000..cdbe86ab --- /dev/null +++ b/src/tests/pagopa/events/resp/paSendRTTest.php @@ -0,0 +1,110 @@ +paSendRT = new paSendRT( + [ + 'date_event' => '2023-09-01', + 'inserted_timestamp' => '2023-09-01 07:37:50', + 'tipoevento' => 'paSendRT', + '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' => 'r0209430439039409209312014857300', + 'noticeNumber' => '301000000000000010', + 'creditorreferenceid' => '01000000000000010', + 'paymenttoken' => 'r0209430439039409209312014857300', + 'payload' => 'PHNvYXA6RW52ZWxvcGUgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iPgoJPHNvYXA6Qm9keT4KCQk8bnM2OnBhU2VuZFJUUmVzIHhtbG5zOm5zMj0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi8iIHhtbG5zOm5zMz0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOm5zND0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi9wcHRoZWFkIiB4bWxuczpuczU9Imh0dHA6Ly93d3cuZGlnaXRwYS5nb3YuaXQvc2NoZW1hcy8yMDExL1BhZ2FtZW50aS8iIHhtbG5zOm5zNj0iaHR0cDovL3BhZ29wYS1hcGkucGFnb3BhLmdvdi5pdC9wYS9wYUZvck5vZGUueHNkIiB4bWxuczpuczc9Imh0dHA6Ly9wYWdvcGEtYXBpLnBhZ29wYS5nb3YuaXQvcGFGb3JOb2RlIj4KCQkJPG91dGNvbWU+T0s8L291dGNvbWU+CgkJPC9uczY6cGFTZW5kUlRSZXM+Cgk8L3NvYXA6Qm9keT4KPC9zb2FwOkVudmVsb3BlPg==' + ] + ); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $value = ['r0209430439039409209312014857300']; + $this->assertEquals($value, $this->paSendRT->getCcps()); + } + + #[TestDox('transactionDetails()')] + public function testTransactionDetails() + { + $this->assertNull($this->paSendRT->transactionDetails(0)); + } + + #[TestDox('workflowEvent()')] + public function testWorkflowEvent() + { + $workflow = $this->paSendRT->workflowEvent(0); + $this->assertEquals(MapEvents::getMethodId('paSendRT', 'RESP'), $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->assertEquals('OK', $workflow->getReadyColumnValue('outcome')); + + $this->assertNull($workflow->getReadyColumnValue('faultcode')); + + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $value = ['01000000000000010']; + $this->assertEquals($value, $this->paSendRT->getIuvs()); + + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $value = ['77777777777']; + $this->assertEquals($value, $this->paSendRT->getPaEmittenti()); + } + + #[TestDox('transaction()')] + public function testTransaction() + { + $this->assertNull($this->paSendRT->transaction()); + } + + #[TestDox('getMethodInterface()')] + public function testGetMethodInterface() + { + $this->assertInstanceOf(\pagopa\crawler\methods\resp\paSendRT::class, $this->paSendRT->getMethodInterface()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertEquals(1, $this->paSendRT->getPaymentsCount()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->paSendRT->getTransferCount()); + } +} diff --git a/src/tests/pagopa/methods/req/paSendRTTest.php b/src/tests/pagopa/methods/req/paSendRTTest.php new file mode 100644 index 00000000..12f40443 --- /dev/null +++ b/src/tests/pagopa/methods/req/paSendRTTest.php @@ -0,0 +1,217 @@ +receipt = new paSendRT(base64_decode('PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8c29hcGVudjpFbnZlbG9wZSB4bWxuczpjb21tb249Imh0dHA6Ly9wYWdvcGEtYXBpLnB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g4ODhfMDE8L2lkQ2hhbm5lbD4KCQkJCTxjaGFubmVsRGVzY3JpcHRpb24+V0lTUDwvY2hhbm5lbERlc2NyaXB0aW9uPgoJCQkJPHBheW1lbnRNZXRob2Q+Q1A8L3BheW1lbnRNZXRob2Q+CgkJCQk8ZmVlPjAuNTA8L2ZlZT4KCQkJCTxwYXltZW50RGF0ZVRpbWU+MjAyNC0wNS0yMVQyMDoyNzozMzwvcGF5bWVudERhdGVUaW1lPgoJCQkJPGFwcGxpY2F0aW9uRGF0ZT4yMDI0LTA1LTIxPC9hcHBsaWNhdGlvbkRhdGU+CgkJCQk8dHJhbnNmZXJEYXRlPjIwMjQtMDUtMjI8L3RyYW5zZmVyRGF0ZT4KCQkJPC9yZWNlaXB0PgoJCTwvcGFmbjpwYVNlbmRSVFJlcT4KCTwvc29hcGVudjpCb2R5Pgo8L3NvYXBlbnY6RW52ZWxvcGU+')); + } + + #[TestDox('getAllTokens()')] + public function testGetAllTokens() + { + $value = ['r0209430439039409209312014857300']; + $this->assertEquals($value, $this->receipt->getAllTokens()); + } + + #[TestDox('getTransferId()')] + public function testGetTransferId() + { + $this->assertNull($this->receipt->getTransferId()); + } + + #[TestDox('getPaymentMetaDataValue()')] + public function testGetPaymentMetaDataValue() + { + $this->assertNull($this->receipt->getPaymentMetaDataValue()); + } + + #[TestDox('getBrokerPsp()')] + public function testGetBrokerPsp() + { + $this->assertEquals('88888888888', $this->receipt->getBrokerPsp()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $value = ['77777777777']; + $this->assertEquals($value, $this->receipt->getPaEmittenti()); + } + + #[TestDox('getBrokerPa()')] + public function testGetBrokerPa() + { + $this->assertEquals('77777777777', $this->receipt->getBrokerPa()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $value = ['r0209430439039409209312014857300']; + $this->assertEquals($value, $this->receipt->getAllTokens()); + } + + #[TestDox('isValidPayload()')] + public function testIsValidPayload() + { + $this->assertTrue($this->receipt->isValidPayload()); + } + + #[TestDox('isBollo()')] + public function testIsBollo() + { + $this->assertFalse($this->receipt->isBollo()); + } + + #[TestDox('getPsp()')] + public function testGetPsp() + { + $this->assertEquals('AGID_01', $this->receipt->getPsp()); + } + + #[TestDox('getTransferMetaDataValue()')] + public function testGetTransferMetaDataValue() + { + $this->assertNull($this->receipt->getTransferMetaDataValue()); + } + + #[TestDox('getToken()')] + public function testGetToken() + { + $this->assertEquals('r0209430439039409209312014857300', $this->receipt->getToken()); + } + + #[TestDox('getCcp()')] + public function testGetCcp() + { + $this->assertEquals('r0209430439039409209312014857300', $this->receipt->getCcp()); + } + + #[TestDox('getAllNoticesNumbers()')] + public function testGetAllNoticesNumbers() + { + $value = ['301000000000000010']; + $this->assertEquals($value, $this->receipt->getAllNoticesNumbers()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertEquals(1, $this->receipt->getPaymentsCount()); + } + + #[TestDox('getPaEmittente()')] + public function testGetPaEmittente() + { + $this->assertEquals('77777777777', $this->receipt->getPaEmittente()); + } + + #[TestDox('getImporto()')] + public function testGetImporto() + { + $this->assertEquals(130.00, $this->receipt->getImporto()); + } + + #[TestDox('getTransferAmount()')] + public function testGetTransferAmount() + { + $this->assertNull($this->receipt->getTransferAmount()); + } + + #[TestDox('getTransferPa()')] + public function testGetTransferPa() + { + $this->assertNull($this->receipt->getTransferPa()); + } + + #[TestDox('getNoticeNumber()')] + public function testGetNoticeNumber() + { + $this->assertEquals('301000000000000010', $this->receipt->getNoticeNumber()); + } + + #[TestDox('outcome()')] + public function testOutcome() + { + $this->assertNull($this->receipt->outcome()); + } + + #[TestDox('getTransferIban()')] + public function testGetTransferIban() + { + $this->assertNull($this->receipt->getTransferIban()); + } + + #[TestDox('getPaymentMetaDataKey()')] + public function testGetPaymentMetaDataKey() + { + $this->assertNull($this->receipt->getPaymentMetaDataKey()); + } + + #[TestDox('getImportoTotale()')] + public function testGetImportoTotale() + { + $this->assertEquals(130.00, $this->receipt->getImportoTotale()); + } + + #[TestDox('getPaymentMetaDataCount()')] + public function testGetPaymentMetaDataCount() + { + $this->assertNull($this->receipt->getPaymentMetaDataCount()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $value = ['01000000000000010']; + $this->assertEquals($value, $this->receipt->getIuvs()); + } + + #[TestDox('getIuv()')] + public function testGetIuv() + { + $value = '01000000000000010'; + $this->assertEquals($value, $this->receipt->getIuv()); + } + + #[TestDox('getCanale()')] + public function testGetCanale() + { + $this->assertEquals('88888888888_01', $this->receipt->getCanale()); + } + + #[TestDox('getStazione()')] + public function testGetStazione() + { + $this->assertEquals('77777777777_01', $this->receipt->getStazione()); + } + + #[TestDox('getTransferMetaDataKey()')] + public function testGetTransferMetaDataKey() + { + $this->assertNull($this->receipt->getTransferMetaDataKey()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->receipt->getTransferCount()); + } + + #[TestDox('getTransferMetaDataCount()')] + public function testGetTransferMetaDataCount() + { + $this->assertNull($this->receipt->getTransferMetaDataCount()); + } +} diff --git a/src/tests/pagopa/methods/resp/paSendRTTest.php b/src/tests/pagopa/methods/resp/paSendRTTest.php new file mode 100644 index 00000000..2c6f2ce0 --- /dev/null +++ b/src/tests/pagopa/methods/resp/paSendRTTest.php @@ -0,0 +1,275 @@ +ok = new paSendRT(base64_decode('PHNvYXA6RW52ZWxvcGUgeG1sbnM6c29hcD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iPgoJPHNvYXA6Qm9keT4KCQk8bnM2OnBhU2VuZFJUUmVzIHhtbG5zOm5zMj0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi8iIHhtbG5zOm5zMz0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZlbG9wZS8iIHhtbG5zOm5zND0iaHR0cDovL3dzLnBhZ2FtZW50aS50ZWxlbWF0aWNpLmdvdi9w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DAwMDAwIHJpc3VsdMOgIGdpw6AgcGFnYXRvPC9kZXNjcmlwdGlvbj4KCQkJPC9mYXVsdD4KCQk8L3BhU2VuZFJUUmVzPgoJPC9zb2FwOkJvZHk+Cjwvc29hcDpFbnZlbG9wZT4=')); + } + + #[TestDox('getAllTokens()')] + public function testGetAllTokens() + { + $this->assertNull($this->ok->getAllTokens()); + $this->assertNull($this->fault->getAllTokens()); + } + + #[TestDox('getTransferId()')] + public function testGetTransferId() + { + $this->assertNull($this->ok->getTransferId()); + $this->assertNull($this->fault->getTransferId()); + } + + #[TestDox('getPaymentMetaDataValue()')] + public function testGetPaymentMetaDataValue() + { + $this->assertNull($this->ok->getPaymentMetaDataValue()); + $this->assertNull($this->fault->getPaymentMetaDataValue()); + } + + #[TestDox('getBrokerPsp()')] + public function testGetBrokerPsp() + { + $this->assertNull($this->ok->getBrokerPsp()); + $this->assertNull($this->fault->getBrokerPsp()); + } + + #[TestDox('getPaEmittenti()')] + public function testGetPaEmittenti() + { + $this->assertNull($this->ok->getPaEmittenti()); + $this->assertNull($this->fault->getPaEmittenti()); + } + + #[TestDox('getBrokerPa()')] + public function testGetBrokerPa() + { + $this->assertNull($this->ok->getBrokerPa()); + $this->assertNull($this->fault->getBrokerPa()); + } + + #[TestDox('getCcps()')] + public function testGetCcps() + { + $this->assertNull($this->ok->getCcps()); + $this->assertNull($this->fault->getCcps()); + } + + #[TestDox('getFaultDescription()')] + public function testGetFaultDescription() + { + $this->assertNull($this->ok->getFaultDescription()); + $this->assertEquals('01000000000000000 risultà già pagato', $this->fault->getFaultDescription()); + + } + + #[TestDox('isValidPayload()')] + public function testIsValidPayload() + { + $this->assertTrue($this->ok->isValidPayload()); + $this->assertTrue($this->fault->isValidPayload()); + } + + #[TestDox('isBollo()')] + public function testIsBollo() + { + $this->assertFalse($this->ok->isBollo()); + $this->assertFalse($this->fault->isBollo()); + } + + #[TestDox('getPsp()')] + public function testGetPsp() + { + $this->assertNull($this->ok->getPsp()); + $this->assertNull($this->fault->getPsp()); + } + + #[TestDox('getTransferMetaDataValue()')] + public function testGetTransferMetaDataValue() + { + $this->assertNull($this->ok->getTransferMetaDataValue()); + $this->assertNull($this->fault->getTransferMetaDataValue()); + } + + #[TestDox('getToken()')] + public function testGetToken() + { + $this->assertNull($this->ok->getToken()); + $this->assertNull($this->fault->getToken()); + } + + #[TestDox('getFaultString()')] + public function testGetFaultString() + { + $this->assertNull($this->ok->getFaultString()); + $this->assertEquals('La RT è già stata accettata', $this->fault->getFaultString()); + } + + #[TestDox('getCcp()')] + public function testGetCcp() + { + $this->assertNull($this->ok->getCcp()); + $this->assertNull($this->fault->getCcp()); + } + + #[TestDox('getAllNoticesNumbers()')] + public function testGetAllNoticesNumbers() + { + $this->assertNull($this->ok->getAllNoticesNumbers()); + $this->assertNull($this->fault->getAllNoticesNumbers()); + } + + #[TestDox('getPaEmittente()')] + public function testGetPaEmittente() + { + $this->assertNull($this->ok->getPaEmittente()); + $this->assertNull($this->fault->getPaEmittente()); + } + + #[TestDox('getImporto()')] + public function testGetImporto() + { + $this->assertNull($this->ok->getImporto()); + $this->assertNull($this->fault->getImporto()); + } + + #[TestDox('getFaultCode()')] + public function testGetFaultCode() + { + $this->assertNull($this->ok->getFaultCode()); + $this->assertEquals('PAA_RT_DUPLICATA', $this->fault->getFaultCode()); + } + + #[TestDox('getTransferAmount()')] + public function testGetTransferAmount() + { + $this->assertNull($this->ok->getTransferAmount()); + $this->assertNull($this->fault->getTransferAmount()); + } + + #[TestDox('isFaultEvent()')] + public function testIsFaultEvent() + { + $this->assertFalse($this->ok->isFaultEvent()); + $this->assertTrue($this->fault->isFaultEvent()); + } + + #[TestDox('getTransferPa()')] + public function testGetTransferPa() + { + $this->assertNull($this->ok->getTransferPa()); + $this->assertNull($this->fault->getTransferPa()); + } + + #[TestDox('getNoticeNumber()')] + public function testGetNoticeNumber() + { + $this->assertNull($this->ok->getNoticeNumber()); + $this->assertNull($this->fault->getNoticeNumber()); + } + + #[TestDox('outcome()')] + public function testOutcome() + { + $this->assertEquals('OK', $this->ok->outcome()); + $this->assertEquals('KO', $this->fault->outcome()); + } + + #[TestDox('getTransferIban()')] + public function testGetTransferIban() + { + $this->assertNull($this->ok->getTransferIban()); + $this->assertNull($this->fault->getTransferIban()); + } + + #[TestDox('getPaymentMetaDataKey()')] + public function testGetPaymentMetaDataKey() + { + $this->assertNull($this->ok->getPaymentMetaDataKey()); + $this->assertNull($this->fault->getPaymentMetaDataKey()); + } + + #[TestDox('getPaymentsCount()')] + public function testGetPaymentsCount() + { + $this->assertNull($this->ok->getPaymentsCount()); + $this->assertNull($this->fault->getPaymentsCount()); + } + + #[TestDox('getImportoTotale()')] + public function testGetImportoTotale() + { + $this->assertNull($this->ok->getImportoTotale()); + $this->assertNull($this->fault->getImportoTotale()); + } + + #[TestDox('getPaymentMetaDataCount()')] + public function testGetPaymentMetaDataCount() + { + $this->assertNull($this->ok->getPaymentMetaDataCount()); + $this->assertNull($this->fault->getPaymentMetaDataCount()); + } + + #[TestDox('getIuvs()')] + public function testGetIuvs() + { + $this->assertNull($this->ok->getIuvs()); + $this->assertNull($this->fault->getIuvs()); + } + + #[TestDox('getIuv()')] + public function testGetIuv() + { + $this->assertNull($this->ok->getIuv()); + $this->assertNull($this->fault->getIuv()); + } + + #[TestDox('getCanale()')] + public function testGetCanale() + { + $this->assertNull($this->ok->getCanale()); + $this->assertNull($this->fault->getCanale()); + } + + #[TestDox('getStazione()')] + public function testGetStazione() + { + $this->assertNull($this->ok->getStazione()); + $this->assertNull($this->fault->getStazione()); + } + + #[TestDox('getTransferMetaDataKey()')] + public function testGetTransferMetaDataKey() + { + $this->assertNull($this->ok->getTransferMetaDataKey()); + $this->assertNull($this->fault->getTransferMetaDataKey()); + } + + #[TestDox('getTransferCount()')] + public function testGetTransferCount() + { + $this->assertNull($this->ok->getTransferCount()); + $this->assertNull($this->fault->getTransferCount()); + } + + #[TestDox('getTransferMetaDataCount()')] + public function testGetTransferMetaDataCount() + { + $this->assertNull($this->ok->getTransferMetaDataCount()); + $this->assertNull($this->fault->getTransferMetaDataCount()); + } +} diff --git a/src/tests/phpunit.xml b/src/tests/phpunit.xml index 82fe82cb..60a2a576 100644 --- a/src/tests/phpunit.xml +++ b/src/tests/phpunit.xml @@ -26,7 +26,7 @@ - process/crawler/paGetPayment/T00068_WorkflowWithpaGetPayment.php + process/crawler/paSendRT/T00069_WorkflowWithpaSendRT.php process/crawler/activatePaymentNotice/SingleEvent/T00001_CreateAttemptAllInfoInEvent.php @@ -88,6 +88,7 @@ process/crawler/nodoInoltraPagamentoMod1/T00066_WorkflowWithInoltroPagamentoMod1.php process/crawler/nodoChiediCopiaRT/T00067_WorkflowWithNodoChiediCopiaRT.php process/crawler/paGetPayment/T00068_WorkflowWithpaGetPayment.php + process/crawler/paSendRT/T00069_WorkflowWithpaSendRT.php @@ -119,6 +120,7 @@ pagopa/methods/req/nodoInoltraPagamentoMod1Test.php pagopa/methods/req/nodoChiediCopiaRTTest.php pagopa/methods/req/paGetPaymentTest.php + pagopa/methods/req/paSendRTTest.php pagopa/methods/resp/activatePaymentNoticeTest.php @@ -145,6 +147,7 @@ pagopa/methods/resp/nodoInoltraPagamentoMod1Test.php pagopa/methods/resp/nodoChiediCopiaRTTest.php pagopa/methods/resp/paGetPaymentTest.php + pagopa/methods/resp/paSendRTTest.php @@ -172,6 +175,7 @@ pagopa/events/req/nodoInoltraPagamentoMod1Test.php pagopa/events/req/nodoChiediCopiaRTTest.php pagopa/events/req/paGetPaymentTest.php + pagopa/events/req/paSendRTTest.php pagopa/events/resp/activatePaymentNoticeTest.php @@ -197,6 +201,7 @@ pagopa/events/resp/nodoInoltraPagamentoMod1Test.php pagopa/events/resp/nodoChiediCopiaRTTest.php pagopa/events/resp/paGetPaymentTest.php + pagopa/events/resp/paSendRTTest.php process/normal/T0001.php diff --git a/src/tests/process/crawler/paGetPayment/T00068_WorkflowWithpaGetPayment.php b/src/tests/process/crawler/paGetPayment/T00068_WorkflowWithpaGetPayment.php index 6f67e384..65e4055f 100644 --- a/src/tests/process/crawler/paGetPayment/T00068_WorkflowWithpaGetPayment.php +++ b/src/tests/process/crawler/paGetPayment/T00068_WorkflowWithpaGetPayment.php @@ -6,7 +6,7 @@ use PHPUnit\Framework\Attributes\TestDox; use PHPUnit\Framework\TestCase; -#[TestDox('[T00068] Valuta un workflow con la nodoChiediCopiaRT')] +#[TestDox('[T00068] Valuta un workflow con la paGetPayment')] class T00068_WorkflowWithpaGetPayment extends TestCase { protected static \GetInfoFromDb $db; diff --git a/src/tests/process/crawler/paSendRT/T00069_WorkflowWithpaSendRT.php b/src/tests/process/crawler/paSendRT/T00069_WorkflowWithpaSendRT.php new file mode 100644 index 00000000..9020ffbe --- /dev/null +++ b/src/tests/process/crawler/paSendRT/T00069_WorkflowWithpaSendRT.php @@ -0,0 +1,165 @@ +getTransaction(new \DateTime('2024-03-10'), '01000000000000260'); + $this->assertEquals('2024-03-10 10:40:00.197', $transaction->getColumnValue('inserted_timestamp')); + $this->assertEquals('01000000000000260', $transaction->getColumnValue('iuv')); + $this->assertEquals('77777777777', $transaction->getColumnValue('pa_emittente')); + $this->assertEquals('t0000000000000000000000000000260', $transaction->getColumnValue('token_ccp')); + $this->assertEquals('130.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('TOUCHPOINT_PSP', $transaction->getColumnValue('touchpoint')); + $this->assertEquals('OK', $transaction->getColumnValue('esito')); + $this->assertNull($transaction->getColumnValue('id_carrello')); + } + + + #[TestDox('[DETAILS] Verifica assenza dettagli')] + public function testTransactionDetails() + { + $transaction = self::$db->getTransaction(new \DateTime('2024-03-10'), '01000000000000260' ); + + $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('130.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'), '01000000000000260'); + + $workflow = self::$db->getWorkFlow($transaction, 0); + $this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'REQ'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 10:40:00.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000262', $workflow->getColumnValue('event_id')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertNull($workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 1); + $this->assertEquals(MapEvents::getMethodId('paGetPayment', 'REQ'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 10:40:02.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000264', $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, 2); + $this->assertEquals(MapEvents::getMethodId('paGetPayment', 'RESP'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 10:40:05.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000265', $workflow->getColumnValue('event_id')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('OK', $workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 3); + $this->assertEquals(MapEvents::getMethodId('activatePaymentNotice', 'RESP'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 10:40:10.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000263', $workflow->getColumnValue('event_id')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('OK', $workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 4); + $this->assertEquals(MapEvents::getMethodId('sendPaymentOutcome', 'REQ'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 10:41:02.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000266', $workflow->getColumnValue('event_id')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertEquals('OK', $workflow->getColumnValue('outcome')); + + $workflow = self::$db->getWorkFlow($transaction, 5); + $this->assertEquals(MapEvents::getMethodId('sendPaymentOutcome', 'RESP'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 10:41:05.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000267', $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(MapEvents::getMethodId('paSendRT', 'REQ'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 10:42:02.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000268', $workflow->getColumnValue('event_id')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $this->assertEquals('77777777777_01', $workflow->getColumnValue('stazione')); + $this->assertNull($workflow->getColumnValue('outcome')); + + + $workflow = self::$db->getWorkFlow($transaction, 7); + $this->assertEquals(MapEvents::getMethodId('paSendRT', 'RESP'), $workflow->getColumnValue('fk_tipoevento')); + $this->assertEquals('2024-03-10 10:42:05.197', $workflow->getColumnValue('event_timestamp')); + $this->assertEquals('T000269', $workflow->getColumnValue('event_id')); + $this->assertEquals('88888888888_01', $workflow->getColumnValue('canale')); + $this->assertEquals('AGID_01', $workflow->getColumnValue('id_psp')); + $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'), 262); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 263); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 264); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 265); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 266); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 267); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 268); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + $event = self::$db->getReEvent(new \DateTime('2024-03-10'), 269); + $this->assertEquals('LOADED', $event->getColumnValue('state')); + + + } + +}