{"id":22727528,"url":"https://github.com/pagopa/pagopa-mock-ec","last_synced_at":"2025-03-30T00:25:01.631Z","repository":{"id":37933206,"uuid":"370312548","full_name":"pagopa/pagopa-mock-ec","owner":"pagopa","description":"Mock PA ec-services for PSP (see here  to Payment process https://pagopa.github.io/pagopa-api/indexPA.html)","archived":false,"fork":false,"pushed_at":"2025-03-21T11:06:26.000Z","size":1518,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-21T11:32:32.534Z","etag":null,"topics":["pagopa-shared"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pagopa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-24T10:24:53.000Z","updated_at":"2024-09-12T09:36:15.000Z","dependencies_parsed_at":"2023-02-17T23:15:57.692Z","dependency_job_id":"e2f3710e-e751-4bee-aba3-a42fc66758a3","html_url":"https://github.com/pagopa/pagopa-mock-ec","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pagopa%2Fpagopa-mock-ec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pagopa%2Fpagopa-mock-ec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pagopa%2Fpagopa-mock-ec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pagopa%2Fpagopa-mock-ec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pagopa","download_url":"https://codeload.github.com/pagopa/pagopa-mock-ec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246261360,"owners_count":20749014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pagopa-shared"],"created_at":"2024-12-10T17:12:29.014Z","updated_at":"2025-03-30T00:25:01.601Z","avatar_url":"https://github.com/pagopa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pagopa-mock-ec\n\nA mock implementation of PA pagoPA service\n\n- [pagopa-mock-ec](#pagopa-mock-ec)\n  - [Glossary](#glossary)\n  - [Usage](#usage)\n  - [Prerequisites](#prerequisites)\n  - [Functionalities](#functionalities)\n  - [Tribute description](#tribute-description)\n\n## Glossary\n\n| Acronym | Description          |\n| ------- | -------------------- |\n| EC      | Creditor institution |\n| CCPost  | Postal account       |\n| CCBank  | Bank account         |\n\n\u003cbr\u003e\n\n## Usage\n\n## Prerequisites\n\nTo be able to use as PSP the following `pagopa-mock-ec` remebers to configure in your requests :\n\n- PSP [Identification and Authentication](https://pagopa.github.io/pagopa-api/#section/Introduction/Identification-and-Authentication)\n- as EC the `77777777777` fiscalCode\n- as `noticeNumber` one of those described in to below section [Tribute description](#tribute-description)\n\n## Functionalities\n\nThe following functionalites are available (EC Side)\n\n\u003e (_see [here](https://pagopa.github.io/pagopa-api/indexPA.html) to details_)\n\n- _paVerifyPaymentNotice_\n- _paGetPayment_\n- _paSendRT_\n\nThese mock functionalities allows the PSP to invoke all the payment steps\n\n\u003e (_see [here](https://pagopa.github.io/pagopa-api/) to details_)\n\n- _verifyPaymentNotice_ or _verificaBollettino_\n- _activatePaymentNotice_\n- _sendPaymentOutcome_\n\n## Tribute description\n\nBoth EC have at their disposal a bank IBAN and a postal IBAN.\nBased on notice number the mock will reply with a certain configuration of the tribute.\n\n### Tribute 1\n\nThe tribute is 120 EUR divided in 2 transfers:\n\n- Transfer 1 : TARI, 100€ due to **EC_TE**\n- Transfer 2 : TEFA, 20€ due to **Comune di Milano**\n\n| Notice number        | CC EC_TE | CC Comune di Milano | Notes                          |\n| -------------------- | -------- | ------------------- | ------------------------------ |\n| 302**00**xxxxxxxxxxx | CCPost   | CCPost              | multibeneficiary (TARI + TEFA) |\n| 302**01**xxxxxxxxxxx | CCPost   | CCBank              | multibeneficiary (TARI + TEFA) |\n| 302**02**xxxxxxxxxxx | CCBank   | CCPost              | multibeneficiary (TARI + TEFA) |\n| 302**03**xxxxxxxxxxx | CCBank   | CCBank              | multibeneficiary (TARI + TEFA) |\n\n### Tribute 2\n\nThe tribute is 100 EUR in a single transfers:\n\n- Transfer 1 : TARI, 100€ due to **EC_TE**\n\n| Notice number        | CC EC_TE | Notes                  |\n| -------------------- | -------- | ---------------------- |\n| 302**04**xxxxxxxxxxx | CCPost   | monobeneficiary (TARI) |\n| 302**05**xxxxxxxxxxx | CCBank   | monobeneficiary (TARI) |\n\n### Tribute 3\n\nThe tribute is 100 EUR divided in 2 transfers:\n\n- Transfer 1 : TARI, 70€ due to **EC_TE**\n- Transfer 2 : TEFA, 30€ due to **Comune di Milano**\n\n| Notice number        | CC EC_TE | CC Comune di Milano | Notes                          |\n| -------------------- | -------- | ------------------- | ------------------------------ |\n| 302**06**xxxxxxxxxxx | CCPost   | CCPost              | multibeneficiary (TARI + TEFA) |\n| 302**07**xxxxxxxxxxx | CCPost   | CCBank              | multibeneficiary (TARI + TEFA) |\n| 302**08**xxxxxxxxxxx | CCBank   | CCPost              | multibeneficiary (TARI + TEFA) |\n| 302**09**xxxxxxxxxxx | CCBank   | CCBank              | multibeneficiary (TARI + TEFA) |\n\n### Tribute 4\n\nThe tribute is 70 EUR in a single transfer:\n\n- Transfer 1 : TARI, 70€ due to **EC_TE**\n\n| Notice number        | CC EC_TE | Notes                  |\n| -------------------- | -------- | ---------------------- |\n| 302**10**xxxxxxxxxxx | CCPost   | monobeneficiary (TARI) |\n| 302**11**xxxxxxxxxxx | CCBank   | monobeneficiary (TARI) |\n\n### Tribute 5\n\nThe tribute is 6000 EUR divided in 2 transfers:\n\n- Transfer 1 : TARI, 4000€ due to **EC_TE**\n- Transfer 2 : TEFA, 2000€ due to **Comune di Milano**\n\n| Notice number        | CC EC_TE | CC Comune di Milano | Notes                          |\n| -------------------- | -------- | ------------------- | ------------------------------ |\n| 302**12**xxxxxxxxxxx | CCPost   | CCBank              | multibeneficiary (TARI + TEFA) |\n\n### Tribute 6\n\nThe tribute is 0.30 EUR divided in 2 transfers:\n\n- Transfer 1 : TARI, 0.10€ due to **EC_TE**\n- Transfer 2 : TEFA, 0.20€ due to **Comune di Milano**\n\n| Notice number        | CC EC_TE | CC Comune di Milano | Notes                          |\n| -------------------- | -------- | ------------------- | ------------------------------ |\n| 302**13**xxxxxxxxxxx | CCPost   | CCBank              | multibeneficiary (TARI + TEFA) |\n\n### Tribute 7\n\nThe amount of the tribute is 120€ and divided in 3 transfers:\n\n- Transfer 1 : 70€ due to **EC_TE**\n- Transfer 2 : 30€ due to **Comune di Milano**\n- Transfer 3 : 20€ due to **Comune di Bitetto**\n\n| Notice number        | CC EC_TE | CC Comune di Milano | Comune di Bitetto |\n| -------------------- | -------- | ------------------- | ----------------- |\n| 302**14**xxxxxxxxxxx | CCPost   | CCBank              | CCBank            |\n\n### Tribute 8\n\nThe amount of the tribute is 120€ and divided in 4 transfers:\n\n- Transfer 1 : 70€ due to **EC_TE**\n- Transfer 2 : 30€ due to **Comune di Milano**\n- Transfer 3 : 10€ due to **Comune di Bitetto**\n- Transfer 4 : 10€ due to **Comune di Milano**\n\n| Notice number        | CC EC_TE | CC Comune di Milano (1) | Comune di Bitetto | CC Comune di Milano (2) |\n| -------------------- | -------- | ----------------------- | ----------------- | ----------------------- |\n| 302**15**xxxxxxxxxxx | CCPost   | CCBank                  | CCBank            | CCBank                  |\n\n### Tribute 9\n\nThe amount of the tribute is is 120€ and divided in 5 transfers: \n\n- Transfer 1 : 70€ due to **EC_TE**\n- Transfer 2 : 30€ due to **Comune di Milano**\n- Transfer 3 : 10€ due to **Comune di Bitetto**\n- Transfer 4 : 5€ due to **Comune di Milano**\n- Transfer 5 : 5€ due to **Comune di Milano**\n\n| Notice number        | CC EC_TE | CC Comune di Milano (1) | Comune di Bitetto | CC Comune di Milano (2) | CC Comune di Milano (3) |\n| -------------------- | -------- | ----------------------- | ----------------- | ----------------------- | ----------------------- |\n| 302**16**xxxxxxxxxxx | CCPost   | CCBank                  | CCBank            | CCBank                  | CCBank                  |\n\n### Tribute 10\n\nThe tribute is 120.00 EUR divided in 2 transfers:\n- Transfer 1 : 0101101IM, 100.00€ due to **EC_TE**\n- Transfer 2 : 0201102IM, 20.00€ due to **EC_TE**\n\n| Notice number        | CC EC_TE | CC EC_TE |\n| -------------------- | -------- | -------- |\n| 302**17**xxxxxxxxxxx | CCPost   | CCPost   |\n| 302**21**xxxxxxxxxxx | CCPost   | CCBank   |\n\n### Tribute 11\n\nThe amount of the tribute is 120€ and divided in 3 transfers:\n\n- Transfer 1 : 70€ due to **EC_TE**\n- Transfer 2 : 30€ due to **EC_TE**\n- Transfer 3 : 20€ due to **EC_TE**\n\n| Notice number        | CC EC_TE | CC EC_TE | CC EC_TE|\n| -------------------- | -------- | ---------| --------|\n| 302**19**xxxxxxxxxxx | CCBank   | CCBank   | CCPost  |\n| 302**22**xxxxxxxxxxx | CCPost   | CCPost   | CCBank  |\n\n### Tribute 12\n\nThe amount of the tribute is 120€ and divided in 3 transfers:\n\n- Transfer 1 : 70€ due to **EC_TE**\n- Transfer 2 : 30€ due to **EC_TE**\n- Transfer 3 : 20€ due to **EC_TE**\n\nIt is the same as tribute 11, with the exception that the returned `companyName` is 140 characters long\n\n| Notice number        | CC EC_TE | CC EC_TE | CC EC_TE|\n| -------------------- | -------- | ---------| --------|\n| 302**23**xxxxxxxxxxx | CCBank   | CCBank   | CCPost  |\n\n### Tribute 13\n\nThe tribute is 120.00 EUR divided in 2 transfers:\n- Transfer 1 : Oneri SUAP 1, 100.00€ due to **Comune di Milano**\n- Transfer 2 : Oneri SUAP 2, 20.00€ due to **Comune di Bitetto**\n\n| Notice number        | CC Comune di Milano | CC Comune di Bitetto |\n| -------------------- | ------------------- | -------------------- |\n| 302**18**xxxxxxxxxxx | CCPost              | CCBank               |\n\n### Tribute 14\n\nThe tribute is 120.00 EUR divided in 2 transfers:\n- Transfer 1 : Oneri SUAP 1, 100.00€ due to **Comune di Milano**\n- Transfer 2 : Oneri SUAP 2, 20.00€ due to **Comune di Milano**\n\n| Notice number        | CC Comune di Milano | CC Comune di Milano |\n| -------------------- | ------------------- | -------------------- |\n| 302**20**xxxxxxxxxxx | CCPost              | CCBank               |\n\n### Tribute 15\n\nSame as Tribute 10, but with a returned `dueDate` with XSD format (e.g. `2024-10-05+02:00`).\n\nThe tribute is 120.00 EUR divided in 2 transfers:\n- Transfer 1 : 0101101IM, 100.00€ due to **EC_TE**\n- Transfer 2 : 0201102IM, 20.00€ due to **EC_TE**\n\n| Notice number        | CC Comune di Milano | CC Comune di Milano |\n| -------------------- | ------------------- | -------------------- |\n| 302**24**xxxxxxxxxxx | CCPost              | CCBank               |\n\n\n### Edge cases\n\nThe following edge cases are available (stateless, based on notice number)\n\n| Notice number        | Description                                          |\n| -------------------- | ---------------------------------------------------- |\n| 302**95**xxxxxxxxxxx | Notice already paid                                  |\n| 302**96**xxxxxxxxxxx | EC is returning a response with a syntax error       |\n| 302**97**xxxxxxxxxxx | EC Station not reacheable                            |\n| 302**98**xxxxxxxxxxx | EC Station timeout                                   |\n| 302**99**xxxxxxxxxxx | Payment expired                                      |\n| 302**YY**xxxxxxxxxxx | Payment unknown                                      |\n\n**_NOTE:_** YY: every code not mentioned before -\u003e from 17 to 94\n\n\u003cbr\u003e\n\u003c!-- \n## Certificate creation :\n\n### generate private key and CSR\n\n```sh\nopenssl req -new -config cert_config.cfg -newkey rsa:2048 -nodes -keyout mockecservice.key -out mockecservice.csr\n```\n\n### verify the information contained in the CSR\n\n```sh\nopenssl req -noout -text -in mockecservice.csr\n\n```\n\n### create pfx file for azure\n\n```sh\nopenssl pkcs12 -export -out mockecservice.pfx -inkey mockecservice.key -in mockecservice.crt\n```\n\nThen [Import a certificate using Azure CLI](https://docs.microsoft.com/en-us/azure/key-vault/certificates/tutorial-import-certificate#import-a-certificate-using-azure-cli)\n\n## Developer section 💻\n\nThis _optional_ section is usefull if you want run `pagopa-mock-ec` locally 🚀\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick to expand!\u003c/summary\u003e\n\n\u003e **NOTE** : you can customize partial mock information using `.env.example`. To do that typing `cp .env.example .env` and changes the info you deem appropriate\n\n### Prerequisites\n\n- [yarn](https://yarnpkg.com/) installed\n\n```sh\nyarn install\nyarn build \u0026\u0026 yarn start\n```\n\n### Environment\n\n| name              | description                 | default            |\n| ----------------- | --------------------------- | ------------------ |\n| WINSTON_LOG_LEVEL | desired log level           | `debug`            |\n| PAGOPA_NODO_HOST  | host this server listens to | `http://localhost` |\n| PORT              | host this server listens to | 8080               |\n| BASE_PATH         | `host:port\\\u003cBASE_PATH\u003e`     | `mockEcService`    |\n\n### Check mockEcService 🧪\n\nFrom `resources` folder run script `./run_all_mock_scenarios.sh` to execute all scenario.\n\nOtherwise if you just want to see if everything is up run typing the following command on a terminal\n\n\u003e always from `resources` folder\n\n```sh\ncurl -H \"Content-Type: text/xml; charset=utf-8\" -H \"SOAPAction:paVerifyPaymentNoticeReq\"  -d @paVerifyPaymentNoticeReq_avv1.xml -X POST http://localhost:8089/mockEcService\n```\n\nif all rights you'd see something like that 👍\n\n```xml\n\u003csoapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:paf=\"http://pagopa-api.pagopa.gov.it/pa/paForNode.xsd\"\u003e\n  \u003csoapenv:Header /\u003e\n  \u003csoapenv:Body\u003e\n    \u003cpaf:paVerifyPaymentNoticeRes\u003e\n      \u003coutcome\u003eOK\u003c/outcome\u003e\n      \u003cpaymentList\u003e\n        \u003cpaymentOptionDescription\u003e\n          \u003camount\u003e120.00\u003c/amount\u003e\n          \u003coptions\u003eEQ\u003c/options\u003e\n          \u003cdueDate\u003e2021-07-31\u003c/dueDate\u003e\n          \u003cdetailDescription\u003epagamentoTest\u003c/detailDescription\u003e\n          \u003callCCP\u003etrue\u003c/allCCP\u003e\n        \u003c/paymentOptionDescription\u003e\n      \u003c/paymentList\u003e\n      \u003cpaymentDescription\u003ePagamento di Test\u003c/paymentDescription\u003e\n      \u003cfiscalCodePA\u003e77777777777\u003c/fiscalCodePA\u003e\n      \u003ccompanyName\u003ecompanyName\u003c/companyName\u003e\n      \u003cofficeName\u003eofficeName\u003c/officeName\u003e\n    \u003c/paf:paVerifyPaymentNoticeRes\u003e\n  \u003c/soapenv:Body\u003e\n\u003c/soapenv:Envelope\u003e\n```\n\n\u003c/details\u003e --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpagopa%2Fpagopa-mock-ec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpagopa%2Fpagopa-mock-ec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpagopa%2Fpagopa-mock-ec/lists"}