From a3cbc9b0ffd3d37593167cb5b7717781b34f2cbf Mon Sep 17 00:00:00 2001 From: berezkin88 Date: Mon, 13 Sep 2021 11:44:08 +0300 Subject: [PATCH 01/10] Start next iteration with 0.1.16-SNAPSHOT --- adapters/adorsys-adapter/pom.xml | 2 +- adapters/comdirect-adapter/pom.xml | 2 +- adapters/commerzbank-adapter/pom.xml | 2 +- adapters/consors-bank-adapter/pom.xml | 2 +- adapters/crealogix-adapter/pom.xml | 2 +- adapters/dab-bank-adapter/pom.xml | 2 +- adapters/deutsche-bank-adapter/pom.xml | 2 +- adapters/fiducia-adapter/pom.xml | 2 +- adapters/ing-adapter/pom.xml | 2 +- adapters/olb-adapter/pom.xml | 2 +- adapters/pom.xml | 2 +- adapters/santander-adapter/pom.xml | 2 +- adapters/sparda-bank-adapter/pom.xml | 2 +- adapters/sparkasse-adapter/pom.xml | 2 +- adapters/unicredit-adapter/pom.xml | 2 +- adapters/verlag-adapter/pom.xml | 2 +- pom.xml | 2 +- xs2a-adapter-app/pom.xml | 2 +- xs2a-adapter-aspsp-registry/pom.xml | 2 +- xs2a-adapter-generated-api/pom.xml | 2 +- xs2a-adapter-generated-rest-api/pom.xml | 2 +- xs2a-adapter-rest-api/pom.xml | 2 +- xs2a-adapter-rest-impl/pom.xml | 2 +- xs2a-adapter-rest2api-mapper/pom.xml | 2 +- xs2a-adapter-service-api/pom.xml | 2 +- xs2a-adapter-service-impl/pom.xml | 2 +- xs2a-adapter-service-loader/pom.xml | 2 +- xs2a-adapter-service-remote/pom.xml | 2 +- xs2a-adapter-test/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/adapters/adorsys-adapter/pom.xml b/adapters/adorsys-adapter/pom.xml index 4405b5eaf..a0790bcd3 100644 --- a/adapters/adorsys-adapter/pom.xml +++ b/adapters/adorsys-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/comdirect-adapter/pom.xml b/adapters/comdirect-adapter/pom.xml index 729e540fe..b18f52f9f 100644 --- a/adapters/comdirect-adapter/pom.xml +++ b/adapters/comdirect-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/commerzbank-adapter/pom.xml b/adapters/commerzbank-adapter/pom.xml index 56c44789e..9e7acb1be 100644 --- a/adapters/commerzbank-adapter/pom.xml +++ b/adapters/commerzbank-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/consors-bank-adapter/pom.xml b/adapters/consors-bank-adapter/pom.xml index 473d5c6f7..31bff64f5 100644 --- a/adapters/consors-bank-adapter/pom.xml +++ b/adapters/consors-bank-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/crealogix-adapter/pom.xml b/adapters/crealogix-adapter/pom.xml index e7cb0e9c6..437251e33 100644 --- a/adapters/crealogix-adapter/pom.xml +++ b/adapters/crealogix-adapter/pom.xml @@ -5,7 +5,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/dab-bank-adapter/pom.xml b/adapters/dab-bank-adapter/pom.xml index 955309845..171c1cf7f 100644 --- a/adapters/dab-bank-adapter/pom.xml +++ b/adapters/dab-bank-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/deutsche-bank-adapter/pom.xml b/adapters/deutsche-bank-adapter/pom.xml index e027b7825..f5ab0afdc 100644 --- a/adapters/deutsche-bank-adapter/pom.xml +++ b/adapters/deutsche-bank-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/fiducia-adapter/pom.xml b/adapters/fiducia-adapter/pom.xml index c0e4dca82..09a4c1cf1 100644 --- a/adapters/fiducia-adapter/pom.xml +++ b/adapters/fiducia-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/ing-adapter/pom.xml b/adapters/ing-adapter/pom.xml index 7bf95e5b4..cfff94bcd 100644 --- a/adapters/ing-adapter/pom.xml +++ b/adapters/ing-adapter/pom.xml @@ -8,7 +8,7 @@ xs2a-adapter de.adorsys.xs2a.adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/olb-adapter/pom.xml b/adapters/olb-adapter/pom.xml index 385b5444c..35e222ed8 100644 --- a/adapters/olb-adapter/pom.xml +++ b/adapters/olb-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/pom.xml b/adapters/pom.xml index 3cba6d24d..69b438d9d 100644 --- a/adapters/pom.xml +++ b/adapters/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/adapters/santander-adapter/pom.xml b/adapters/santander-adapter/pom.xml index 0bb5fec26..e2e2d2625 100644 --- a/adapters/santander-adapter/pom.xml +++ b/adapters/santander-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/sparda-bank-adapter/pom.xml b/adapters/sparda-bank-adapter/pom.xml index 9a606188b..c9705fe1f 100644 --- a/adapters/sparda-bank-adapter/pom.xml +++ b/adapters/sparda-bank-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/sparkasse-adapter/pom.xml b/adapters/sparkasse-adapter/pom.xml index 9880d171f..594e9f350 100644 --- a/adapters/sparkasse-adapter/pom.xml +++ b/adapters/sparkasse-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/unicredit-adapter/pom.xml b/adapters/unicredit-adapter/pom.xml index 9568120da..b6cbc1e62 100644 --- a/adapters/unicredit-adapter/pom.xml +++ b/adapters/unicredit-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/adapters/verlag-adapter/pom.xml b/adapters/verlag-adapter/pom.xml index da52c95c3..80afc0854 100644 --- a/adapters/verlag-adapter/pom.xml +++ b/adapters/verlag-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT ../.. diff --git a/pom.xml b/pom.xml index 201acb1e3..93f0c6b17 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT pom xs2a-adapter diff --git a/xs2a-adapter-app/pom.xml b/xs2a-adapter-app/pom.xml index 031eae9f1..eb061f857 100644 --- a/xs2a-adapter-app/pom.xml +++ b/xs2a-adapter-app/pom.xml @@ -14,7 +14,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/xs2a-adapter-aspsp-registry/pom.xml b/xs2a-adapter-aspsp-registry/pom.xml index 3fc61c78b..51a308f05 100644 --- a/xs2a-adapter-aspsp-registry/pom.xml +++ b/xs2a-adapter-aspsp-registry/pom.xml @@ -8,7 +8,7 @@ xs2a-adapter de.adorsys.xs2a.adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/xs2a-adapter-generated-api/pom.xml b/xs2a-adapter-generated-api/pom.xml index eb5000381..4997d90bd 100644 --- a/xs2a-adapter-generated-api/pom.xml +++ b/xs2a-adapter-generated-api/pom.xml @@ -6,7 +6,7 @@ xs2a-adapter de.adorsys.xs2a.adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/xs2a-adapter-generated-rest-api/pom.xml b/xs2a-adapter-generated-rest-api/pom.xml index ef7f4591a..6d7259715 100644 --- a/xs2a-adapter-generated-rest-api/pom.xml +++ b/xs2a-adapter-generated-rest-api/pom.xml @@ -8,7 +8,7 @@ xs2a-adapter de.adorsys.xs2a.adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/xs2a-adapter-rest-api/pom.xml b/xs2a-adapter-rest-api/pom.xml index df7a8fa5c..981093f84 100644 --- a/xs2a-adapter-rest-api/pom.xml +++ b/xs2a-adapter-rest-api/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/xs2a-adapter-rest-impl/pom.xml b/xs2a-adapter-rest-impl/pom.xml index 25c847196..7bb53e619 100644 --- a/xs2a-adapter-rest-impl/pom.xml +++ b/xs2a-adapter-rest-impl/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/xs2a-adapter-rest2api-mapper/pom.xml b/xs2a-adapter-rest2api-mapper/pom.xml index 5c96ede0c..48b115e9d 100644 --- a/xs2a-adapter-rest2api-mapper/pom.xml +++ b/xs2a-adapter-rest2api-mapper/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/xs2a-adapter-service-api/pom.xml b/xs2a-adapter-service-api/pom.xml index f2f69968e..ebdada5bb 100644 --- a/xs2a-adapter-service-api/pom.xml +++ b/xs2a-adapter-service-api/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/xs2a-adapter-service-impl/pom.xml b/xs2a-adapter-service-impl/pom.xml index 7dcad94c5..668fed6f0 100644 --- a/xs2a-adapter-service-impl/pom.xml +++ b/xs2a-adapter-service-impl/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/xs2a-adapter-service-loader/pom.xml b/xs2a-adapter-service-loader/pom.xml index 68f110993..c82e818cd 100644 --- a/xs2a-adapter-service-loader/pom.xml +++ b/xs2a-adapter-service-loader/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/xs2a-adapter-service-remote/pom.xml b/xs2a-adapter-service-remote/pom.xml index fd9441dd1..402030094 100644 --- a/xs2a-adapter-service-remote/pom.xml +++ b/xs2a-adapter-service-remote/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.15 + 0.1.16-SNAPSHOT .. diff --git a/xs2a-adapter-test/pom.xml b/xs2a-adapter-test/pom.xml index c03536a70..41ad0c497 100644 --- a/xs2a-adapter-test/pom.xml +++ b/xs2a-adapter-test/pom.xml @@ -6,7 +6,7 @@ xs2a-adapter de.adorsys.xs2a.adapter - 0.1.15 + 0.1.16-SNAPSHOT xs2a-adapter-test From eff69c7a3c940b1cd450fb74669eb0f4be5ef248 Mon Sep 17 00:00:00 2001 From: Alexander Berezkin Date: Mon, 13 Sep 2021 14:46:47 +0300 Subject: [PATCH 02/10] fix docker script (#621) --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ec6134844..1f5a3961c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -38,4 +38,4 @@ jobs: with: context: . push: true - tags: ${DOCKERHUB_IMAGE_NAME} + tags: ${{ env.DOCKERHUB_IMAGE_NAME }} From d1f542dedf29398c58b766b1396505b1a67474fe Mon Sep 17 00:00:00 2001 From: OlgaLevandovska <86299452+OlgaLevandovska@users.noreply.github.com> Date: Tue, 14 Sep 2021 10:16:19 +0300 Subject: [PATCH 03/10] Feature/ole roadmap update september (#622) * Roadmap update for release 0.1.15 * Roadmap update for release 0.1.15 - corrected Co-authored-by: olgalevandovska --- docs/roadmap.adoc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/roadmap.adoc b/docs/roadmap.adoc index 442ff549c..0750501a2 100644 --- a/docs/roadmap.adoc +++ b/docs/roadmap.adoc @@ -312,6 +312,16 @@ a| * Complete Building Block View part * Revise existing documentation * Fill out Glossary chapter +a| 13.09 +a| 0.1.15 +a| * Implement AIS adapter for AAreal Bank Ag +* Complete Cross-cutting Concepts part +* Fill out Design Decisions +* Complete Quality Requirements +* Complete Risks and Technical Debts part +* Set up a Docker Image publishing to Docker Hub +* Put in order all default values in adapters + a| For future development a| x.x.x @@ -320,8 +330,6 @@ a| * Connect and test Hamburg Commercial Bank AG for AIS (with the real account) -* Connect and test Hamburg AAreal Bank AG for AIS (with the real account) - * Implement Open Banking UK repository * Connect and Test European Banks From bac28891a4df2cc2a71af62d77596c76721e5c72 Mon Sep 17 00:00:00 2001 From: Alexander Berezkin Date: Thu, 16 Sep 2021 15:17:05 +0300 Subject: [PATCH 04/10] Santander wiremock stubs (#623) * added ais wiremock stubs * recorded payments sepa stubs * update documents --- README.md | 1 + .../adorsys-adapter/__files/.gitkeep | 0 .../deutsche-bank-adapter/__files/.gitkeep | 0 .../fiducia-adapter/__files/.gitkeep | 0 adapters/santander-adapter/pom.xml | 7 ++ .../santander-adapter/__files/.gitkeep | 0 .../mappings/ais-create-consent.json | 50 ++++++++++ .../mappings/ais-delete-consent.json | 37 +++++++ .../mappings/ais-get-access-token.json | 41 ++++++++ .../mappings/ais-get-accounts.json | 43 ++++++++ .../mappings/ais-get-authorization-code.json | 17 ++++ .../mappings/ais-get-balances.json | 43 ++++++++ .../mappings/ais-get-consent-status.json | 40 ++++++++ .../mappings/ais-get-transactions.json | 43 ++++++++ .../mappings/get-authorization-endpoint.json | 26 +++++ .../get-client-credentials-token.json | 41 ++++++++ .../mappings/pis-get-access-token.json | 41 ++++++++ .../mappings/pis-get-authorization-code.json | 17 ++++ .../pis-payments-sct-get-payment-status.json | 40 ++++++++ .../pis-payments-sct-initiate-payment.json | 53 ++++++++++ ...AccountInformationServiceWireMockTest.java | 97 +++++++++++++++++++ .../SantanderOauth2ServiceWireMockTest.java | 70 +++++++++++++ ...rPaymentInitiationServiceWireMockTest.java | 53 ++++++++++ .../test/resources/ais/create-consent.json | 53 ++++++++++ .../test/resources/ais/delete-consent.json | 8 ++ .../src/test/resources/ais/get-accounts.json | 36 +++++++ .../src/test/resources/ais/get-balances.json | 37 +++++++ .../resources/ais/get-consent-status.json | 13 +++ .../test/resources/ais/get-transactions.json | 91 +++++++++++++++++ .../resources/oauth2/get-access-token.json | 23 +++++ .../oauth2/get-authorization-endpoint.json | 15 +++ .../oauth2/get-client-credentials-token.json | 18 ++++ .../get-payment-status.json | 14 +++ .../initiate-payment.json | 44 +++++++++ .../resources/verlag-adapter/__files/.gitkeep | 0 .../DRAFT_Release_notes_0.1.16.adoc | 1 + .../main/resources/adapter.config.properties | 2 +- 37 files changed, 1114 insertions(+), 1 deletion(-) create mode 100644 adapters/adorsys-adapter/src/main/resources/adorsys-adapter/__files/.gitkeep create mode 100644 adapters/deutsche-bank-adapter/src/main/resources/deutsche-bank-adapter/__files/.gitkeep create mode 100644 adapters/fiducia-adapter/src/main/resources/fiducia-adapter/__files/.gitkeep create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/__files/.gitkeep create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-create-consent.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-delete-consent.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-access-token.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-accounts.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-authorization-code.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-balances.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-consent-status.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-transactions.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/get-authorization-endpoint.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/get-client-credentials-token.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-get-access-token.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-get-authorization-code.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-payments-sct-get-payment-status.json create mode 100644 adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-payments-sct-initiate-payment.json create mode 100644 adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderAccountInformationServiceWireMockTest.java create mode 100644 adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderOauth2ServiceWireMockTest.java create mode 100644 adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderPaymentInitiationServiceWireMockTest.java create mode 100644 adapters/santander-adapter/src/test/resources/ais/create-consent.json create mode 100644 adapters/santander-adapter/src/test/resources/ais/delete-consent.json create mode 100644 adapters/santander-adapter/src/test/resources/ais/get-accounts.json create mode 100644 adapters/santander-adapter/src/test/resources/ais/get-balances.json create mode 100644 adapters/santander-adapter/src/test/resources/ais/get-consent-status.json create mode 100644 adapters/santander-adapter/src/test/resources/ais/get-transactions.json create mode 100644 adapters/santander-adapter/src/test/resources/oauth2/get-access-token.json create mode 100644 adapters/santander-adapter/src/test/resources/oauth2/get-authorization-endpoint.json create mode 100644 adapters/santander-adapter/src/test/resources/oauth2/get-client-credentials-token.json create mode 100644 adapters/santander-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json create mode 100644 adapters/santander-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json create mode 100644 adapters/verlag-adapter/src/main/resources/verlag-adapter/__files/.gitkeep diff --git a/README.md b/README.md index 4ed0cbb16..12301ccff 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ Not all adapters have written stubs though. Responses available for the next ada - ing-adapter - sparkasse-adapter - verlag-adapter +- santander-adapter New stubs will be added in time. diff --git a/adapters/adorsys-adapter/src/main/resources/adorsys-adapter/__files/.gitkeep b/adapters/adorsys-adapter/src/main/resources/adorsys-adapter/__files/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/adapters/deutsche-bank-adapter/src/main/resources/deutsche-bank-adapter/__files/.gitkeep b/adapters/deutsche-bank-adapter/src/main/resources/deutsche-bank-adapter/__files/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/adapters/fiducia-adapter/src/main/resources/fiducia-adapter/__files/.gitkeep b/adapters/fiducia-adapter/src/main/resources/fiducia-adapter/__files/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/adapters/santander-adapter/pom.xml b/adapters/santander-adapter/pom.xml index e2e2d2625..5a2c83f4c 100644 --- a/adapters/santander-adapter/pom.xml +++ b/adapters/santander-adapter/pom.xml @@ -24,6 +24,13 @@ + + de.adorsys.xs2a.adapter + xs2a-adapter-test + ${project.version} + test + + pro.javatar.commons javatar-commons diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/__files/.gitkeep b/adapters/santander-adapter/src/main/resources/santander-adapter/__files/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-create-consent.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-create-consent.json new file mode 100644 index 000000000..aac4bb9c0 --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-create-consent.json @@ -0,0 +1,50 @@ +{ + "id" : "8ed2fe82-86c2-4507-a44e-a81b5b91cc50", + "name" : "scb-openapis_sx_v1_consents", + "request" : { + "urlPattern" : ".*/v1/consents", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-IP-Address" : { + "matches" : ".+" + }, + "Content-Type" : { + "equalTo" : "application/json; charset=UTF-8" + }, + "Authorization" : { + "equalTo" : "Bearer 4f4f45b7-c75a-426c-98ab-c109b3b19b5c" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"access\":{\"accounts\":[{\"iban\":\"DE74310108330000009001\",\"currency\":\"EUR\"}],\"balances\":[{\"iban\":\"DE74310108330000009001\",\"currency\":\"EUR\"}],\"transactions\":[{\"iban\":\"DE74310108330000009001\",\"currency\":\"EUR\"}]},\"recurringIndicator\":true,\"validUntil\":\"${json-unit.regex}\\\\d{4}-[01]\\\\d-[0-3]\\\\d\",\"frequencyPerDay\":4,\"combinedServiceIndicator\":false}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\"consentStatus\":\"received\",\"consentId\":\"3087d8e2-2eb0-4e54-9af9-32ea8c6eef02\",\"_links\":{\"scaOAuth\":{\"href\":\"/.well-known/oauth-authorization-server\"},\"self\":{\"href\":\"/v1/consents/3087d8e2-2eb0-4e54-9af9-32ea8c6eef02\"},\"status\":{\"href\":\"/v1/consents/3087d8e2-2eb0-4e54-9af9-32ea8c6eef02/status\"}}}", + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "Content-Security-Policy" : "default-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline';object-src 'none';connect-src 'self' 'unsafe-inline' https://catalogue.nodered.org https://flow-library-catalogue.appls.boaw.paas.gsnetcloud.corp;upgrade-insecure-requests", + "X-DNS-Prefetch-Control" : "off", + "Expect-CT" : "max-age=0", + "X-Frame-Options" : "DENY", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains", + "X-Download-Options" : "noopen", + "X-Content-Type-Options" : "nosniff", + "X-Permitted-Cross-Domain-Policies" : "none", + "Referrer-Policy" : "no-referrer", + "X-XSS-Protection" : "1; mode=block", + "Content-Type" : "application/json; charset=utf-8", + "ETag" : "W/\"129-P2NdZJtzHna/mkOIejudVkkMnz0\"", + "Date" : "Tue, 14 Sep 2021 08:02:52 GMT" + } + }, + "uuid" : "8ed2fe82-86c2-4507-a44e-a81b5b91cc50", + "persistent" : true, + "insertionIndex" : 5 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-delete-consent.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-delete-consent.json new file mode 100644 index 000000000..3d0a4dbf6 --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-delete-consent.json @@ -0,0 +1,37 @@ +{ + "id" : "b10e1ed0-9154-42ef-a26e-b55c616a2aa6", + "name" : "scb-openapis_sx_v1_consents_3087d8e2-2eb0-4e54-9af9-32ea8c6eef02", + "request" : { + "urlPattern" : ".*/v1/consents/.+", + "method" : "DELETE", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 5e71f077-39e2-4f2a-a28b-feebf53f8b88" + } + } + }, + "response" : { + "status" : 204, + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "Content-Security-Policy" : "default-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline';object-src 'none';connect-src 'self' 'unsafe-inline' https://catalogue.nodered.org https://flow-library-catalogue.appls.boaw.paas.gsnetcloud.corp;upgrade-insecure-requests", + "X-DNS-Prefetch-Control" : "off", + "Expect-CT" : "max-age=0", + "X-Frame-Options" : "DENY", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains", + "X-Download-Options" : "noopen", + "X-Content-Type-Options" : "nosniff", + "X-Permitted-Cross-Domain-Policies" : "none", + "Referrer-Policy" : "no-referrer", + "X-XSS-Protection" : "1; mode=block", + "Date" : "Tue, 14 Sep 2021 08:07:12 GMT", + "Set-Cookie" : "e1c2a1bacab8ed7c71b48d53230e1cc1=e5c0e554c6c9b3a055272184ce213b0d; path=/; HttpOnly; Secure" + } + }, + "uuid" : "b10e1ed0-9154-42ef-a26e-b55c616a2aa6", + "persistent" : true, + "insertionIndex" : 14 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-access-token.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-access-token.json new file mode 100644 index 000000000..673cdb549 --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-access-token.json @@ -0,0 +1,41 @@ +{ + "id" : "9e6ebe4a-4db2-45ba-b968-a3d46effb9b8", + "name" : "scb-openapis_sx_v1_oauth_matls_token", + "request" : { + "urlPattern" : ".*/v1/oauth_matls/token", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/x-www-form-urlencoded" + } + }, + "bodyPatterns" : [ { + "contains" : "code=fooboo&redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb&grant_type=authorization_code&sca_oauth_link=%2F.well-known%2Foauth-authorization-server&client_id=PSDDE-SANDBOX-0006&code_verifier=", + "caseInsensitive" : false + } ] + }, + "response" : { + "status" : 200, + "body" : "{\"access_token\":\"5e71f077-39e2-4f2a-a28b-feebf53f8b88\",\"token_type\":\"bearer\",\"expires_in\":599,\"scope\":\"payments.write periodicpayments.read fundsconfirmations.read consents.write consents.read payments.read accounts.read periodicpayments.write\"}", + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "Content-Security-Policy" : "default-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline';object-src 'none';connect-src 'self' 'unsafe-inline' https://catalogue.nodered.org https://flow-library-catalogue.appls.boaw.paas.gsnetcloud.corp;upgrade-insecure-requests", + "X-DNS-Prefetch-Control" : "off", + "Expect-CT" : "max-age=0", + "X-Frame-Options" : "DENY", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains", + "X-Download-Options" : "noopen", + "X-Content-Type-Options" : "nosniff", + "X-Permitted-Cross-Domain-Policies" : "none", + "Referrer-Policy" : "no-referrer", + "X-XSS-Protection" : "1; mode=block", + "Cache-Control" : "no-store", + "Content-Type" : "application/json; charset=utf-8", + "ETag" : "W/\"f5-AErb/z5zGX7cWfgCgaYyishbKEE\"", + "Date" : "Tue, 14 Sep 2021 08:03:39 GMT" + } + }, + "uuid" : "9e6ebe4a-4db2-45ba-b968-a3d46effb9b8", + "persistent" : true, + "insertionIndex" : 7 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-accounts.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-accounts.json new file mode 100644 index 000000000..f9ca32b0c --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-accounts.json @@ -0,0 +1,43 @@ +{ + "id" : "57bf2a10-f64b-4dfd-b31b-c602b4d35bbb", + "name" : "scb-openapis_sx_v1_accounts", + "request" : { + "urlPattern" : ".*/v1/accounts\\?withBalance=false", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "3087d8e2-2eb0-4e54-9af9-32ea8c6eef02" + }, + "Authorization" : { + "equalTo" : "Bearer 5e71f077-39e2-4f2a-a28b-feebf53f8b88" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\"accounts\":[{\"resourceId\":\"3b5a3b70-ceec-4518-b23e-ee5d1302f532\",\"iban\":\"DE74310108330000009001\",\"currency\":\"EUR\",\"ownerName\":\"My account owner name\",\"name\":\"Haushaltskonto\",\"product\":\"Haushaltskonto\",\"cashAccountType\":\"CACC\",\"status\":\"enabled\",\"_links\":{\"balances\":{\"href\":\"/v1/accounts/3b5a3b70-ceec-4518-b23e-ee5d1302f532/balances\"},\"transactions\":{\"href\":\"/v1/accounts/3b5a3b70-ceec-4518-b23e-ee5d1302f532/transactions\"}}}]}", + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "Content-Security-Policy" : "default-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline';object-src 'none';connect-src 'self' 'unsafe-inline' https://catalogue.nodered.org https://flow-library-catalogue.appls.boaw.paas.gsnetcloud.corp;upgrade-insecure-requests", + "X-DNS-Prefetch-Control" : "off", + "Expect-CT" : "max-age=0", + "X-Frame-Options" : "DENY", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains", + "X-Download-Options" : "noopen", + "X-Content-Type-Options" : "nosniff", + "X-Permitted-Cross-Domain-Policies" : "none", + "Referrer-Policy" : "no-referrer", + "X-XSS-Protection" : "1; mode=block", + "Content-Type" : "application/json; charset=utf-8", + "ETag" : "W/\"1ad-BFpngozc0whblryzAGQPPSiohYw\"", + "Date" : "Tue, 14 Sep 2021 08:03:46 GMT", + "Cache-control" : "private" + } + }, + "uuid" : "57bf2a10-f64b-4dfd-b31b-c602b4d35bbb", + "persistent" : true, + "insertionIndex" : 8 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-authorization-code.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-authorization-code.json new file mode 100644 index 000000000..3d7ccdc37 --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-authorization-code.json @@ -0,0 +1,17 @@ +{ + "id" : "6934db76-5bd6-4fe1-abc6-dab92161b8c3", + "name" : "oauth2_authorization-server-url", + "request" : { + "urlPattern" : "/\\?response_type=code&state=xyz&redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb&code_challenge_method=S256&code_challenge=.+&client_id=PSDDE-SANDBOX-0006&scope=AIS%3A3087d8e2-2eb0-4e54-9af9-32ea8c6eef02", + "method" : "GET" + }, + "response" : { + "status" : 302, + "headers" : { + "Location" : "http://localhost:8080/redirect?code=fooboo" + } + }, + "uuid" : "6934db76-5bd6-4fe1-abc6-dab92161b8c3", + "persistent" : true, + "insertionIndex" : 2 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-balances.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-balances.json new file mode 100644 index 000000000..86704c663 --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-balances.json @@ -0,0 +1,43 @@ +{ + "id" : "4d144f66-ac2e-4b35-acca-4fd29d3b8706", + "name" : "scb-openapis_sx_v1_accounts_3b5a3b70-ceec-4518-b23e-ee5d1302f532_balances", + "request" : { + "urlPattern" : ".*/v1/accounts/.+/balances", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "3087d8e2-2eb0-4e54-9af9-32ea8c6eef02" + }, + "Authorization" : { + "equalTo" : "Bearer 5e71f077-39e2-4f2a-a28b-feebf53f8b88" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\"account\":{\"iban\":\"DE74310108330000009001\",\"currency\":\"EUR\"},\"balances\":[{\"balanceType\":\"expected\",\"balanceAmount\":{\"currency\":\"EUR\",\"amount\":\"175387.25\"},\"lastChangeDateTime\":\"2019-03-13T23:30:29.851Z\",\"referenceDate\":\"2019-03-13\"},{\"balanceType\":\"authorised\",\"balanceAmount\":{\"currency\":\"EUR\",\"amount\":\"180387.25\"},\"lastChangeDateTime\":\"2019-03-13T08:30:29.851Z\",\"referenceDate\":\"2019-03-13\"}]}", + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "Content-Security-Policy" : "default-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline';object-src 'none';connect-src 'self' 'unsafe-inline' https://catalogue.nodered.org https://flow-library-catalogue.appls.boaw.paas.gsnetcloud.corp;upgrade-insecure-requests", + "X-DNS-Prefetch-Control" : "off", + "Expect-CT" : "max-age=0", + "X-Frame-Options" : "DENY", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains", + "X-Download-Options" : "noopen", + "X-Content-Type-Options" : "nosniff", + "X-Permitted-Cross-Domain-Policies" : "none", + "Referrer-Policy" : "no-referrer", + "X-XSS-Protection" : "1; mode=block", + "Content-Type" : "application/json; charset=utf-8", + "ETag" : "W/\"18d-LRJvYBKciJXEIIGchtcvaOXoOF0\"", + "Date" : "Tue, 14 Sep 2021 08:04:03 GMT", + "Cache-control" : "private" + } + }, + "uuid" : "4d144f66-ac2e-4b35-acca-4fd29d3b8706", + "persistent" : true, + "insertionIndex" : 10 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-consent-status.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-consent-status.json new file mode 100644 index 000000000..0829ffa2e --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-consent-status.json @@ -0,0 +1,40 @@ +{ + "id" : "faff7c20-dc1e-49a8-825e-cbe9d8bb7849", + "name" : "scb-openapis_sx_v1_consents_3087d8e2-2eb0-4e54-9af9-32ea8c6eef02_status", + "request" : { + "urlPattern" : ".*/v1/consents/.+/status", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 5e71f077-39e2-4f2a-a28b-feebf53f8b88" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\"consentStatus\":\"valid\"}", + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "Content-Security-Policy" : "default-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline';object-src 'none';connect-src 'self' 'unsafe-inline' https://catalogue.nodered.org https://flow-library-catalogue.appls.boaw.paas.gsnetcloud.corp;upgrade-insecure-requests", + "X-DNS-Prefetch-Control" : "off", + "Expect-CT" : "max-age=0", + "X-Frame-Options" : "DENY", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains", + "X-Download-Options" : "noopen", + "X-Content-Type-Options" : "nosniff", + "X-Permitted-Cross-Domain-Policies" : "none", + "Referrer-Policy" : "no-referrer", + "X-XSS-Protection" : "1; mode=block", + "Content-Type" : "application/json; charset=utf-8", + "ETag" : "W/\"19-L+pjNFjTcf04z7w/GQabTus/Gl8\"", + "Date" : "Tue, 14 Sep 2021 08:04:13 GMT", + "Cache-control" : "private" + } + }, + "uuid" : "faff7c20-dc1e-49a8-825e-cbe9d8bb7849", + "persistent" : true, + "insertionIndex" : 11 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-transactions.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-transactions.json new file mode 100644 index 000000000..1bf0cfbfd --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/ais-get-transactions.json @@ -0,0 +1,43 @@ +{ + "id" : "60c00c70-8e2a-4857-9c14-3cfc5074af59", + "name" : "scb-openapis_sx_v1_accounts_3b5a3b70-ceec-4518-b23e-ee5d1302f532_transactions", + "request" : { + "urlPattern" : ".*/v1/accounts/.+/transactions\\?bookingStatus=booked&withBalance=true", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "3087d8e2-2eb0-4e54-9af9-32ea8c6eef02" + }, + "Authorization" : { + "equalTo" : "Bearer 5e71f077-39e2-4f2a-a28b-feebf53f8b88" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\"account\":{\"iban\":\"DE74310108330000009001\",\"currency\":\"EUR\"},\"transactions\":{\"booked\":[{\"transactionId\":\"3102900000015BH48100001000120190313\",\"endToEndId\":\"32931029632BBBXHWM\",\"bookingDate\":\"2019-03-13\",\"valueDate\":\"2019-03-13\",\"transactionAmount\":{\"currency\":\"EUR\",\"amount\":\"-90.01\"},\"debtorName\":\"Max Mustermann\",\"debtorAccount\":{\"iban\":\"DE74310108330000009001\",\"currency\":\"EUR\"},\"creditorName\":\"Sunny AG\",\"creditorAccount\":{\"iban\":\"DE40100100103307118608\",\"currency\":\"EUR\"},\"remittanceInformationUnstructured\":\"Invoice\",\"bankTransactionCode\":\"PMNT-ICDT-ESCT\",\"proprietaryBankTransactionCode\":\"NTRF+116\"},{\"transactionId\":\"4041700000003BH22899999000120190313\",\"creditorId\":\"FR41510118000\",\"endToEndId\":\"12345678902020101604\",\"mandateId\":\"Mandate-16102020-4\",\"bankTransactionCode\":\"PMNT-RDDT-ESDD\",\"proprietaryBankTransactionCode\":\"NDDT+105\",\"creditorName\":\"External Creditor\",\"creditorAccount\":{\"iban\":\"FR7618206000103056966400\"},\"ultimateCreditor\":\"Ultimate creditor name\",\"debtorName\":\"Max Mustermann\",\"debtorAccount\":{\"iban\":\"DE74310108330000009001\"},\"ultimateDebtor\":\"Ultimate debtor name\",\"transactionAmount\":{\"currency\":\"EUR\",\"amount\":-46.97},\"bookingDate\":\"2019-03-13\",\"valueDate\":\"2019-03-13\",\"remittanceInformationUnstructured\":\"Incoming Sepa Direct Debit\",\"paymentReference\":\"32940417755BBBBFLJ\"}]},\"balances\":[{\"balanceType\":\"closingBooked\",\"balanceAmount\":{\"currency\":\"EUR\",\"amount\":\"175387.25\"},\"referenceDate\":\"2019-03-13\"},{\"balanceType\":\"openingBooked\",\"balanceAmount\":{\"currency\":\"EUR\",\"amount\":\"180387.25\"},\"referenceDate\":\"2019-03-13\"}]}", + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "Content-Security-Policy" : "default-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline';object-src 'none';connect-src 'self' 'unsafe-inline' https://catalogue.nodered.org https://flow-library-catalogue.appls.boaw.paas.gsnetcloud.corp;upgrade-insecure-requests", + "X-DNS-Prefetch-Control" : "off", + "Expect-CT" : "max-age=0", + "X-Frame-Options" : "DENY", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains", + "X-Download-Options" : "noopen", + "X-Content-Type-Options" : "nosniff", + "X-Permitted-Cross-Domain-Policies" : "none", + "Referrer-Policy" : "no-referrer", + "X-XSS-Protection" : "1; mode=block", + "Content-Type" : "application/json; charset=utf-8", + "ETag" : "W/\"617-1ojPDpsmoR77aW5lzyVhitN6Kns\"", + "Date" : "Tue, 14 Sep 2021 08:03:54 GMT", + "Cache-control" : "private" + } + }, + "uuid" : "60c00c70-8e2a-4857-9c14-3cfc5074af59", + "persistent" : true, + "insertionIndex" : 9 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/get-authorization-endpoint.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/get-authorization-endpoint.json new file mode 100644 index 000000000..d8138bda6 --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/get-authorization-endpoint.json @@ -0,0 +1,26 @@ +{ + "id" : "89d969ec-5235-4d98-83a7-9a872668d071", + "name" : "scb-openapis_sx_well-known_oauth-authorization-server", + "request" : { + "urlPattern" : ".*/.well-known/oauth-authorization-server", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "{\"authorization_endpoint\":\"http://localhost:{{request.port}}\",\"code_challenge_methods_supported\":[\"S256\"],\"grant_types_supported\":[\"authorization_code\",\"client_credentials\"],\"issuer\":\"http://www.santander.de\",\"response_types_supported\":[\"code\",\"none\"],\"scopes_supported\":[\"accounts.read\",\"accounts.write\",\"payments.read\",\"payments.write\"],\"service_documentation\":\"https://www.santander.de/privatkunden/specials/api-market\",\"token_endpoint\":\"https://api-sandbox-cc.santander.de/scb-openapis/sx/v1/oauth_matls/token\",\"token_endpoint_auth_methods_supported\":[\"oauth\"],\"ui_locales_supported\":[\"en-US\",\"en-GB\",\"de-DE\"]}", + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "X-Content-Type-Options" : "nosniff", + "Content-Type" : "application/json; charset=utf-8", + "ETag" : "W/\"29c-6Jety3VaM4G8WsPG+m/UL+7QC08\"", + "Date" : "Tue, 14 Sep 2021 08:03:07 GMT", + "Cache-control" : "private", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains", + "X-Frame-Options" : "DENY", + "X-XSS-Protection" : "1; mode=block" + } + }, + "uuid" : "89d969ec-5235-4d98-83a7-9a872668d071", + "persistent" : true, + "insertionIndex" : 6 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/get-client-credentials-token.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/get-client-credentials-token.json new file mode 100644 index 000000000..bbbac9891 --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/get-client-credentials-token.json @@ -0,0 +1,41 @@ +{ + "id" : "6c20c806-de00-47e9-bc62-f0166f849779", + "name" : "scb-openapis_sx_v1_oauth_matls_token", + "request" : { + "urlPattern" : ".*/v1/oauth_matls/token", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/x-www-form-urlencoded" + } + }, + "bodyPatterns" : [ { + "contains" : "grant_type=client_credentials", + "caseInsensitive" : false + } ] + }, + "response" : { + "status" : 200, + "body" : "{\"access_token\":\"4f4f45b7-c75a-426c-98ab-c109b3b19b5c\",\"token_type\":\"bearer\",\"expires_in\":599,\"scope\":\"payments.write periodicpayments.read fundsconfirmations.read consents.write consents.read payments.read accounts.read periodicpayments.write\"}", + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "Content-Security-Policy" : "default-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline';object-src 'none';connect-src 'self' 'unsafe-inline' https://catalogue.nodered.org https://flow-library-catalogue.appls.boaw.paas.gsnetcloud.corp;upgrade-insecure-requests", + "X-DNS-Prefetch-Control" : "off", + "Expect-CT" : "max-age=0", + "X-Frame-Options" : "DENY", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains", + "X-Download-Options" : "noopen", + "X-Content-Type-Options" : "nosniff", + "X-Permitted-Cross-Domain-Policies" : "none", + "Referrer-Policy" : "no-referrer", + "X-XSS-Protection" : "1; mode=block", + "Cache-Control" : "no-store", + "Content-Type" : "application/json; charset=utf-8", + "ETag" : "W/\"f5-zoNCk9EvfcLpOAuwAhtCjsZJZwM\"", + "Date" : "Tue, 14 Sep 2021 08:02:51 GMT" + } + }, + "uuid" : "6c20c806-de00-47e9-bc62-f0166f849779", + "persistent" : true, + "insertionIndex" : 4 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-get-access-token.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-get-access-token.json new file mode 100644 index 000000000..43ef612bb --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-get-access-token.json @@ -0,0 +1,41 @@ +{ + "id" : "18c70864-a92b-4ade-87dc-a545543b2889", + "name" : "scb-openapis_sx_v1_oauth_matls_token", + "request" : { + "url" : "/scb-openapis/sx/v1/oauth_matls/token", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/x-www-form-urlencoded" + } + }, + "bodyPatterns" : [ { + "contains" : "code=boofoo", + "caseInsensitive" : false + } ] + }, + "response" : { + "status" : 200, + "body" : "{\"access_token\":\"6758aa6a-c04e-4828-991b-3ae82d340e87\",\"token_type\":\"bearer\",\"expires_in\":599,\"scope\":\"payments.write periodicpayments.read fundsconfirmations.read consents.write consents.read payments.read accounts.read periodicpayments.write\"}", + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "Content-Security-Policy" : "default-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline';object-src 'none';connect-src 'self' 'unsafe-inline' https://catalogue.nodered.org https://flow-library-catalogue.appls.boaw.paas.gsnetcloud.corp;upgrade-insecure-requests", + "X-DNS-Prefetch-Control" : "off", + "Expect-CT" : "max-age=0", + "X-Frame-Options" : "DENY", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains", + "X-Download-Options" : "noopen", + "X-Content-Type-Options" : "nosniff", + "X-Permitted-Cross-Domain-Policies" : "none", + "Referrer-Policy" : "no-referrer", + "X-XSS-Protection" : "1; mode=block", + "Cache-Control" : "no-store", + "Content-Type" : "application/json; charset=utf-8", + "ETag" : "W/\"f5-XOuBQ8RIXKp5SR5Jjo35Ax4ww5g\"", + "Date" : "Thu, 16 Sep 2021 08:27:34 GMT" + } + }, + "uuid" : "18c70864-a92b-4ade-87dc-a545543b2889", + "persistent" : true, + "insertionIndex" : 15 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-get-authorization-code.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-get-authorization-code.json new file mode 100644 index 000000000..ab8ca3a3f --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-get-authorization-code.json @@ -0,0 +1,17 @@ +{ + "id" : "6934db76-5bd6-4fe1-abc6-dab92161b8c3", + "name" : "oauth2_authorization-server-url", + "request" : { + "urlPattern" : "/\\?response_type=code&state=xyz&redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb&code_challenge_method=S256&code_challenge=.+&client_id=PSDDE-SANDBOX-0006&scope=PIS%3A73c52dc3-bd44-42b3-bc86-6b61c3167b63", + "method" : "GET" + }, + "response" : { + "status" : 302, + "headers" : { + "Location" : "http://localhost:8080/redirect?code=boofoo" + } + }, + "uuid" : "6934db76-5bd6-4fe1-abc6-dab92161b8c3", + "persistent" : true, + "insertionIndex" : 2 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-payments-sct-get-payment-status.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-payments-sct-get-payment-status.json new file mode 100644 index 000000000..5859cf93f --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-payments-sct-get-payment-status.json @@ -0,0 +1,40 @@ +{ + "id" : "2971c403-8cdb-4e16-84aa-2470e51adbee", + "name" : "scb-openapis_sx_v1_payments_sepa-credit-transfers_73c52dc3-bd44-42b3-bc86-6b61c3167b63_status", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/status", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 6758aa6a-c04e-4828-991b-3ae82d340e87" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\"transactionStatus\":\"RCVD\"}", + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "content-security-policy" : "default-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline';object-src 'none';connect-src 'self' 'unsafe-inline' https://catalogue.nodered.org https://flow-library-catalogue.appls.boaw.paas.gsnetcloud.corp;upgrade-insecure-requests", + "x-dns-prefetch-control" : "off", + "expect-ct" : "max-age=0", + "x-frame-options" : "DENY", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-download-options" : "noopen", + "x-content-type-options" : "nosniff", + "x-permitted-cross-domain-policies" : "none", + "referrer-policy" : "no-referrer", + "x-xss-protection" : "1; mode=block", + "Content-Type" : "application/json", + "etag" : "W/\"1c-GrZmm5CsQ4aRAQJ+UvTk+Yn/hn8\"", + "date" : "Thu, 16 Sep 2021 08:27:41 GMT", + "Cache-control" : "private" + } + }, + "uuid" : "2971c403-8cdb-4e16-84aa-2470e51adbee", + "persistent" : true, + "insertionIndex" : 16 +} diff --git a/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-payments-sct-initiate-payment.json b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-payments-sct-initiate-payment.json new file mode 100644 index 000000000..ee3cda8f0 --- /dev/null +++ b/adapters/santander-adapter/src/main/resources/santander-adapter/mappings/pis-payments-sct-initiate-payment.json @@ -0,0 +1,53 @@ +{ + "id" : "1b034648-82d8-4d45-9419-cd3e468c1177", + "name" : "scb-openapis_sx_v1_payments_sepa-credit-transfers", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "TPP-Redirect-URI" : { + "matches" : ".+" + }, + "PSU-IP-Address" : { + "matches" : ".+" + }, + "Content-Type" : { + "equalTo" : "application/json; charset=UTF-8" + }, + "Authorization" : { + "equalTo" : "Bearer 4f4f45b7-c75a-426c-98ab-c109b3b19b5c" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"endToEndIdentification\":\"SandboxTPPTest1\",\"debtorAccount\":{\"iban\":\"DE74310108330000009001\",\"currency\":\"EUR\"},\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"${json-unit.regex}-?[0-9]{1,14}(\\\\.[0-9]{1,3})?\"},\"creditorAccount\":{\"iban\":\"DE74310108330000009001\",\"currency\":\"EUR\"},\"creditorName\":\"${json-unit.any-string}\",\"remittanceInformationUnstructured\":\"just\"}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\"transactionStatus\":\"RCVD\",\"paymentId\":\"73c52dc3-bd44-42b3-bc86-6b61c3167b63\",\"_links\":{\"scaOAuth\":{\"href\":\"/.well-known/oauth-authorization-server\"},\"self\":{\"href\":\"/v1/payments/sepa-credit-transfers/73c52dc3-bd44-42b3-bc86-6b61c3167b63\"},\"status\":{\"href\":\"/v1/payments/sepa-credit-transfers/73c52dc3-bd44-42b3-bc86-6b61c3167b63/status\"}}}", + "headers" : { + "X-Backside-Transport" : "OK OK,OK OK", + "content-security-policy" : "default-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline';object-src 'none';connect-src 'self' 'unsafe-inline' https://catalogue.nodered.org https://flow-library-catalogue.appls.boaw.paas.gsnetcloud.corp;upgrade-insecure-requests", + "x-dns-prefetch-control" : "off", + "expect-ct" : "max-age=0", + "x-frame-options" : "DENY", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-download-options" : "noopen", + "x-content-type-options" : "nosniff", + "x-permitted-cross-domain-policies" : "none", + "referrer-policy" : "no-referrer", + "x-xss-protection" : "1; mode=block", + "Content-Type" : "application/json; charset=utf-8", + "etag" : "W/\"155-XYR14CUDo5/Cp3xQHrBI8L1YAUk\"", + "date" : "Thu, 16 Sep 2021 08:26:28 GMT" + } + }, + "uuid" : "1b034648-82d8-4d45-9419-cd3e468c1177", + "persistent" : true, + "insertionIndex" : 13 +} diff --git a/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderAccountInformationServiceWireMockTest.java b/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderAccountInformationServiceWireMockTest.java new file mode 100644 index 000000000..22302836c --- /dev/null +++ b/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderAccountInformationServiceWireMockTest.java @@ -0,0 +1,97 @@ +package de.adorsys.xs2a.adapter.santander; + +import de.adorsys.xs2a.adapter.api.AccountInformationService; +import de.adorsys.xs2a.adapter.api.RequestParams; +import de.adorsys.xs2a.adapter.api.Response; +import de.adorsys.xs2a.adapter.api.model.*; +import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; +import de.adorsys.xs2a.adapter.test.TestRequestResponse; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static org.assertj.core.api.Assertions.assertThat; + +@ServiceWireMockTest(SantanderServiceProvider.class) +class SantanderAccountInformationServiceWireMockTest { + + private static final String ACCOUNT_ID = "3b5a3b70-ceec-4518-b23e-ee5d1302f532"; + private static final String CONSENT_ID = "3087d8e2-2eb0-4e54-9af9-32ea8c6eef02"; + + private final AccountInformationService accountInformationService; + + SantanderAccountInformationServiceWireMockTest(AccountInformationService accountInformationService) { + this.accountInformationService = accountInformationService; + } + + @Test + void createConsent() throws IOException { + TestRequestResponse requestResponse = new TestRequestResponse("ais/create-consent.json"); + + Response response = accountInformationService.createConsent(requestResponse.requestHeaders(), + RequestParams.empty(), + requestResponse.requestBody(Consents.class)); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ConsentsResponse201.class)); + } + + @Test + void getAccounts() throws IOException { + TestRequestResponse requestResponse = new TestRequestResponse("ais/get-accounts.json"); + + Response response = accountInformationService.getAccountList(requestResponse.requestHeaders(), + requestResponse.requestParams()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(AccountList.class)); + } + + @Test + void getTransactions() throws IOException { + TestRequestResponse requestResponse = new TestRequestResponse("ais/get-transactions.json"); + + Response response = accountInformationService.getTransactionList(ACCOUNT_ID, + requestResponse.requestHeaders(), + requestResponse.requestParams()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(TransactionsResponse200Json.class)); + } + + @Test + void getBalances() throws IOException { + TestRequestResponse requestResponse = new TestRequestResponse("ais/get-balances.json"); + + Response response = accountInformationService.getBalances(ACCOUNT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ReadAccountBalanceResponse200.class)); + } + + @Test + void getConsentStatus() throws IOException { + TestRequestResponse requestResponse = new TestRequestResponse("ais/get-consent-status.json"); + + Response response = accountInformationService.getConsentStatus(CONSENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ConsentStatusResponse200.class)); + } + + @Test + void deleteConsent() throws IOException { + TestRequestResponse requestResponse = new TestRequestResponse("ais/get-consent-status.json"); + + Response response = accountInformationService.deleteConsent(CONSENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getStatusCode()) + .isEqualTo(204); + } +} diff --git a/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderOauth2ServiceWireMockTest.java b/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderOauth2ServiceWireMockTest.java new file mode 100644 index 000000000..4cd499998 --- /dev/null +++ b/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderOauth2ServiceWireMockTest.java @@ -0,0 +1,70 @@ +package de.adorsys.xs2a.adapter.santander; + +import de.adorsys.xs2a.adapter.api.Oauth2Service; +import de.adorsys.xs2a.adapter.api.model.TokenResponse; +import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; +import de.adorsys.xs2a.adapter.test.TestRequestResponse; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.net.URI; +import java.util.LinkedHashMap; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; + +@ServiceWireMockTest(SantanderServiceProvider.class) +class SantanderOauth2ServiceWireMockTest { + + private final Oauth2Service oauth2Service; + + SantanderOauth2ServiceWireMockTest(Oauth2Service oauth2Service) { + this.oauth2Service = oauth2Service; + } + + @Test + void getAuthorizationEndpoint() throws IOException { + TestRequestResponse requestResponse = new TestRequestResponse("oauth2/get-authorization-endpoint.json"); + + // Needed a mutable map to put into Parameters, otherwise requestParams().toMap() will return unmodifiable collection + // which will throw UnsupportedOperationException downstream. + Map modifiableParams = new LinkedHashMap<>(requestResponse.requestParams().toMap()); + + URI actualUri = oauth2Service.getAuthorizationRequestUri(requestResponse.requestHeaders().toMap(), + new Oauth2Service.Parameters(modifiableParams)); + + // It's onerous to get a WireMock port in running test environment, thus checking determined parts of URL only + assertThat(actualUri) + .isNotNull() + .asString() + .contains("http://localhost", "response_type=code", "scope=AIS%3A3087d8e2-2eb0-4e54-9af9-32ea8c6eef02"); + } + + @Test + void getClientCredentialsToken() throws IOException { + TestRequestResponse requestResponse = new TestRequestResponse("oauth2/get-client-credentials-token.json"); + + Map modifiableParams = new LinkedHashMap<>(requestResponse.requestParams().toMap()); + + TokenResponse actualToken = oauth2Service.getToken(requestResponse.requestHeaders().toMap(), + new Oauth2Service.Parameters(modifiableParams)); + + assertThat(actualToken) + .isNotNull() + .isEqualTo(requestResponse.responseBody(TokenResponse.class)); + } + + @Test + void getAccessToken() throws IOException { + TestRequestResponse requestResponse = new TestRequestResponse("oauth2/get-access-token.json"); + + Map modifiableParams = new LinkedHashMap<>(requestResponse.requestParams().toMap()); + + TokenResponse actualToken = oauth2Service.getToken(requestResponse.requestHeaders().toMap(), + new Oauth2Service.Parameters(modifiableParams)); + + assertThat(actualToken) + .isNotNull() + .isEqualTo(requestResponse.responseBody(TokenResponse.class)); + } +} diff --git a/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderPaymentInitiationServiceWireMockTest.java b/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderPaymentInitiationServiceWireMockTest.java new file mode 100644 index 000000000..05728fbf3 --- /dev/null +++ b/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderPaymentInitiationServiceWireMockTest.java @@ -0,0 +1,53 @@ +package de.adorsys.xs2a.adapter.santander; + +import de.adorsys.xs2a.adapter.api.PaymentInitiationService; +import de.adorsys.xs2a.adapter.api.RequestParams; +import de.adorsys.xs2a.adapter.api.Response; +import de.adorsys.xs2a.adapter.api.model.*; +import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; +import de.adorsys.xs2a.adapter.test.TestRequestResponse; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static org.assertj.core.api.Assertions.assertThat; + +@ServiceWireMockTest(SantanderServiceProvider.class) +class SantanderPaymentInitiationServiceWireMockTest { + + private static final String PAYMENT_ID = "73c52dc3-bd44-42b3-bc86-6b61c3167b63"; + + private final PaymentInitiationService paymentInitiationService; + + SantanderPaymentInitiationServiceWireMockTest(PaymentInitiationService paymentInitiationService) { + this.paymentInitiationService = paymentInitiationService; + } + + @Test + void initiatePayment() throws IOException { + TestRequestResponse requestResponse = new TestRequestResponse("pis/payments/sepa-credit-transfers/initiate-payment.json"); + + Response response = paymentInitiationService.initiatePayment(PaymentService.PAYMENTS, + PaymentProduct.SEPA_CREDIT_TRANSFERS, + requestResponse.requestHeaders(), + RequestParams.empty(), + requestResponse.requestBody(PaymentInitiationJson.class)); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(PaymentInitationRequestResponse201.class)); + } + + @Test + void getPaymentStatus() throws IOException { + TestRequestResponse requestResponse = new TestRequestResponse("pis/payments/sepa-credit-transfers/get-payment-status.json"); + + Response response = paymentInitiationService.getPaymentInitiationStatus(PaymentService.PAYMENTS, + PaymentProduct.SEPA_CREDIT_TRANSFERS, + PAYMENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(PaymentInitiationStatusResponse200Json.class)); + } +} diff --git a/adapters/santander-adapter/src/test/resources/ais/create-consent.json b/adapters/santander-adapter/src/test/resources/ais/create-consent.json new file mode 100644 index 000000000..3a7ce2178 --- /dev/null +++ b/adapters/santander-adapter/src/test/resources/ais/create-consent.json @@ -0,0 +1,53 @@ +{ + "request": { + "headers": { + "X-Request-ID": "b2323695-917b-43f1-abb2-0d247c1937ef", + "Content-Type": "application/json", + "PSU-IP-Address": "0.0.0.0", + "X-GTW-ASPSP-ID": "14a0c2ad-b9bf-4200-853a-a7abe541b714" + }, + "body": { + "access": { + "balances": [ + { + "iban": "DE74310108330000009001", + "currency": "EUR" + } + ], + "transactions": [ + { + "iban": "DE74310108330000009001", + "currency": "EUR" + } + ], + "accounts": [ + { + "iban": "DE74310108330000009001", + "currency": "EUR" + } + ] + }, + "combinedServiceIndicator": "false", + "recurringIndicator": "true", + "validUntil": "2021-09-15", + "frequencyPerDay": "4" + } + }, + "response": { + "body": { + "consentStatus": "received", + "consentId": "3087d8e2-2eb0-4e54-9af9-32ea8c6eef02", + "_links": { + "scaOAuth": { + "href": "/.well-known/oauth-authorization-server" + }, + "self": { + "href": "/v1/consents/3087d8e2-2eb0-4e54-9af9-32ea8c6eef02" + }, + "status": { + "href": "/v1/consents/3087d8e2-2eb0-4e54-9af9-32ea8c6eef02/status" + } + } + } + } +} diff --git a/adapters/santander-adapter/src/test/resources/ais/delete-consent.json b/adapters/santander-adapter/src/test/resources/ais/delete-consent.json new file mode 100644 index 000000000..573a229eb --- /dev/null +++ b/adapters/santander-adapter/src/test/resources/ais/delete-consent.json @@ -0,0 +1,8 @@ +{ + "request": { + "headers": { + "X-Request-ID": "68b4a545-ec12-47e4-9bd8-2984b4e4575d", + "Authorization": "Bearer 5e71f077-39e2-4f2a-a28b-feebf53f8b88" + } + } +} diff --git a/adapters/santander-adapter/src/test/resources/ais/get-accounts.json b/adapters/santander-adapter/src/test/resources/ais/get-accounts.json new file mode 100644 index 000000000..2344ebeed --- /dev/null +++ b/adapters/santander-adapter/src/test/resources/ais/get-accounts.json @@ -0,0 +1,36 @@ +{ + "request": { + "headers": { + "X-Request-ID": "58fa1ca2-9adf-4555-b892-0eca1e4c5178", + "Consent-ID": "3087d8e2-2eb0-4e54-9af9-32ea8c6eef02", + "Authorization": "Bearer 5e71f077-39e2-4f2a-a28b-feebf53f8b88" + }, + "params": { + "withBalance": "false" + } + }, + "response": { + "body": { + "accounts": [ + { + "resourceId": "3b5a3b70-ceec-4518-b23e-ee5d1302f532", + "iban": "DE74310108330000009001", + "currency": "EUR", + "ownerName": "My account owner name", + "name": "Haushaltskonto", + "product": "Haushaltskonto", + "cashAccountType": "CACC", + "status": "enabled", + "_links": { + "balances": { + "href": "/v1/accounts/3b5a3b70-ceec-4518-b23e-ee5d1302f532/balances" + }, + "transactions": { + "href": "/v1/accounts/3b5a3b70-ceec-4518-b23e-ee5d1302f532/transactions" + } + } + } + ] + } + } +} diff --git a/adapters/santander-adapter/src/test/resources/ais/get-balances.json b/adapters/santander-adapter/src/test/resources/ais/get-balances.json new file mode 100644 index 000000000..3e878a44d --- /dev/null +++ b/adapters/santander-adapter/src/test/resources/ais/get-balances.json @@ -0,0 +1,37 @@ +{ + "request": { + "headers": { + "X-Request-ID": "991cc90c-5795-4dad-b802-b7315f192227", + "Consent-ID": "3087d8e2-2eb0-4e54-9af9-32ea8c6eef02", + "Authorization": "Bearer 5e71f077-39e2-4f2a-a28b-feebf53f8b88" + } + }, + "response": { + "body": { + "account": { + "iban": "DE74310108330000009001", + "currency": "EUR" + }, + "balances": [ + { + "balanceType": "expected", + "balanceAmount": { + "currency": "EUR", + "amount": "175387.25" + }, + "lastChangeDateTime": "2019-03-13T23:30:29.851Z", + "referenceDate": "2019-03-13" + }, + { + "balanceType": "authorised", + "balanceAmount": { + "currency": "EUR", + "amount": "180387.25" + }, + "lastChangeDateTime": "2019-03-13T08:30:29.851Z", + "referenceDate": "2019-03-13" + } + ] + } + } +} diff --git a/adapters/santander-adapter/src/test/resources/ais/get-consent-status.json b/adapters/santander-adapter/src/test/resources/ais/get-consent-status.json new file mode 100644 index 000000000..d7f6bb119 --- /dev/null +++ b/adapters/santander-adapter/src/test/resources/ais/get-consent-status.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "b3b9856e-1334-48c9-a1e4-8a1e44d3811d", + "Authorization": "Bearer 5e71f077-39e2-4f2a-a28b-feebf53f8b88" + } + }, + "response": { + "body": { + "consentStatus": "valid" + } + } +} diff --git a/adapters/santander-adapter/src/test/resources/ais/get-transactions.json b/adapters/santander-adapter/src/test/resources/ais/get-transactions.json new file mode 100644 index 000000000..b67586b8c --- /dev/null +++ b/adapters/santander-adapter/src/test/resources/ais/get-transactions.json @@ -0,0 +1,91 @@ +{ + "request": { + "headers": { + "X-Request-ID": "98e53bb5-50b1-4c80-94ef-91d5ae8e3a4c", + "Consent-ID": "3087d8e2-2eb0-4e54-9af9-32ea8c6eef02", + "Authorization": "Bearer 5e71f077-39e2-4f2a-a28b-feebf53f8b88" + }, + "params": { + "bookingStatus": "booked", + "withBalance": "true" + } + }, + "response": { + "body": { + "account": { + "iban": "DE74310108330000009001", + "currency": "EUR" + }, + "transactions": { + "booked": [ + { + "transactionId": "3102900000015BH48100001000120190313", + "endToEndId": "32931029632BBBXHWM", + "bookingDate": "2019-03-13", + "valueDate": "2019-03-13", + "transactionAmount": { + "currency": "EUR", + "amount": "-90.01" + }, + "debtorName": "Max Mustermann", + "debtorAccount": { + "iban": "DE74310108330000009001", + "currency": "EUR" + }, + "creditorName": "Sunny AG", + "creditorAccount": { + "iban": "DE40100100103307118608", + "currency": "EUR" + }, + "remittanceInformationUnstructured": "Invoice", + "bankTransactionCode": "PMNT-ICDT-ESCT", + "proprietaryBankTransactionCode": "NTRF+116" + }, + { + "transactionId": "4041700000003BH22899999000120190313", + "creditorId": "FR41510118000", + "endToEndId": "12345678902020101604", + "mandateId": "Mandate-16102020-4", + "bankTransactionCode": "PMNT-RDDT-ESDD", + "proprietaryBankTransactionCode": "NDDT+105", + "creditorName": "External Creditor", + "creditorAccount": { + "iban": "FR7618206000103056966400" + }, + "ultimateCreditor": "Ultimate creditor name", + "debtorName": "Max Mustermann", + "debtorAccount": { + "iban": "DE74310108330000009001" + }, + "ultimateDebtor": "Ultimate debtor name", + "transactionAmount": { + "currency": "EUR", + "amount": -46.97 + }, + "bookingDate": "2019-03-13", + "valueDate": "2019-03-13", + "remittanceInformationUnstructured": "Incoming Sepa Direct Debit" + } + ] + }, + "balances": [ + { + "balanceType": "closingBooked", + "balanceAmount": { + "currency": "EUR", + "amount": "175387.25" + }, + "referenceDate": "2019-03-13" + }, + { + "balanceType": "openingBooked", + "balanceAmount": { + "currency": "EUR", + "amount": "180387.25" + }, + "referenceDate": "2019-03-13" + } + ] + } + } +} diff --git a/adapters/santander-adapter/src/test/resources/oauth2/get-access-token.json b/adapters/santander-adapter/src/test/resources/oauth2/get-access-token.json new file mode 100644 index 000000000..09febcc91 --- /dev/null +++ b/adapters/santander-adapter/src/test/resources/oauth2/get-access-token.json @@ -0,0 +1,23 @@ +{ + "request": { + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": { + "code": "fooboo", + "redirect_uri": "https://client.example.com/cb", + "grant_type": "authorization_code", + "sca_oauth_link": "/.well-known/oauth-authorization-server", + "client_id": "PSDDE-SANDBOX-0006", + "code_verifier": "YSxbsfx6L9dMsHEAoom5Rls2a6qrF6D8_nbfUT6J948" + } + }, + "response": { + "body": { + "scope": "payments.write periodicpayments.read fundsconfirmations.read consents.write consents.read payments.read accounts.read periodicpayments.write", + "access_token": "5e71f077-39e2-4f2a-a28b-feebf53f8b88", + "token_type": "bearer", + "expires_in": 599 + } + } +} diff --git a/adapters/santander-adapter/src/test/resources/oauth2/get-authorization-endpoint.json b/adapters/santander-adapter/src/test/resources/oauth2/get-authorization-endpoint.json new file mode 100644 index 000000000..3fc1a543c --- /dev/null +++ b/adapters/santander-adapter/src/test/resources/oauth2/get-authorization-endpoint.json @@ -0,0 +1,15 @@ +{ + "request": { + "headers": { + "X-GTW-ASPSP-ID": "14a0c2ad-b9bf-4200-853a-a7abe541b714" + }, + "params": { + "state": "xyz", + "redirect_uri": "https://client.example.com/cb", + "sca_oauth_link": "/.well-known/oauth-authorization-server", + "consent_id": "3087d8e2-2eb0-4e54-9af9-32ea8c6eef02", + "code_challenge": "hvN5UqBsdJJ9IzaaFN26enIYqIRyNQPwoCd74DmHCXU", + "client_id": "PSDDE-SANDBOX-0006" + } + } +} diff --git a/adapters/santander-adapter/src/test/resources/oauth2/get-client-credentials-token.json b/adapters/santander-adapter/src/test/resources/oauth2/get-client-credentials-token.json new file mode 100644 index 000000000..f07bc135b --- /dev/null +++ b/adapters/santander-adapter/src/test/resources/oauth2/get-client-credentials-token.json @@ -0,0 +1,18 @@ +{ + "request": { + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": { + "grant_type": "client_credentials" + } + }, + "response": { + "body": { + "access_token": "4f4f45b7-c75a-426c-98ab-c109b3b19b5c", + "token_type": "bearer", + "expires_in": 599, + "scope": "payments.write periodicpayments.read fundsconfirmations.read consents.write consents.read payments.read accounts.read periodicpayments.write" + } + } +} diff --git a/adapters/santander-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json b/adapters/santander-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json new file mode 100644 index 000000000..0e3ad8aa3 --- /dev/null +++ b/adapters/santander-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json @@ -0,0 +1,14 @@ +{ + "request": { + "headers": { + "X-Request-ID": "06b43276-40f6-4ba4-aa8a-50c8e7f2781e", + "Authorization": "Bearer 6758aa6a-c04e-4828-991b-3ae82d340e87", + "PSU-IP-Address": "81.82.83.84" + } + }, + "response": { + "body": { + "transactionStatus": "RCVD" + } + } +} diff --git a/adapters/santander-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json b/adapters/santander-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json new file mode 100644 index 000000000..432e3b0ec --- /dev/null +++ b/adapters/santander-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json @@ -0,0 +1,44 @@ +{ + "request": { + "headers": { + "X-Request-ID": "57f3a3cb-5699-4871-9bd5-aacddce09aa8", + "TPP-Redirect-URI": "https://example.com/redirect", + "PSU-IP-Address": "37.44.220.0", + "Content-Type": "application/json; charset=UTF-8" + }, + "body": { + "endToEndIdentification": "SandboxTPPTest1", + "debtorAccount": { + "iban": "DE74310108330000009001", + "currency": "EUR" + }, + "instructedAmount": { + "currency": "EUR", + "amount": "20.99" + }, + "creditorAccount": { + "iban": "DE74310108330000009001", + "currency": "EUR" + }, + "creditorName": "Anton Brueckner", + "remittanceInformationUnstructured": "just" + } + }, + "response": { + "body": { + "transactionStatus": "RCVD", + "paymentId": "73c52dc3-bd44-42b3-bc86-6b61c3167b63", + "_links": { + "scaOAuth": { + "href": "/.well-known/oauth-authorization-server" + }, + "self": { + "href": "/v1/payments/sepa-credit-transfers/73c52dc3-bd44-42b3-bc86-6b61c3167b63" + }, + "status": { + "href": "/v1/payments/sepa-credit-transfers/73c52dc3-bd44-42b3-bc86-6b61c3167b63/status" + } + } + } + } +} diff --git a/adapters/verlag-adapter/src/main/resources/verlag-adapter/__files/.gitkeep b/adapters/verlag-adapter/src/main/resources/verlag-adapter/__files/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc b/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc index c14a59fca..f6872452e 100644 --- a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc +++ b/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc @@ -5,6 +5,7 @@ |=== == Notices: +- added WireMock stubs for `santander-adapter` == Features: diff --git a/xs2a-adapter-service-api/src/main/resources/adapter.config.properties b/xs2a-adapter-service-api/src/main/resources/adapter.config.properties index c8013c9d4..7cbef6f95 100644 --- a/xs2a-adapter-service-api/src/main/resources/adapter.config.properties +++ b/xs2a-adapter-service-api/src/main/resources/adapter.config.properties @@ -27,4 +27,4 @@ sparda.client_id= # Deutsche Bank Configuration # URL to get a certificate for encrypting password, usually used by Postbank -deutsche-bank.aspsp.certificate.url=https://xs2a.db.com/pb/aspsp-certificates/tpp-pb-password_cert.pem \ No newline at end of file +deutsche-bank.aspsp.certificate.url=https://xs2a.db.com/pb/aspsp-certificates/tpp-pb-password_cert.pem From 6dcebe8732871945b7e60a7a3f8deb25871b615f Mon Sep 17 00:00:00 2001 From: Alexander Berezkin Date: Fri, 17 Sep 2021 10:22:47 +0300 Subject: [PATCH 05/10] fixed release script (#624) --- .github/workflows/release.yml | 65 +++++++++++-------- .../DRAFT_Release_notes_0.1.16.adoc | 3 +- 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95c76dd4e..4c5da391c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,8 +13,8 @@ env: XS2A_ADAPTER_ORGANIZATION_NAME: adorsys jobs: - build: - name: Publish project artifacts to Maven Central + build-and-push-to-dockerhub: + name: Build and push image to Dockerhub runs-on: ubuntu-latest steps: - name: Git checkout @@ -25,37 +25,14 @@ jobs: with: java-version: 11 - - uses: actions/cache@v1 + - name: Cache local Maven repository + uses: actions/cache@v2 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - - name: Build & Publish - run: | - export GPG_TTY="$( tty )" - echo ${{ secrets.GPG_SECRET_KEY }} | base64 --decode | gpg --import --batch --yes - echo ${{ secrets.GPG_OWNERTRUST }} | base64 --decode | gpg --batch --import-ownertrust --yes - mvn -ntp --settings scripts/mvn-release-settings.xml \ - -Dhttp.keepAlive=false \ - -Dmaven.wagon.http.pool=false \ - -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 \ - -Prelease -DskipTests -B -U deploy - shell: bash - - build-and-push-to-dockerhub: - name: Build and push image to Dockerhub - runs-on: ubuntu-latest - steps: - - name: Git checkout - uses: actions/checkout@v2 - - - name: Setup java - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Build project run: mvn clean package -Dmaven.test.skip=true -B @@ -75,7 +52,39 @@ jobs: with: context: . push: true - tags: ${DOCKERHUB_IMAGE_NAME} + tags: ${{ env.DOCKERHUB_IMAGE_NAME }} + + build: + name: Publish project artifacts to Maven Central + needs: build-and-push-to-dockerhub + runs-on: ubuntu-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + + - name: Setup java + uses: actions/setup-java@v1 + with: + java-version: 11 + + - uses: actions/cache@v1 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Build & Publish + run: | + export GPG_TTY="$( tty )" + echo ${{ secrets.GPG_SECRET_KEY }} | base64 --decode | gpg --import --batch --yes + echo ${{ secrets.GPG_OWNERTRUST }} | base64 --decode | gpg --batch --import-ownertrust --yes + mvn -ntp --settings scripts/mvn-release-settings.xml \ + -Dhttp.keepAlive=false \ + -Dmaven.wagon.http.pool=false \ + -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 \ + -Prelease -DskipTests -B -U deploy + shell: bash build-and-deploy-docs: name: Build and deploy documentation diff --git a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc b/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc index f6872452e..e0cb08fcb 100644 --- a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc +++ b/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc @@ -5,8 +5,9 @@ |=== == Notices: -- added WireMock stubs for `santander-adapter` +- added WireMock stubs for `santander-adapter`. == Features: == Fixes: +- amended `release` script and rearranged steps. From e987ef48d5e0d4e79ac5958e3460b52d8d8c29d6 Mon Sep 17 00:00:00 2001 From: Alexander Berezkin Date: Fri, 17 Sep 2021 12:33:54 +0300 Subject: [PATCH 06/10] Fix sparkasse wiremock stubs (#625) * updated sparkasse stubs * release notes --- .../sparkasse-adapter/mappings/ais-create-consent.json | 2 +- .../sparkasse-adapter/mappings/ais-delete-consent.json | 2 +- .../sparkasse-adapter/mappings/ais-get-accounts.json | 2 +- .../sparkasse-adapter/mappings/ais-get-consent-status.json | 2 +- .../sparkasse-adapter/mappings/ais-get-sca-status.json | 2 +- .../sparkasse-adapter/mappings/ais-get-transactions.json | 2 +- .../sparkasse-adapter/mappings/ais-select-sca-method.json | 6 +++--- .../resources/sparkasse-adapter/mappings/ais-send-otp.json | 2 +- .../mappings/ais-start-psu-authentication.json | 2 +- .../pis-payments-pain001-sct-get-payment-status.json | 2 +- .../mappings/pis-payments-pain001-sct-get-sca-status.json | 2 +- .../mappings/pis-payments-pain001-sct-initiate-payment.json | 2 +- .../pis-payments-pain001-sct-select-sca-method.json | 2 +- .../mappings/pis-payments-pain001-sct-send-otp.json | 2 +- .../pis-payments-pain001-sct-start-psu-authentication.json | 2 +- .../mappings/pis-payments-sct-get-payment-status.json | 2 +- .../mappings/pis-payments-sct-get-sca-status.json | 2 +- .../mappings/pis-payments-sct-initiate-payment.json | 2 +- .../mappings/pis-payments-sct-select-sca-method.json | 6 +++--- .../mappings/pis-payments-sct-send-otp.json | 2 +- .../mappings/pis-payments-sct-start-psu-authentication.json | 2 +- .../src/test/resources/ais/select-sca-method.json | 4 ++-- .../payments/sepa-credit-transfers/select-sca-method.json | 4 ++-- docs/release_notes/DRAFT_Release_notes_0.1.16.adoc | 1 + 24 files changed, 30 insertions(+), 29 deletions(-) diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-create-consent.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-create-consent.json index 82a712338..8407889ca 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-create-consent.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-create-consent.json @@ -2,7 +2,7 @@ "id" : "2d8c8b3e-a819-4ae9-9919-ef0fd32c2e77", "name" : "v1_consents", "request" : { - "url" : "/v1/consents", + "urlPattern" : ".*/v1/consents", "method" : "POST", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-delete-consent.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-delete-consent.json index 2da1d8d18..c608bc2b3 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-delete-consent.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-delete-consent.json @@ -2,7 +2,7 @@ "id" : "ed9b1fb4-bc6c-4fc6-b6bb-6c0cb3a264bf", "name" : "v1_consents_e3d6fd32-8e41-498b-a20a-c643215e420c", "request" : { - "urlPattern" : "/v1/consents/.+", + "urlPattern" : ".*/v1/consents/.+", "method" : "DELETE", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-accounts.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-accounts.json index a10c99560..d95cf1b57 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-accounts.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-accounts.json @@ -2,7 +2,7 @@ "id" : "c8c2b316-9eda-4334-9a4a-199a1f4ef844", "name" : "v1_accounts", "request" : { - "url" : "/v1/accounts?withBalance=false", + "urlPattern" : ".*/v1/accounts\\?withBalance=false", "method" : "GET", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-consent-status.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-consent-status.json index c1e7e674b..ddf0d4796 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-consent-status.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-consent-status.json @@ -2,7 +2,7 @@ "id" : "652c47ec-99d1-4b70-8cba-0a3987ddd0ce", "name" : "v1_consents_e3d6fd32-8e41-498b-a20a-c643215e420c_status", "request" : { - "urlPattern" : "/v1/consents/.+/status", + "urlPattern" : ".*/v1/consents/.+/status", "method" : "GET", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-sca-status.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-sca-status.json index 36306f001..af053a41d 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-sca-status.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-sca-status.json @@ -2,7 +2,7 @@ "id" : "14b2e727-ea44-4d0d-aaff-db5812d0140c", "name" : "v1_consents_e3d6fd32-8e41-498b-a20a-c643215e420c_authorisations_a7129418-87e2-43c3-ba57-38aa2e23093b", "request" : { - "urlPattern" : "/v1/consents/.+/authorisations/.+", + "urlPattern" : ".*/v1/consents/.+/authorisations/.+", "method" : "GET", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-transactions.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-transactions.json index c710e41a5..49e9e56cf 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-transactions.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-get-transactions.json @@ -2,7 +2,7 @@ "id" : "223e646a-6b1f-4023-b89a-e22d36bf8687", "name" : "v1_accounts_3217d050-f5b5-4318-a799-413bce784ef6_transactions", "request" : { - "urlPattern" : "/v1/accounts/.+/transactions\\?dateFrom=.+&dateTo=.+&bookingStatus=booked&withBalance=true", + "urlPattern" : ".*/v1/accounts/.+/transactions\\?dateFrom=.+&dateTo=.+&bookingStatus=booked&withBalance=true", "method" : "GET", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-select-sca-method.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-select-sca-method.json index 2ec963e3b..6f147f3c7 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-select-sca-method.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-select-sca-method.json @@ -2,7 +2,7 @@ "id" : "7f5448ee-3988-4742-bae6-5ca325b72b0d", "name" : "v1_consents_e3d6fd32-8e41-498b-a20a-c643215e420c_authorisations_a7129418-87e2-43c3-ba57-38aa2e23093b", "request" : { - "urlPattern" : "/v1/consents/.+/authorisations/.+", + "urlPattern" : ".*/v1/consents/.+/authorisations/.+", "method" : "PUT", "headers" : { "X-Request-ID" : { @@ -22,14 +22,14 @@ } }, "bodyPatterns" : [ { - "equalToJson" : "{\"authenticationMethodId\":\"MANUAL\"}", + "equalToJson" : "{\"authenticationMethodId\":\"OPTICAL\"}", "ignoreArrayOrder" : true, "ignoreExtraElements" : true } ] }, "response" : { "status" : 200, - "body" : "{\"scaStatus\":\"scaMethodSelected\",\"chosenScaMethod\":{\"authenticationType\":\"CHIP_OTP\",\"authenticationMethodId\":\"MANUAL\",\"authenticationVersion\":\"HHD1.3.2\",\"name\":\"chipTAN MANUAL | Kartennummer: ******9876\",\"explanation\":\"Erfassung der Auftragsdaten über die Tasten Ihres TAN-Generator.\"},\"challengeData\":{\"otpMaxLength\":6,\"otpFormat\":\"integer\",\"additionalInformation\":\"Sie haben eine 'Einzelüberweisung' erfasst: Überprüfen Sie die Richtigkeit der 'letzten 10 Zeichen der IBAN des Empfängers' und bestätigen Sie diese mit der Taste 'OK'. Überprüfen Sie die Richtigkeit des 'Betrags' und bestätigen Sie diesen mit der Taste 'OK'.\"},\"_links\":{\"authoriseTransaction\":{\"href\":\"https://xs2a-sandbox.f-i-apim.de:8444/fixs2a-env/xs2a-api/12345678/v1/consents/e3d6fd32-8e41-498b-a20a-c643215e420c/authorisations/a7129418-87e2-43c3-ba57-38aa2e23093b\"},\"scaStatus\":{\"href\":\"https://xs2a-sandbox.f-i-apim.de:8444/fixs2a-env/xs2a-api/12345678/v1/consents/e3d6fd32-8e41-498b-a20a-c643215e420c/authorisations/a7129418-87e2-43c3-ba57-38aa2e23093b\"}},\"psuMessage\":\"Bitte geben Sie die TAN ein.\"}", + "body" : "{\"scaStatus\":\"scaMethodSelected\",\"chosenScaMethod\":{\"authenticationType\":\"CHIP_OTP\",\"authenticationMethodId\":\"OPTICAL\",\"authenticationVersion\":\"HHD1.3.2\",\"name\":\"chipTAN MANUAL | Kartennummer: ******9876\",\"explanation\":\"Erfassung der Auftragsdaten über die Tasten Ihres TAN-Generator.\"},\"challengeData\":{\"otpMaxLength\":6,\"otpFormat\":\"integer\",\"additionalInformation\":\"Sie haben eine 'Einzelüberweisung' erfasst: Überprüfen Sie die Richtigkeit der 'letzten 10 Zeichen der IBAN des Empfängers' und bestätigen Sie diese mit der Taste 'OK'. Überprüfen Sie die Richtigkeit des 'Betrags' und bestätigen Sie diesen mit der Taste 'OK'.\"},\"_links\":{\"authoriseTransaction\":{\"href\":\"https://xs2a-sandbox.f-i-apim.de:8444/fixs2a-env/xs2a-api/12345678/v1/consents/e3d6fd32-8e41-498b-a20a-c643215e420c/authorisations/a7129418-87e2-43c3-ba57-38aa2e23093b\"},\"scaStatus\":{\"href\":\"https://xs2a-sandbox.f-i-apim.de:8444/fixs2a-env/xs2a-api/12345678/v1/consents/e3d6fd32-8e41-498b-a20a-c643215e420c/authorisations/a7129418-87e2-43c3-ba57-38aa2e23093b\"}},\"psuMessage\":\"Bitte geben Sie die TAN ein.\"}", "headers" : { "Date" : "Thu, 06 Aug 2020 09:03:46 GMT", "Server" : "Apache", diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-send-otp.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-send-otp.json index 2591ec4d9..df81d605a 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-send-otp.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-send-otp.json @@ -2,7 +2,7 @@ "id" : "f78929d3-6c23-4b4e-b28d-34941546b4b3", "name" : "v1_consents_e3d6fd32-8e41-498b-a20a-c643215e420c_authorisations_a7129418-87e2-43c3-ba57-38aa2e23093b", "request" : { - "urlPattern" : "/v1/consents/.+/authorisations/.+", + "urlPattern" : ".*/v1/consents/.+/authorisations/.+", "method" : "PUT", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-start-psu-authentication.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-start-psu-authentication.json index e96e42aff..a4931fe55 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-start-psu-authentication.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/ais-start-psu-authentication.json @@ -2,7 +2,7 @@ "id" : "322e7f81-9535-45e7-8a20-b0f37547a99a", "name" : "v1_consents_e3d6fd32-8e41-498b-a20a-c643215e420c_authorisations", "request" : { - "urlPattern" : "/v1/consents/.+/authorisations", + "urlPattern" : ".*/v1/consents/.+/authorisations", "method" : "POST", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-get-payment-status.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-get-payment-status.json index 39cfb1fad..90200a807 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-get-payment-status.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-get-payment-status.json @@ -2,7 +2,7 @@ "id" : "012faa6c-df35-4d2f-a3bb-225704860dc7", "name" : "v1_payments_pain001-sepa-credit-transfers_850987d5-eb54-4053-84c1-945485147e3b_status", "request" : { - "urlPattern" : "/v1/payments/pain.001-sepa-credit-transfers/.+/status", + "urlPattern" : ".*/v1/payments/pain.001-sepa-credit-transfers/.+/status", "method" : "GET", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-get-sca-status.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-get-sca-status.json index 384b9bcf5..e8dd5b26b 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-get-sca-status.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-get-sca-status.json @@ -2,7 +2,7 @@ "id" : "70d2f382-4c25-4050-b288-8cce6ba581f6", "name" : "v1_payments_pain001-sepa-credit-transfers_850987d5-eb54-4053-84c1-945485147e3b_authorisations_cafd117d-2969-48be-b003-acd835bb02e6", "request" : { - "urlPattern" : "/v1/payments/pain.001-sepa-credit-transfers/.+/authorisations/.+", + "urlPattern" : ".*/v1/payments/pain.001-sepa-credit-transfers/.+/authorisations/.+", "method" : "GET", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-initiate-payment.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-initiate-payment.json index 025f8fe39..71fa27244 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-initiate-payment.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-initiate-payment.json @@ -2,7 +2,7 @@ "id" : "55e2ba0e-f856-4f38-85e0-4e6824a5ad83", "name" : "v1_payments_pain001-sepa-credit-transfers", "request" : { - "url" : "/v1/payments/pain.001-sepa-credit-transfers", + "urlPattern" : ".*/v1/payments/pain.001-sepa-credit-transfers", "method" : "POST", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-select-sca-method.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-select-sca-method.json index 13e6d0014..c55476095 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-select-sca-method.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-select-sca-method.json @@ -2,7 +2,7 @@ "id" : "8f4a2540-ea37-464c-9b24-b30dae495300", "name" : "v1_payments_pain001-sepa-credit-transfers_850987d5-eb54-4053-84c1-945485147e3b_authorisations_cafd117d-2969-48be-b003-acd835bb02e6", "request" : { - "urlPattern" : "/v1/payments/pain.001-sepa-credit-transfers/.+/authorisations/.+", + "urlPattern" : ".*/v1/payments/pain.001-sepa-credit-transfers/.+/authorisations/.+", "method" : "PUT", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-send-otp.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-send-otp.json index 7a91aa5d9..be10d848f 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-send-otp.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-send-otp.json @@ -2,7 +2,7 @@ "id" : "9670ecdb-e205-4615-956a-26b40a0dbe91", "name" : "v1_payments_pain001-sepa-credit-transfers_850987d5-eb54-4053-84c1-945485147e3b_authorisations_cafd117d-2969-48be-b003-acd835bb02e6", "request" : { - "urlPattern" : "/v1/payments/pain.001-sepa-credit-transfers/.+/authorisations/.+", + "urlPattern" : ".*/v1/payments/pain.001-sepa-credit-transfers/.+/authorisations/.+", "method" : "PUT", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-start-psu-authentication.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-start-psu-authentication.json index b54367958..3cdab4e43 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-start-psu-authentication.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-pain001-sct-start-psu-authentication.json @@ -2,7 +2,7 @@ "id" : "c4d4ee12-d29c-491b-b170-ceecaa56870e", "name" : "v1_payments_pain001-sepa-credit-transfers_850987d5-eb54-4053-84c1-945485147e3b_authorisations", "request" : { - "urlPattern" : "/v1/payments/pain.001-sepa-credit-transfers/.+/authorisations", + "urlPattern" : ".*/v1/payments/pain.001-sepa-credit-transfers/.+/authorisations", "method" : "POST", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-get-payment-status.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-get-payment-status.json index 4bc32632b..ba8486bb6 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-get-payment-status.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-get-payment-status.json @@ -2,7 +2,7 @@ "id" : "ac22145d-3e6f-4144-bdd1-e2b3e2eb6199", "name" : "v1_payments_sepa-credit-transfers_5f6e3778-2b5c-460c-90f9-c86b0f5c5d57_status", "request" : { - "urlPattern" : "/v1/payments/sepa-credit-transfers/.+/status", + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/status", "method" : "GET", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-get-sca-status.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-get-sca-status.json index 0cdf3e9bd..974b6d538 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-get-sca-status.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-get-sca-status.json @@ -2,7 +2,7 @@ "id" : "2efa891e-90b1-427a-ae1c-1565021b0056", "name" : "v1_payments_sepa-credit-transfers_5f6e3778-2b5c-460c-90f9-c86b0f5c5d57_authorisations_c9ef5300-0091-47c6-9df9-2190313e8f03", "request" : { - "urlPattern" : "/v1/payments/sepa-credit-transfers/.+/authorisations/.+", + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/authorisations/.+", "method" : "GET", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-initiate-payment.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-initiate-payment.json index a21ea2728..c91f460e2 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-initiate-payment.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-initiate-payment.json @@ -2,7 +2,7 @@ "id" : "57876e20-85a8-4430-9a25-82dbbe77056b", "name" : "v1_payments_sepa-credit-transfers", "request" : { - "url" : "/v1/payments/sepa-credit-transfers", + "urlPattern" : ".*/v1/payments/sepa-credit-transfers", "method" : "POST", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-select-sca-method.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-select-sca-method.json index 24d41975a..e1d38ee6f 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-select-sca-method.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-select-sca-method.json @@ -2,7 +2,7 @@ "id" : "da43e19d-657f-4462-925b-c2f4d75d35a1", "name" : "v1_payments_sepa-credit-transfers_5f6e3778-2b5c-460c-90f9-c86b0f5c5d57_authorisations_c9ef5300-0091-47c6-9df9-2190313e8f03", "request" : { - "urlPattern" : "/v1/payments/sepa-credit-transfers/.+/authorisations/.+", + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/authorisations/.+", "method" : "PUT", "headers" : { "X-Request-ID" : { @@ -22,14 +22,14 @@ } }, "bodyPatterns" : [ { - "equalToJson" : "{\"authenticationMethodId\":\"MANUAL\"}", + "equalToJson" : "{\"authenticationMethodId\":\"OPTICAL\"}", "ignoreArrayOrder" : true, "ignoreExtraElements" : true } ] }, "response" : { "status" : 200, - "body" : "{\"scaStatus\":\"scaMethodSelected\",\"chosenScaMethod\":{\"authenticationType\":\"CHIP_OTP\",\"authenticationMethodId\":\"MANUAL\",\"authenticationVersion\":\"HHD1.3.2\",\"name\":\"chipTAN MANUAL | Kartennummer: ******9876\",\"explanation\":\"Erfassung der Auftragsdaten über die Tasten Ihres TAN-Generator.\"},\"challengeData\":{\"otpMaxLength\":6,\"otpFormat\":\"integer\",\"additionalInformation\":\"Sie haben eine 'Einzelüberweisung' erfasst: Überprüfen Sie die Richtigkeit der 'letzten 10 Zeichen der IBAN des Empfängers' und bestätigen Sie diese mit der Taste 'OK'. Überprüfen Sie die Richtigkeit des 'Betrags' und bestätigen Sie diesen mit der Taste 'OK'.\"},\"_links\":{\"scaStatus\":{\"href\":\"https://xs2a-sandbox.f-i-apim.de:8444/fixs2a-env/xs2a-api/12345678/v1/payments/sepa-credit-transfers/5f6e3778-2b5c-460c-90f9-c86b0f5c5d57/authorisations/c9ef5300-0091-47c6-9df9-2190313e8f03\"},\"authoriseTransaction\":{\"href\":\"https://xs2a-sandbox.f-i-apim.de:8444/fixs2a-env/xs2a-api/12345678/v1/payments/sepa-credit-transfers/5f6e3778-2b5c-460c-90f9-c86b0f5c5d57/authorisations/c9ef5300-0091-47c6-9df9-2190313e8f03\"}},\"psuMessage\":\"Bitte geben Sie die TAN ein.\"}", + "body" : "{\"scaStatus\":\"scaMethodSelected\",\"chosenScaMethod\":{\"authenticationType\":\"CHIP_OTP\",\"authenticationMethodId\":\"OPTICAL\",\"authenticationVersion\":\"HHD1.3.2\",\"name\":\"chipTAN MANUAL | Kartennummer: ******9876\",\"explanation\":\"Erfassung der Auftragsdaten über die Tasten Ihres TAN-Generator.\"},\"challengeData\":{\"otpMaxLength\":6,\"otpFormat\":\"integer\",\"additionalInformation\":\"Sie haben eine 'Einzelüberweisung' erfasst: Überprüfen Sie die Richtigkeit der 'letzten 10 Zeichen der IBAN des Empfängers' und bestätigen Sie diese mit der Taste 'OK'. Überprüfen Sie die Richtigkeit des 'Betrags' und bestätigen Sie diesen mit der Taste 'OK'.\"},\"_links\":{\"scaStatus\":{\"href\":\"https://xs2a-sandbox.f-i-apim.de:8444/fixs2a-env/xs2a-api/12345678/v1/payments/sepa-credit-transfers/5f6e3778-2b5c-460c-90f9-c86b0f5c5d57/authorisations/c9ef5300-0091-47c6-9df9-2190313e8f03\"},\"authoriseTransaction\":{\"href\":\"https://xs2a-sandbox.f-i-apim.de:8444/fixs2a-env/xs2a-api/12345678/v1/payments/sepa-credit-transfers/5f6e3778-2b5c-460c-90f9-c86b0f5c5d57/authorisations/c9ef5300-0091-47c6-9df9-2190313e8f03\"}},\"psuMessage\":\"Bitte geben Sie die TAN ein.\"}", "headers" : { "Date" : "Tue, 11 Aug 2020 07:47:39 GMT", "Server" : "Apache", diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-send-otp.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-send-otp.json index 0de1b8ec0..61e787e45 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-send-otp.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-send-otp.json @@ -2,7 +2,7 @@ "id" : "108ae84f-ed3f-4975-beda-bb6f123a08fc", "name" : "v1_payments_sepa-credit-transfers_5f6e3778-2b5c-460c-90f9-c86b0f5c5d57_authorisations_c9ef5300-0091-47c6-9df9-2190313e8f03", "request" : { - "urlPattern" : "/v1/payments/sepa-credit-transfers/.+/authorisations/.+", + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/authorisations/.+", "method" : "PUT", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-start-psu-authentication.json b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-start-psu-authentication.json index fbd894d28..b89956447 100644 --- a/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-start-psu-authentication.json +++ b/adapters/sparkasse-adapter/src/main/resources/sparkasse-adapter/mappings/pis-payments-sct-start-psu-authentication.json @@ -2,7 +2,7 @@ "id" : "8241860a-dbd8-4a5d-9379-6c10150897b9", "name" : "v1_payments_sepa-credit-transfers_5f6e3778-2b5c-460c-90f9-c86b0f5c5d57_authorisations", "request" : { - "urlPattern" : "/v1/payments/sepa-credit-transfers/.+/authorisations", + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/authorisations", "method" : "POST", "headers" : { "X-Request-ID" : { diff --git a/adapters/sparkasse-adapter/src/test/resources/ais/select-sca-method.json b/adapters/sparkasse-adapter/src/test/resources/ais/select-sca-method.json index 6ead5308c..fb6593ca1 100644 --- a/adapters/sparkasse-adapter/src/test/resources/ais/select-sca-method.json +++ b/adapters/sparkasse-adapter/src/test/resources/ais/select-sca-method.json @@ -8,7 +8,7 @@ "Content-Type": "application/json; charset=UTF-8" }, "body": { - "authenticationMethodId": "MANUAL" + "authenticationMethodId": "OPTICAL" } }, "response": { @@ -16,7 +16,7 @@ "scaStatus": "scaMethodSelected", "chosenScaMethod": { "authenticationType": "CHIP_OTP", - "authenticationMethodId": "MANUAL", + "authenticationMethodId": "OPTICAL", "authenticationVersion": "HHD1.3.2", "name": "chipTAN MANUAL | Kartennummer: ******9876", "explanation": "Erfassung der Auftragsdaten über die Tasten Ihres TAN-Generator." diff --git a/adapters/sparkasse-adapter/src/test/resources/pis/payments/sepa-credit-transfers/select-sca-method.json b/adapters/sparkasse-adapter/src/test/resources/pis/payments/sepa-credit-transfers/select-sca-method.json index 33c26c705..986ee6d8a 100644 --- a/adapters/sparkasse-adapter/src/test/resources/pis/payments/sepa-credit-transfers/select-sca-method.json +++ b/adapters/sparkasse-adapter/src/test/resources/pis/payments/sepa-credit-transfers/select-sca-method.json @@ -8,7 +8,7 @@ "Content-Type": "application/json; charset=UTF-8" }, "body": { - "authenticationMethodId": "MANUAL" + "authenticationMethodId": "OPTICAL" } }, "response": { @@ -16,7 +16,7 @@ "scaStatus": "scaMethodSelected", "chosenScaMethod": { "authenticationType": "CHIP_OTP", - "authenticationMethodId": "MANUAL", + "authenticationMethodId": "OPTICAL", "authenticationVersion": "HHD1.3.2", "name": "chipTAN MANUAL | Kartennummer: ******9876", "explanation": "Erfassung der Auftragsdaten über die Tasten Ihres TAN-Generator." diff --git a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc b/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc index e0cb08fcb..c286023c9 100644 --- a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc +++ b/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc @@ -11,3 +11,4 @@ == Fixes: - amended `release` script and rearranged steps. +- adjusted WireMock stubs for `sparkasse-adapter` to work in both WireMock tests and in WireMock Mode. From 178f9168d3c859eee7901586dfaae0d672f0b907 Mon Sep 17 00:00:00 2001 From: Alexander Berezkin Date: Wed, 22 Sep 2021 12:36:27 +0300 Subject: [PATCH 07/10] Unicredit wiremock (#626) * added ais stubs for unicredit * added PIS payments and periodic-payments stubs * return updatePaymentPsuData * disabled one test --- README.md | 1 + adapters/unicredit-adapter/pom.xml | 7 + .../unicredit-adapter/__files/.gitkeep | 0 .../mappings/ais-create-consent.json | 55 +++++ .../mappings/ais-delete-consent.json | 34 ++++ .../mappings/ais-get-accounts.json | 42 ++++ .../mappings/ais-get-balances.json.json | 39 ++++ .../mappings/ais-get-consent-status.json | 36 ++++ .../mappings/ais-get-sca-status.json | 36 ++++ .../mappings/ais-get-transactions.json | 39 ++++ .../mappings/ais-send-otp.json | 50 +++++ .../ais-start-psu-authentication.json | 48 +++++ .../ais-update-psu-authentication.json | 51 +++++ .../pis-payments-sct-get-payment-status.json | 36 ++++ .../pis-payments-sct-get-sca-status.json | 36 ++++ .../pis-payments-sct-initiate-payment.json | 58 ++++++ .../mappings/pis-payments-sct-send-otp.json | 53 +++++ ...payments-sct-start-psu-authentication.json | 51 +++++ ...ayments-sct-update-psu-authentication.json | 51 +++++ .../pis-periodic-sct-get-payment-status.json | 36 ++++ .../pis-periodic-sct-get-sca-status.json | 36 ++++ .../pis-periodic-sct-initiate-payment.json | 58 ++++++ .../mappings/pis-periodic-sct-send-otp.json | 50 +++++ ...periodic-sct-start-psu-authentication.json | 51 +++++ ...eriodic-sct-update-psu-authentication.json | 51 +++++ ...AccountInformationServiceWireMockTest.java | 152 ++++++++++++++ ...tPaymentInitiationServiceWireMockTest.java | 177 ++++++++++++++++ .../test/resources/ais/authenticate-psu.json | 24 +++ .../resources/ais/authorise-transaction.json | 23 +++ .../test/resources/ais/create-consent.json | 49 +++++ .../test/resources/ais/delete-consent.json | 7 + .../src/test/resources/ais/get-accounts.json | 57 ++++++ .../src/test/resources/ais/get-balances.json | 41 ++++ .../resources/ais/get-consent-status.json | 12 ++ .../test/resources/ais/get-sca-status.json | 18 ++ .../test/resources/ais/get-transactions.json | 192 ++++++++++++++++++ .../ais/update-psu-authentication.json | 37 ++++ .../authenticate-psu.json | 24 +++ .../authorise-transaction.json | 25 +++ .../get-payment-status.json | 12 ++ .../sepa-credit-transfers/get-sca-status.json | 12 ++ .../initiate-payment.json | 41 ++++ .../update-psu-authentication.json | 36 ++++ .../authenticate-psu.json | 24 +++ .../authorise-transaction.json | 23 +++ .../get-payment-status.json | 12 ++ .../sepa-credit-transfers/get-sca-status.json | 18 ++ .../initiate-payment.json | 46 +++++ .../update-psu-authentication.json | 36 ++++ .../DRAFT_Release_notes_0.1.16.adoc | 1 + 50 files changed, 2104 insertions(+) create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/__files/.gitkeep create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-create-consent.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-delete-consent.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-accounts.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-balances.json.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-consent-status.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-sca-status.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-transactions.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-send-otp.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-start-psu-authentication.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-update-psu-authentication.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-get-payment-status.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-get-sca-status.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-initiate-payment.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-send-otp.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-start-psu-authentication.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-update-psu-authentication.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-get-payment-status.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-get-sca-status.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-initiate-payment.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-send-otp.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-start-psu-authentication.json create mode 100644 adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-update-psu-authentication.json create mode 100644 adapters/unicredit-adapter/src/test/java/de/adorsys/xs2a/adapter/unicredit/UnicreditAccountInformationServiceWireMockTest.java create mode 100644 adapters/unicredit-adapter/src/test/java/de/adorsys/xs2a/adapter/unicredit/UnicreditPaymentInitiationServiceWireMockTest.java create mode 100644 adapters/unicredit-adapter/src/test/resources/ais/authenticate-psu.json create mode 100644 adapters/unicredit-adapter/src/test/resources/ais/authorise-transaction.json create mode 100644 adapters/unicredit-adapter/src/test/resources/ais/create-consent.json create mode 100644 adapters/unicredit-adapter/src/test/resources/ais/delete-consent.json create mode 100644 adapters/unicredit-adapter/src/test/resources/ais/get-accounts.json create mode 100644 adapters/unicredit-adapter/src/test/resources/ais/get-balances.json create mode 100644 adapters/unicredit-adapter/src/test/resources/ais/get-consent-status.json create mode 100644 adapters/unicredit-adapter/src/test/resources/ais/get-sca-status.json create mode 100644 adapters/unicredit-adapter/src/test/resources/ais/get-transactions.json create mode 100644 adapters/unicredit-adapter/src/test/resources/ais/update-psu-authentication.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/authenticate-psu.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/authorise-transaction.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/update-psu-authentication.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/authenticate-psu.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/authorise-transaction.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/get-payment-status.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/get-sca-status.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/initiate-payment.json create mode 100644 adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/update-psu-authentication.json diff --git a/README.md b/README.md index 12301ccff..5f74f1ebe 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ Not all adapters have written stubs though. Responses available for the next ada - sparkasse-adapter - verlag-adapter - santander-adapter +- unicredit-adapter New stubs will be added in time. diff --git a/adapters/unicredit-adapter/pom.xml b/adapters/unicredit-adapter/pom.xml index b6cbc1e62..82fb61753 100644 --- a/adapters/unicredit-adapter/pom.xml +++ b/adapters/unicredit-adapter/pom.xml @@ -24,6 +24,13 @@ + + de.adorsys.xs2a.adapter + xs2a-adapter-test + ${project.version} + test + + pro.javatar.commons javatar-commons diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/__files/.gitkeep b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/__files/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-create-consent.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-create-consent.json new file mode 100644 index 000000000..6c94b0f5a --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-create-consent.json @@ -0,0 +1,55 @@ +{ + "id" : "4476593f-cc13-48b5-b756-f7fd7738a4b5", + "name" : "hydrogen_v1_consents", + "request" : { + "urlPattern" : ".*/v1/consents", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "PSU-IP-Address" : { + "matches" : ".+" + }, + "PSU-ID-Type" : { + "equalTo" : "HVB_ONLINEBANKING" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"access\":{\"accounts\":[{\"iban\":\"DE49700202700123456785\",\"currency\":\"EUR\"}],\"balances\":[{\"iban\":\"DE49700202700123456785\",\"currency\":\"EUR\"}],\"transactions\":[{\"iban\":\"DE49700202700123456785\",\"currency\":\"EUR\"}]},\"recurringIndicator\":true,\"validUntil\":\"${json-unit.regex}\\\\d{4}-[01]\\\\d-[0-3]\\\\d\",\"frequencyPerDay\":4,\"combinedServiceIndicator\":false}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\r\n\t\"consentStatus\": \"received\",\r\n\t\"consentId\": \"12f6ed9d-fd09-4aea-97bc-aeb61052cf3e\",\r\n\t\"_links\": {\r\n\t\t\"startAuthorisation\": {\r\n\t\t\t\"href\": \"https://api-sandbox.unicredit.de/hydrogen/v1/consents/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e/authorisations\"\r\n\t\t}\r\n\t}\r\n}", + "headers" : { + "Date" : "Fri, 17 Sep 2021 14:03:25 GMT", + "X-Rate-Limit" : "[{\"window\":34,\"type\":\"throttle\",\"remaining\":29998}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-2da0446131a905ea1e8922a0 0; Id-2ea04461bc9956d8f1c0053a 0", + "ASPSP-SCA-Approach" : "EMBEDDED", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Location" : "https://api-sandbox.unicredit.de/hydrogen/v1/consents/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "de379d4b-b9e4-409f-9aeb-03ba711ef370", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "4476593f-cc13-48b5-b756-f7fd7738a4b5", + "persistent" : true, + "insertionIndex" : 3 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-delete-consent.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-delete-consent.json new file mode 100644 index 000000000..57e11a297 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-delete-consent.json @@ -0,0 +1,34 @@ +{ + "id" : "9fc222ae-a3a5-4240-b265-a3eef16327e2", + "name" : "hydrogen_v1_consents_12f6ed9d-fd09-4aea-97bc-aeb61052cf3e", + "request" : { + "urlPattern" : ".*/v1/consents/.+", + "method" : "DELETE", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + } + } + }, + "response" : { + "status" : 204, + "headers" : { + "Date" : "Fri, 17 Sep 2021 14:04:09 GMT", + "X-Rate-Limit" : "[{\"window\":50,\"type\":\"throttle\",\"remaining\":29996}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-59a04461a584ebe12c6695b5 0; Id-59a04461bd7fe290bdfb2ed3 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "5b83bf03-7b7b-4e83-aff2-501ae89fdcb4", + "X-XSS-Protection" : "1", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "9fc222ae-a3a5-4240-b265-a3eef16327e2", + "persistent" : true, + "insertionIndex" : 12 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-accounts.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-accounts.json new file mode 100644 index 000000000..56ed52e32 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-accounts.json @@ -0,0 +1,42 @@ +{ + "id" : "72726135-e0c9-4158-a994-d83caf15ee04", + "name" : "hydrogen_v1_accounts", + "request" : { + "urlPattern" : ".*/v1/accounts", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "12f6ed9d-fd09-4aea-97bc-aeb61052cf3e" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\r\n \"accounts\": [\r\n {\r\n \"resourceId\": \"3dc3d5b37023\",\r\n \"iban\": \"DE49700202700123456785\",\r\n \"currency\": \"EUR\",\r\n \"name\": \"Account-1\",\r\n \"product\": \"lorem ipsum\",\r\n \"bic\": \"HYVEDEMMXXX\",\r\n \"usage\": \"PRIV\",\r\n \"details\": \"lorem ipsum\",\r\n \"balances\": [\r\n {\r\n \"balanceAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"123456.78\"\r\n },\r\n \"balanceType\": \"expected\",\r\n \"lastChangeDateTime\": \"2019-10-14T09:00:00Z\",\r\n \"referenceDate\": \"2019-10-14\"\r\n },\r\n {\r\n \"balanceAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"234567.89\"\r\n },\r\n \"balanceType\": \"authorised\",\r\n \"lastChangeDateTime\": \"2019-10-13T20:00:00Z\",\r\n \"referenceDate\": \"2019-10-13\"\r\n },\r\n {\r\n \"balanceAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"29944\"\r\n },\r\n \"balanceType\": \"closingBooked\",\r\n \"lastChangeDateTime\": \"2019-10-13T20:00:00Z\",\r\n \"referenceDate\": \"2019-10-13\"\r\n }\r\n ]\r\n }\r\n ]\r\n}", + "headers" : { + "Date" : "Fri, 17 Sep 2021 14:03:52 GMT", + "X-Rate-Limit" : "[{\"window\":7,\"type\":\"throttle\",\"remaining\":29992}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-48a044618e84940e353b7bb5 0; Id-48a04461d499b328a2bcc2e8 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "e07e37a2-3bfb-41e5-b3d7-dad9c31120c2", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "72726135-e0c9-4158-a994-d83caf15ee04", + "persistent" : true, + "insertionIndex" : 7 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-balances.json.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-balances.json.json new file mode 100644 index 000000000..580fb0845 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-balances.json.json @@ -0,0 +1,39 @@ +{ + "id" : "2ef2c633-061a-4591-802a-97a16c7d2cfd", + "name" : "hydrogen_v1_accounts_3dc3d5b37023_balances", + "request" : { + "urlPattern" : ".*/v1/accounts/.+/balances", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "12f6ed9d-fd09-4aea-97bc-aeb61052cf3e" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\r\n \"account\": {\r\n \"iban\": \"DE49700202700123456785\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"balances\": [{\r\n \"balanceAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"123456.78\"\r\n },\r\n \"balanceType\": \"expected\",\r\n \"lastChangeDateTime\": \"2019-10-14T09:00:00Z\",\r\n \"referenceDate\": \"2019-10-14\"\r\n },{\r\n \"balanceAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"234567.89\"\r\n },\r\n \"balanceType\": \"authorised\",\r\n \"lastChangeDateTime\": \"2019-10-13T20:00:00Z\",\r\n \"referenceDate\": \"2019-10-13\"\r\n },{\r\n \"balanceAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"29944\"\r\n },\r\n \"balanceType\": \"closingBooked\",\r\n \"lastChangeDateTime\": \"2019-10-13T20:00:00Z\",\r\n \"referenceDate\": \"2019-10-13\"\r\n }]\r\n}\r\n", + "headers" : { + "Date" : "Fri, 17 Sep 2021 14:04:01 GMT", + "X-Rate-Limit" : "[{\"window\":58,\"type\":\"throttle\",\"remaining\":29999}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-51a044615da99fe012d9f933 0; Id-51a04461b47f7fdef22acc21 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "12bebce0-1a19-45f3-9a08-42b38ab7d8ff", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "2ef2c633-061a-4591-802a-97a16c7d2cfd", + "persistent" : true, + "insertionIndex" : 9 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-consent-status.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-consent-status.json new file mode 100644 index 000000000..05e226de8 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-consent-status.json @@ -0,0 +1,36 @@ +{ + "id" : "01a38a4b-12de-4791-872b-ebbe432e7e84", + "name" : "hydrogen_v1_consents_12f6ed9d-fd09-4aea-97bc-aeb61052cf3e_status", + "request" : { + "urlPattern" : ".*/v1/consents/.+/status", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\r\n\t\"consentStatus\": \"valid\"\r\n}", + "headers" : { + "Date" : "Fri, 17 Sep 2021 14:04:06 GMT", + "X-Rate-Limit" : "[{\"window\":53,\"type\":\"throttle\",\"remaining\":29997}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-56a04461a084b5c10f725b95 0; Id-56a04461ba7f0f7c17555b3e 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "dd8ed8b2-ee42-48df-9eca-7c139bf0f8b9", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "01a38a4b-12de-4791-872b-ebbe432e7e84", + "persistent" : true, + "insertionIndex" : 11 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-sca-status.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-sca-status.json new file mode 100644 index 000000000..216023f6e --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-sca-status.json @@ -0,0 +1,36 @@ +{ + "id" : "3ff98560-4cb1-433c-90f7-94f680a1075e", + "name" : "hydrogen_v1_consents_12f6ed9d-fd09-4aea-97bc-aeb61052cf3e_authorisations_a7129418-87e2-43c3-ba57-38aa2e23093b", + "request" : { + "urlPattern" : ".*/v1/consents/.+/authorisations/.+", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + } + } + }, + "response" : { + "status" : 404, + "body" : "{\r\n \"tppMessages\": [\r\n {\r\n \"category\": \"ERROR\",\r\n \"code\": \"RESOURCE_UNKNOWN\",\r\n \"text\": \"The resource you are looking for was not found in our system\"\r\n }\r\n ]\r\n}", + "headers" : { + "Date" : "Fri, 17 Sep 2021 14:04:03 GMT", + "X-Rate-Limit" : "[{\"window\":56,\"type\":\"throttle\",\"remaining\":29998}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-53a044615ea9f625bf0cc2fc 0; Id-53a04461b77f5642f2a8901c 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "a0bcf913-3137-40be-b86b-3d74af0a2516", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "3ff98560-4cb1-433c-90f7-94f680a1075e", + "persistent" : true, + "insertionIndex" : 10 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-transactions.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-transactions.json new file mode 100644 index 000000000..940a3516c --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-transactions.json @@ -0,0 +1,39 @@ +{ + "id" : "d0850686-0fd1-4bf5-882a-1c5388002653", + "name" : "hydrogen_v1_accounts_3dc3d5b37023_transactions", + "request" : { + "urlPattern" : ".*/v1/accounts/.+/transactions\\?dateFrom=.+&dateTo=.+&bookingStatus=booked&withBalance=true", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "12f6ed9d-fd09-4aea-97bc-aeb61052cf3e" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\r\n \"account\": {\r\n \"iban\": \"DE49700202700123456785\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"transactions\": {\r\n \"booked\": [\r\n {\r\n \"transactionId\": \"1234567890123456\",\r\n \"endToEndId\": \"AAA10000234567890123456\",\r\n \"bookingDate\": \"2019-09-28\",\r\n \"valueDate\": \"2019-09-29\",\r\n \"transactionAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"180.12\"\r\n },\r\n \"creditorName\": \"Lorem ipsum\",\r\n \"creditorAccount\": {\r\n \"iban\": \"DE31701500000012345674\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"debtorName\": \"Our Customer\",\r\n \"debtorAccount\": {\r\n \"iban\": \"DE49700202700123456785\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"remittanceInformationUnstructured\": \"Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN\",\r\n\t \"proprietaryBankTransactionCode\": \"ÜBERWEISUNG (DIRECT BANKING\",\r\n\t\"additionalInformation\": \"ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001\"\r\n },\r\n {\r\n \"transactionId\": \"3456789012345612\",\r\n \"endToEndId\": \"BBB30000456789012345612\",\r\n \"bookingDate\": \"2019-09-02\",\r\n \"valueDate\": \"2019-09-02\",\r\n \"transactionAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"18119.12\"\r\n },\r\n \"creditorName\": \"Our Customer\",\r\n \"creditorAccount\": {\r\n \"iban\": \"DE49700202700123456785\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"debtorName\": \"duo dolores\",\r\n \"debtorAccount\": {\r\n \"iban\": \"DE72200505500000987651\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"remittanceInformationUnstructured\": \"Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN\",\r\n\"proprietaryBankTransactionCode\": \"ÜBERWEISUNG (DIRECT BANKING\",\r\n\t\"additionalInformation\": \"ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001\"\r\n },\r\n {\r\n \"transactionId\": \"5678901234561234\",\r\n \"endToEndId\": \"CCC50000678901234561234\",\r\n \"bookingDate\": \"2019-09-08\",\r\n \"valueDate\": \"2019-09-08\",\r\n \"transactionAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"119.12\"\r\n },\r\n \"creditorName\": \"Our Customer\",\r\n \"creditorAccount\": {\r\n \"iban\": \"DE49700202700123456785\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"debtorName\": \"duo dolores\",\r\n \"debtorAccount\": {\r\n \"iban\": \"DE72200505500000987651\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"remittanceInformationUnstructured\": \"Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN\",\r\n\"proprietaryBankTransactionCode\": \"ÜBERWEISUNG (DIRECT BANKING\",\r\n\t\"additionalInformation\": \"ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001\"\r\n },\r\n {\r\n \"transactionId\": \"7890123456123456\",\r\n \"endToEndId\": \"DDD70000890123456123456\",\r\n \"creditorId\": \"DE94ZZZ00000012345\",\r\n \"bookingDate\": \"2019-09-13\",\r\n \"valueDate\": \"2019-09-13\",\r\n \"transactionAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"472.96\"\r\n },\r\n \"creditorName\": \"voluptates repudiandae\",\r\n \"creditorAccount\": {\r\n \"iban\": \"DE12500105170648489890\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"debtorName\": \"Our Customer\",\r\n \"debtorAccount\": {\r\n \"iban\": \"DE49700202700123456785\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"remittanceInformationUnstructured\": \" Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN\",\r\n\t\"proprietaryBankTransactionCode\": \"ÜBERWEISUNG (DIRECT BANKING\",\r\n\t\"additionalInformation\": \"ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001\"\r\n },\r\n {\r\n \"transactionId\": \"9012345612345678\",\r\n \"endToEndId\": \"EEE90000012345612345678\",\r\n \"mandateId\": \"87654321\",\r\n \"creditorId\": \"DE94ZZZ000000234567\",\r\n \"bookingDate\": \"2019-09-25\",\r\n \"valueDate\": \"2019-09-25\",\r\n \"transactionAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"21.80\"\r\n },\r\n \"creditorName\": \"Itaque earum\",\r\n \"creditorAccount\": {\r\n \"iban\": \"DE12500400000123456780\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"debtorName\": \"Our Customer\",\r\n \"debtorAccount\": {\r\n \"iban\": \"DE49700202700123456785\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"remittanceInformationUnstructured\": \"Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN\",\r\n\"proprietaryBankTransactionCode\": \"ÜBERWEISUNG (DIRECT BANKING\",\r\n\t\"additionalInformation\": \"Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN\"\r\n },\r\n {\r\n \"transactionId\": \"9112345612345678\",\r\n \"endToEndId\": \"FFF90000112345612345678\",\r\n \"mandateId\": \"86101000320\",\r\n \"bookingDate\": \"2019-10-05\",\r\n \"valueDate\": \"2019-10-05\",\r\n \"transactionAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"2000.00\"\r\n },\r\n \"creditorName\": \"Card Transaction Card: 1234-1711-1234-1234\",\r\n \"creditorAccount\": {\r\n \"iban\": \"BE68844010370034\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"debtorName\": \"Our Customer\",\r\n \"debtorAccount\": {\r\n \"iban\": \"NL18ABNA0484869868\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"remittanceInformationUnstructured\": \" Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN\",\r\n\t\"proprietaryBankTransactionCode\": \"ÜBERWEISUNG (DIRECT BANKING\",\r\n\t\"additionalInformation\": \"ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001\"\r\n },\r\n {\r\n \"transactionId\": \"5678901234567890\",\r\n \"endToEndId\": \"CCC50000678901234567890\",\r\n \"bookingDate\": \"2019-10-08\",\r\n \"valueDate\": \"2019-10-08\",\r\n \"transactionAmount\": {\r\n \"currency\": \"EUR\",\r\n \"amount\": \"9269.12\"\r\n },\r\n \"creditorName\": \"Our Customer\",\r\n \"creditorAccount\": {\r\n \"iban\": \"DE49700202700123456785\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"debtorName\": \"At vero\",\r\n \"debtorAccount\": {\r\n \"iban\": \"DE12500400000123456780\",\r\n \"currency\": \"EUR\"\r\n },\r\n \"remittanceInformationUnstructured\": \" Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN\",\r\n\"proprietaryBankTransactionCode\": \"ÜBERWEISUNG (DIRECT BANKING\",\r\n\t\"additionalInformation\": \"ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001\"\r\n }\r\n ]\r\n }\r\n}\r\n", + "headers" : { + "Date" : "Fri, 17 Sep 2021 14:03:55 GMT", + "X-Rate-Limit" : "[{\"window\":4,\"type\":\"throttle\",\"remaining\":29991}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-4ba0446192845d06c564ec3a 0; Id-4ba04461ae7f8562c5e8d293 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "60e5cef5-e6bf-4b60-926b-3e08569db41d", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "d0850686-0fd1-4bf5-882a-1c5388002653", + "persistent" : true, + "insertionIndex" : 8 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-send-otp.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-send-otp.json new file mode 100644 index 000000000..13f9f5d14 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-send-otp.json @@ -0,0 +1,50 @@ +{ + "id" : "bbb2b78d-ca23-4ede-95dd-6b3d7bdb09f4", + "name" : "hydrogen_v1_consents_12f6ed9d-fd09-4aea-97bc-aeb61052cf3e_authorisations_a7129418-87e2-43c3-ba57-38aa2e23093b", + "request" : { + "urlPattern" : ".*/v1/consents/.+/authorisations/.+\\?lfdNumber=525&correlationId=AOTACU&authenticationCurrentNumber=525", + "method" : "PUT", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "PSU-ID-Type" : { + "equalTo" : "HVB_ONLINEBANKING" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"scaAuthenticationData\":\"123456\"}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"scaStatus\" : \"finalised\"\n}", + "headers" : { + "Date" : "Fri, 17 Sep 2021 14:03:48 GMT", + "X-Rate-Limit" : "[{\"window\":11,\"type\":\"throttle\",\"remaining\":29993}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-44a044614ba947aebfb539bf 0; Id-44a04461a77f8e76350da629 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "6c7613b8-6811-4371-85ef-8ea0d77ba66f", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "bbb2b78d-ca23-4ede-95dd-6b3d7bdb09f4", + "persistent" : true, + "insertionIndex" : 6 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-start-psu-authentication.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-start-psu-authentication.json new file mode 100644 index 000000000..e723667ae --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-start-psu-authentication.json @@ -0,0 +1,48 @@ +{ + "id" : "42d11cc8-7385-42c6-8f11-043bfc5aba81", + "name" : "hydrogen_v1_consents_12f6ed9d-fd09-4aea-97bc-aeb61052cf3e_authorisations", + "request" : { + "urlPattern" : ".*/v1/consents/.+/authorisations", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\r\n\t\"scaStatus\": \"received\",\r\n\t\"authorisationId\": \"12f6ed9d-fd09-4aea-97bc-aeb61052cf3e\",\r\n\t\"_links\": {\r\n\t\t\"updatePsuAuthentication\": {\r\n\t\t\t\"href\": \"https://api-sandbox.unicredit.de/hydrogen/v1/consents/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e/authorisations/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e?correlationId=AOTACU\"\r\n\t\t},\r\n\t\t\"scaStatus\": {\r\n\t\t\t\"href\": \"https://api-sandbox.unicredit.de/hydrogen/v1/consents/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e/authorisations/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e\"\r\n\t\t}\r\n\t}\r\n}", + "headers" : { + "Date" : "Fri, 17 Sep 2021 14:03:32 GMT", + "X-Rate-Limit" : "[{\"window\":27,\"type\":\"throttle\",\"remaining\":29996}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-34a044617684babca75e5740 0; Id-34a04461c29937839d119eb8 0", + "ASPSP-SCA-Approach" : "EMBEDDED", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "0cb88531-6584-4873-ab24-5968bbef7f69", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "42d11cc8-7385-42c6-8f11-043bfc5aba81", + "persistent" : true, + "insertionIndex" : 4 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-update-psu-authentication.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-update-psu-authentication.json new file mode 100644 index 000000000..d9d9feb8f --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-update-psu-authentication.json @@ -0,0 +1,51 @@ +{ + "id" : "fc253668-5806-4d55-a1a5-3219093da693", + "name" : "hydrogen_v1_consents_12f6ed9d-fd09-4aea-97bc-aeb61052cf3e_authorisations_a7129418-87e2-43c3-ba57-38aa2e23093b", + "request" : { + "urlPattern" : ".*/v1/consents/.+/authorisations/.+\\?correlationId=AOTACU", + "method" : "PUT", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "PSU-ID-Type" : { + "equalTo" : "HVB_ONLINEBANKING" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"psuData\":{\"password\":\"bgpassword\"}}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"scaStatus\" : \"started\",\n \"chosenScaMethod\" : {\n \"authenticationType\" : \"SMS_OTP\",\n \"authenticationMethodId\" : \"03\"\n },\n \"challengeData\" : {\n \"otpMaxLength\" : 6,\n \"otpFormat\" : \"integer\"\n },\n \"_links\" : {\n \"authoriseTransaction\" : {\n \"href\" : \"https://api-sandbox.unicredit.de/hydrogen/v1/consents/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e/authorisations/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e?lfdNumber=525&correlationId=AOTACU&authenticationCurrentNumber=525\"\n }\n }\n}", + "headers" : { + "Date" : "Fri, 17 Sep 2021 14:03:41 GMT", + "X-Rate-Limit" : "[{\"window\":18,\"type\":\"throttle\",\"remaining\":29994}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-3da0446142a9040d49210cb1 0; Id-3da04461cb99c35351eb238c 0", + "ASPSP-SCA-Approach" : "EMBEDDED", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "450afb7e-ae7f-4735-aa87-f0021b0d040b", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "fc253668-5806-4d55-a1a5-3219093da693", + "persistent" : true, + "insertionIndex" : 5 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-get-payment-status.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-get-payment-status.json new file mode 100644 index 000000000..aec87a0c7 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-get-payment-status.json @@ -0,0 +1,36 @@ +{ + "id" : "d51815ee-d5d5-4fd9-870c-0eb73f0b5802", + "name" : "hydrogen_v1_payments_sepa-credit-transfers_pdea630971_status", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/status", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\r\n\t\"transactionStatus\": \"ACSP\"\r\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:13:31 GMT", + "X-Rate-Limit" : "[{\"window\":28,\"type\":\"throttle\",\"remaining\":29996}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-1ba548611af450e91ccf27e2 0; Id-1ba5486124bfe95ddfe8206e 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "2d33b313-c6c9-4b98-ac02-f72b4bf5ee16", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "d51815ee-d5d5-4fd9-870c-0eb73f0b5802", + "persistent" : true, + "insertionIndex" : 17 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-get-sca-status.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-get-sca-status.json new file mode 100644 index 000000000..a630fdcdd --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-get-sca-status.json @@ -0,0 +1,36 @@ +{ + "id" : "ff5cf5e8-b787-4539-9e21-74b02b4b7382", + "name" : "hydrogen_v1_payments_sepa-credit-transfers_pdea630971_authorisations_pdea630971", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/authorisations/.+", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\r\n\t\"scaStatus\": \"finalised\"\r\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:13:34 GMT", + "X-Rate-Limit" : "[{\"window\":25,\"type\":\"throttle\",\"remaining\":29995}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-1ea5486103d65f95a7d76f47 0; Id-1ea5486127bf5247387271ce 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "3a7678c9-e4a3-4598-8bed-580a8c1e0205", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "ff5cf5e8-b787-4539-9e21-74b02b4b7382", + "persistent" : true, + "insertionIndex" : 18 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-initiate-payment.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-initiate-payment.json new file mode 100644 index 000000000..b4e0b5a35 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-initiate-payment.json @@ -0,0 +1,58 @@ +{ + "id" : "598f42ad-e837-46f2-a805-a0d1d5ea773f", + "name" : "hydrogen_v1_payments_sepa-credit-transfers", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "TPP-Redirect-URI" : { + "matches" : ".+" + }, + "PSU-IP-Address" : { + "matches" : ".+" + }, + "PSU-ID-Type" : { + "equalTo" : "HVB_ONLINEBANKING" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"endToEndIdentification\":\"SandboxTPPTest1\",\"debtorAccount\":{\"iban\":\"DE49700202700123456785\",\"currency\":\"EUR\"},\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"${json-unit.regex}-?[0-9]{1,14}(\\\\.[0-9]{1,3})?\"},\"creditorAccount\":{\"iban\":\"DE49700202700123456785\",\"currency\":\"EUR\"},\"creditorName\":\"${json-unit.any-string}\",\"creditorAddress\":{\"country\":\"DE\"},\"remittanceInformationUnstructured\":\"just\"}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\r\n\t\"transactionStatus\": \"RCVD\",\r\n\t\"paymentId\": \"PDEA630971\",\r\n\t\"_links\": {\r\n\t\t\"startAuthorisation\": {\r\n\t\t\t\"href\": \"https://api-sandbox.unicredit.de/hydrogen/v1/payments/sepa-credit-transfers/PDEA630971/authorisations\"\r\n\t\t}\r\n\t}\r\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:12:47 GMT", + "X-Rate-Limit" : "[{\"window\":12,\"type\":\"throttle\",\"remaining\":29998}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-efa448615e13645283f0dd76 0; Id-efa4486139d995064e241c69 0", + "ASPSP-SCA-Approach" : "EMBEDDED", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Location" : "https://api-sandbox.unicredit.de/hydrogen/v1/payments/sepa-credit-transfers/PDEA630971", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "d43d12a8-a740-48c6-8d1f-15f4a21b7290", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "598f42ad-e837-46f2-a805-a0d1d5ea773f", + "persistent" : true, + "insertionIndex" : 11 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-send-otp.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-send-otp.json new file mode 100644 index 000000000..a79ee917d --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-send-otp.json @@ -0,0 +1,53 @@ +{ + "id" : "b0b0e50f-e809-4a42-8d30-c42af37d7e1b", + "name" : "hydrogen_v1_payments_sepa-credit-transfers_pdea630971_authorisations_pdea630971", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/authorisations/.+\\?lfdNumber=966&correlationId=NCVY87&authenticationCurrentNumber=966", + "method" : "PUT", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "TPP-Redirect-URI" : { + "matches" : ".+" + }, + "PSU-ID-Type" : { + "equalTo" : "HVB_ONLINEBANKING" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"scaAuthenticationData\":\"123456\"}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"scaStatus\" : \"finalised\"\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:13:27 GMT", + "X-Rate-Limit" : "[{\"window\":32,\"type\":\"throttle\",\"remaining\":29997}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-17a5486117f48d5ac075c91f 0; Id-18a5486122bf2996ef736974 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "2fee3811-67d5-4e2a-8ceb-8031bab6cea3", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "b0b0e50f-e809-4a42-8d30-c42af37d7e1b", + "persistent" : true, + "insertionIndex" : 16 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-start-psu-authentication.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-start-psu-authentication.json new file mode 100644 index 000000000..7aff8d7b9 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-start-psu-authentication.json @@ -0,0 +1,51 @@ +{ + "id" : "6883c9d5-2a65-4c59-af65-ae7c451a9d52", + "name" : "hydrogen_v1_payments_sepa-credit-transfers_pdea630971_authorisations", + "request" : { + "urlPattern" : ".*v1/payments/sepa-credit-transfers/.+/authorisations", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "TPP-Redirect-URI" : { + "matches" : ".+" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\r\n\t\"scaStatus\": \"received\",\r\n\t\"authorisationId\": \"PDEA630971\",\r\n\t\"_links\": {\r\n\t\t\"updatePsuAuthentication\": {\r\n\t\t\t\"href\": \"https://api-sandbox.unicredit.de/hydrogen/v1/payments/sepa-credit-transfers/PDEA630971/authorisations/PDEA630971?correlationId=NCVY87\"\r\n\t\t},\r\n\t\t\"scaStatus\": {\r\n\t\t\t\"href\": \"https://api-sandbox.unicredit.de/hydrogen/v1/payments/sepa-credit-transfers/PDEA630971/authorisations/PDEA630971\"\r\n\t\t}\r\n\t}\r\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:12:53 GMT", + "X-Rate-Limit" : "[{\"window\":6,\"type\":\"throttle\",\"remaining\":29997}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-f5a4486163136abebe845921 0; Id-f5a448613cd9f60d728f8eb7 0", + "ASPSP-SCA-Approach" : "EMBEDDED", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "31887281-19bb-499b-b919-443c2cbba93d", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "6883c9d5-2a65-4c59-af65-ae7c451a9d52", + "persistent" : true, + "insertionIndex" : 12 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-update-psu-authentication.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-update-psu-authentication.json new file mode 100644 index 000000000..a63f95494 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-payments-sct-update-psu-authentication.json @@ -0,0 +1,51 @@ +{ + "id" : "027dea35-4c4c-4d3a-950d-3e909d21a2db", + "name" : "hydrogen_v1_payments_sepa-credit-transfers_pdea630971_authorisations_pdea630971", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/authorisations/.+\\?correlationId=NCVY87", + "method" : "PUT", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "PSU-ID-Type" : { + "equalTo" : "HVB_ONLINEBANKING" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"psuData\":{\"password\":\"bgpassword\"}}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"scaStatus\" : \"started\",\n \"chosenScaMethod\" : {\n \"authenticationType\" : \"SMS_OTP\",\n \"authenticationMethodId\" : \"03\"\n },\n \"challengeData\" : {\n \"otpMaxLength\" : 6,\n \"otpFormat\" : \"integer\"\n },\n \"_links\" : {\n \"authoriseTransaction\" : {\n \"href\" : \"https://api-sandbox.unicredit.de/hydrogen/v1/payments/sepa-credit-transfers/PDEA630971/authorisations/PDEA630971?lfdNumber=966&correlationId=NCVY87&authenticationCurrentNumber=966\"\n }\n }\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:12:59 GMT", + "X-Rate-Limit" : "[{\"window\":0,\"type\":\"throttle\",\"remaining\":29996}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-fba448611fe433b043217b97 0; Id-fba4486110bffe4ac6bbef34 0", + "ASPSP-SCA-Approach" : "EMBEDDED", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "59b33938-008e-4794-b933-b792564248a5", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "027dea35-4c4c-4d3a-950d-3e909d21a2db", + "persistent" : true, + "insertionIndex" : 13 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-get-payment-status.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-get-payment-status.json new file mode 100644 index 000000000..b3af77ad4 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-get-payment-status.json @@ -0,0 +1,36 @@ +{ + "id" : "724405b7-ba1f-4db7-bb69-a04e436e01b4", + "name" : "hydrogen_v1_periodic-payments_sepa-credit-transfers_pdea744022_status", + "request" : { + "urlPattern" : ".*/v1/periodic-payments/sepa-credit-transfers/.+/status", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\r\n\t\"transactionStatus\": \"ACSP\"\r\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:14:26 GMT", + "X-Rate-Limit" : "[{\"window\":33,\"type\":\"throttle\",\"remaining\":29994}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-52a5486146f4a0ce9e8c1110 0; Id-52a5486170d9a37b32f5ff99 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "2a4cd30e-2eb5-4178-93fe-344666585b36", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "724405b7-ba1f-4db7-bb69-a04e436e01b4", + "persistent" : true, + "insertionIndex" : 24 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-get-sca-status.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-get-sca-status.json new file mode 100644 index 000000000..d0adcd8a9 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-get-sca-status.json @@ -0,0 +1,36 @@ +{ + "id" : "1c0900ea-4121-4716-8fb3-cec97de104cf", + "name" : "hydrogen_v1_periodic-payments_sepa-credit-transfers_pdea744022_authorisations_pdea630971", + "request" : { + "urlPattern" : ".*/v1/periodic-payments/sepa-credit-transfers/.+/authorisations/.+", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + } + } + }, + "response" : { + "status" : 404, + "body" : "{\r\n \"tppMessages\": [\r\n {\r\n \"category\": \"ERROR\",\r\n \"code\": \"RESOURCE_UNKNOWN\",\r\n \"text\": \"The resource you are looking for was not found in our system\"\r\n }\r\n ]\r\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:14:29 GMT", + "X-Rate-Limit" : "[{\"window\":30,\"type\":\"throttle\",\"remaining\":29993}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-55a548612fd6867b42be17b4 0; Id-55a5486145bf05ef0ed31ae9 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "898d568d-cb4d-429a-9478-938054356186", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "1c0900ea-4121-4716-8fb3-cec97de104cf", + "persistent" : true, + "insertionIndex" : 25 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-initiate-payment.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-initiate-payment.json new file mode 100644 index 000000000..02a2436c6 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-initiate-payment.json @@ -0,0 +1,58 @@ +{ + "id" : "517aa92e-7da1-4d24-9047-bb9f21c4c397", + "name" : "hydrogen_v1_periodic-payments_sepa-credit-transfers", + "request" : { + "urlPattern" : ".*/v1/periodic-payments/sepa-credit-transfers", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "TPP-Redirect-URI" : { + "matches" : ".+" + }, + "PSU-IP-Address" : { + "matches" : ".+" + }, + "PSU-ID-Type" : { + "equalTo" : "HVB_ONLINEBANKING" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"endToEndIdentification\":\"SandboxTPPTest1\",\"debtorAccount\":{\"iban\":\"DE49700202700123456785\",\"currency\":\"EUR\"},\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"${json-unit.regex}-?[0-9]{1,14}(\\\\.[0-9]{1,3})?\"},\"creditorAccount\":{\"iban\":\"DE49700202700123456785\",\"currency\":\"EUR\"},\"creditorName\":\"${json-unit.any-string}\",\"creditorAddress\":{\"country\":\"DE\"},\"remittanceInformationUnstructured\":\"just\",\"startDate\":\"${json-unit.regex}\\\\d{4}-[01]\\\\d-[0-3]\\\\d\",\"endDate\":\"${json-unit.regex}\\\\d{4}-[01]\\\\d-[0-3]\\\\d\",\"executionRule\":\"following\",\"frequency\":\"Monthly\",\"dayOfExecution\":\"${json-unit.regex}\\\\d{1,2}\"}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\r\n\t\"transactionStatus\": \"PDNG\",\r\n\t\"paymentId\": \"PDEA744022\",\r\n\t\"_links\": {\r\n\t\t\"startAuthorisation\": {\r\n\t\t\t\"href\": \"https://api-sandbox.unicredit.de/hydrogen/v1/periodic-payments/sepa-credit-transfers/PDEA744022/authorisations\"\r\n\t\t}\r\n\t}\r\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:14:01 GMT", + "X-Rate-Limit" : "[{\"window\":58,\"type\":\"throttle\",\"remaining\":29999}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-39a5486117d69283dadf09b0 0; Id-39a5486160d93c6a91b23a3e 0", + "ASPSP-SCA-Approach" : "EMBEDDED", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Location" : "https://api-sandbox.unicredit.de/hydrogen/v1/periodic-payments/sepa-credit-transfers/PDEA744022", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "cab145d4-19f1-4d84-a343-e7ac3a610bc1", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "517aa92e-7da1-4d24-9047-bb9f21c4c397", + "persistent" : true, + "insertionIndex" : 20 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-send-otp.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-send-otp.json new file mode 100644 index 000000000..bd8c8aa5e --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-send-otp.json @@ -0,0 +1,50 @@ +{ + "id" : "f3ef633a-f82b-4e3b-9b0f-a9c1b1196266", + "name" : "hydrogen_v1_periodic-payments_sepa-credit-transfers_pdea744022_authorisations_pdea630971", + "request" : { + "urlPattern" : ".*/v1/periodic-payments/sepa-credit-transfers/.+/authorisations/.+\\?lfdNumber=987&correlationId=JZ9TZO&authenticationCurrentNumber=987", + "method" : "PUT", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "PSU-ID-Type" : { + "equalTo" : "HVB_ONLINEBANKING" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"scaAuthenticationData\":\"123456\"}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"scaStatus\" : \"finalised\"\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:14:22 GMT", + "X-Rate-Limit" : "[{\"window\":37,\"type\":\"throttle\",\"remaining\":29995}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-4ea5486129d6ef2d454bae04 0; Id-4ea548616ed9822cf6114967 0", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "28103814-f19f-4158-bf14-c64aa0c568c7", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "f3ef633a-f82b-4e3b-9b0f-a9c1b1196266", + "persistent" : true, + "insertionIndex" : 23 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-start-psu-authentication.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-start-psu-authentication.json new file mode 100644 index 000000000..f64486558 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-start-psu-authentication.json @@ -0,0 +1,51 @@ +{ + "id" : "0a5e3254-2594-49c2-b33a-fb0317930ed0", + "name" : "hydrogen_v1_periodic-payments_sepa-credit-transfers_pdea744022_authorisations", + "request" : { + "urlPattern" : ".*/v1/periodic-payments/sepa-credit-transfers/.+/authorisations", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "TPP-Redirect-URI" : { + "matches" : ".+" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\r\n\t\"scaStatus\": \"received\",\r\n\t\"authorisationId\": \"PDEA744022\",\r\n\t\"_links\": {\r\n\t\t\"updatePsuAuthentication\": {\r\n\t\t\t\"href\": \"https://api-sandbox.unicredit.de/hydrogen/v1/periodic-payments/sepa-credit-transfers/PDEA744022/authorisations/PDEA744022?correlationId=JZ9TZO\"\r\n\t\t},\r\n\t\t\"scaStatus\": {\r\n\t\t\t\"href\": \"https://api-sandbox.unicredit.de/hydrogen/v1/periodic-payments/sepa-credit-transfers/PDEA744022/authorisations/PDEA744022\"\r\n\t\t}\r\n\t}\r\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:14:06 GMT", + "X-Rate-Limit" : "[{\"window\":53,\"type\":\"throttle\",\"remaining\":29997}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-3ea5486135f4114e5a87c49c 0; Id-3ea5486165d929c1b8e607e0 0", + "ASPSP-SCA-Approach" : "EMBEDDED", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "4aa4e9ae-5690-43ad-b1d1-6d4670187391", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "0a5e3254-2594-49c2-b33a-fb0317930ed0", + "persistent" : true, + "insertionIndex" : 21 +} diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-update-psu-authentication.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-update-psu-authentication.json new file mode 100644 index 000000000..0b98a5f02 --- /dev/null +++ b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/pis-periodic-sct-update-psu-authentication.json @@ -0,0 +1,51 @@ +{ + "id" : "567800d1-6772-4481-93c8-99a720414233", + "name" : "hydrogen_v1_periodic-payments_sepa-credit-transfers_pdea744022_authorisations_pdea630971", + "request" : { + "urlPattern" : ".*/v1/periodic-payments/sepa-credit-transfers/.+/authorisations/.+\\?correlationId=JZ9TZO", + "method" : "PUT", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "PSU-ID" : { + "equalTo" : "bgdemo" + }, + "PSU-ID-Type" : { + "equalTo" : "HVB_ONLINEBANKING" + }, + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"psuData\":{\"password\":\"bgpassword\"}}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"scaStatus\" : \"started\",\n \"chosenScaMethod\" : {\n \"authenticationType\" : \"SMS_OTP\",\n \"authenticationMethodId\" : \"03\"\n },\n \"challengeData\" : {\n \"otpMaxLength\" : 6,\n \"otpFormat\" : \"integer\"\n },\n \"authenticationCurrentNumber\" : \"987\",\n \"_links\" : {\n \"authoriseTransaction\" : {\n \"href\" : \"https://api-sandbox.unicredit.de/hydrogen/v1/periodic-payments/sepa-credit-transfers/PDEA744022/authorisations/PDEA744022?lfdNumber=987&correlationId=JZ9TZO&authenticationCurrentNumber=987\"\n }\n }\n}", + "headers" : { + "Date" : "Mon, 20 Sep 2021 15:14:16 GMT", + "X-Rate-Limit" : "[{\"window\":43,\"type\":\"throttle\",\"remaining\":29996}]", + "Max-Forwards" : "20", + "X-CorrelationID" : "Id-48a548613ef449c9b1001a70 0; Id-48a548613dbf3acbe1fa068c 0", + "ASPSP-SCA-Approach" : "EMBEDDED", + "Cache-Control" : "no-store", + "Content-Security-Policy" : "block-all-mixed-content", + "Pragma" : "no-cache", + "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains", + "X-Content-Type-Options" : "nosniff", + "X-Frame-Options" : "sameorigin", + "X-Request-ID" : "e1504365-419a-4a79-941a-f4b865d681e1", + "X-XSS-Protection" : "1", + "Content-Type" : "application/json", + "Expires" : "Thu, 01 Dec 1994 16:00:00 GMT" + } + }, + "uuid" : "567800d1-6772-4481-93c8-99a720414233", + "persistent" : true, + "insertionIndex" : 22 +} diff --git a/adapters/unicredit-adapter/src/test/java/de/adorsys/xs2a/adapter/unicredit/UnicreditAccountInformationServiceWireMockTest.java b/adapters/unicredit-adapter/src/test/java/de/adorsys/xs2a/adapter/unicredit/UnicreditAccountInformationServiceWireMockTest.java new file mode 100644 index 000000000..506ad79f9 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/java/de/adorsys/xs2a/adapter/unicredit/UnicreditAccountInformationServiceWireMockTest.java @@ -0,0 +1,152 @@ +package de.adorsys.xs2a.adapter.unicredit; + +import de.adorsys.xs2a.adapter.api.AccountInformationService; +import de.adorsys.xs2a.adapter.api.RequestParams; +import de.adorsys.xs2a.adapter.api.exception.ErrorResponseException; +import de.adorsys.xs2a.adapter.api.model.*; +import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; +import de.adorsys.xs2a.adapter.test.TestRequestResponse; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.InstanceOfAssertFactories.optional; +import static org.assertj.core.api.InstanceOfAssertFactories.type; + +@ServiceWireMockTest(UnicreditServiceProvider.class) +class UnicreditAccountInformationServiceWireMockTest { + + private static final String CONSENT_ID = "12f6ed9d-fd09-4aea-97bc-aeb61052cf3e"; + private static final String ACCOUNT_ID = "3dc3d5b37023"; + private static final String AUTHORISATION_ID = "3dc3d5b37023"; + + private final AccountInformationService accountInformationService; + + UnicreditAccountInformationServiceWireMockTest(AccountInformationService accountInformationService) { + this.accountInformationService = accountInformationService; + } + + @Test + void createConsent() throws Exception { + var requestResponse = new TestRequestResponse("ais/create-consent.json"); + + var response = accountInformationService.createConsent(requestResponse.requestHeaders(), + RequestParams.empty(), + requestResponse.requestBody(Consents.class)); + + assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(ConsentsResponse201.class)); + } + + @Test + void deleteConsent() throws Exception { + var requestResponse = new TestRequestResponse("ais/delete-consent.json"); + + var response = accountInformationService.deleteConsent(CONSENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getStatusCode()).isEqualTo(204); + } + + @Test + void getAccounts() throws Exception { + var requestResponse = new TestRequestResponse("ais/get-accounts.json"); + + var response = accountInformationService.getAccountList(requestResponse.requestHeaders(), + requestResponse.requestParams()); + + assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(AccountList.class)); + } + + @Test + void getBalances() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-balances.json"); + + var response = accountInformationService.getBalances(ACCOUNT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ReadAccountBalanceResponse200.class)); + } + + @Test + void getConsentStatus() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-consent-status.json"); + + var response = accountInformationService.getConsentStatus(CONSENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ConsentStatusResponse200.class)); + } + + @Test + void getScaStatus() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-sca-status.json"); + var requestHeaders = requestResponse.requestHeaders(); + var params = RequestParams.empty(); + + assertThatThrownBy(() -> accountInformationService.getConsentScaStatus(CONSENT_ID, + AUTHORISATION_ID, + requestHeaders, + params)) + .asInstanceOf(type(ErrorResponseException.class)) + .matches(er -> 404 == er.getStatusCode()) + .extracting(ErrorResponseException::getErrorResponse, optional(ErrorResponse.class)) + .contains(requestResponse.responseBody(ErrorResponse.class)); + } + + @Test + void getTransactions() throws Exception { + var requestResponse = new TestRequestResponse("ais/get-transactions.json"); + + var response = accountInformationService.getTransactionList(ACCOUNT_ID, + requestResponse.requestHeaders(), + requestResponse.requestParams()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(TransactionsResponse200Json.class)); + } + + @Test + void authoriseTransaction() throws Exception { + var requestResponse = new TestRequestResponse("ais/authorise-transaction.json"); + + var response = accountInformationService.updateConsentsPsuData(CONSENT_ID, + AUTHORISATION_ID, + requestResponse.requestHeaders(), + requestResponse.requestParams(), + requestResponse.requestBody(TransactionAuthorisation.class)); + + assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(ScaStatusResponse.class)); + } + + @Test + void authenticatePsu() throws Exception { + var requestResponse = new TestRequestResponse("ais/authenticate-psu.json"); + + var response = accountInformationService.startConsentAuthorisation(CONSENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()).isEqualTo(requestResponse.responseBody(StartScaprocessResponse.class)); + } + + @Test + void updatePsuAuthentication() throws IOException { + var requestResponse = new TestRequestResponse("ais/update-psu-authentication.json"); + + var response = accountInformationService.updateConsentsPsuData(CONSENT_ID, + AUTHORISATION_ID, + requestResponse.requestHeaders(), + requestResponse.requestParams(), + requestResponse.requestBody(UpdatePsuAuthentication.class)); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(UpdatePsuAuthenticationResponse.class)); + } +} diff --git a/adapters/unicredit-adapter/src/test/java/de/adorsys/xs2a/adapter/unicredit/UnicreditPaymentInitiationServiceWireMockTest.java b/adapters/unicredit-adapter/src/test/java/de/adorsys/xs2a/adapter/unicredit/UnicreditPaymentInitiationServiceWireMockTest.java new file mode 100644 index 000000000..d87d51173 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/java/de/adorsys/xs2a/adapter/unicredit/UnicreditPaymentInitiationServiceWireMockTest.java @@ -0,0 +1,177 @@ +package de.adorsys.xs2a.adapter.unicredit; + +import de.adorsys.xs2a.adapter.api.PaymentInitiationService; +import de.adorsys.xs2a.adapter.api.RequestParams; +import de.adorsys.xs2a.adapter.api.exception.ErrorResponseException; +import de.adorsys.xs2a.adapter.api.model.*; +import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; +import de.adorsys.xs2a.adapter.test.TestRequestResponse; +import org.apache.commons.lang3.tuple.Pair; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Stream; + +import static de.adorsys.xs2a.adapter.api.model.PaymentProduct.SEPA_CREDIT_TRANSFERS; +import static de.adorsys.xs2a.adapter.api.model.PaymentService.PAYMENTS; +import static de.adorsys.xs2a.adapter.api.model.PaymentService.PERIODIC_PAYMENTS; +import static java.lang.String.format; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.InstanceOfAssertFactories.optional; +import static org.assertj.core.api.InstanceOfAssertFactories.type; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +@ServiceWireMockTest(UnicreditServiceProvider.class) +class UnicreditPaymentInitiationServiceWireMockTest { + + private static final String PAYMENTS_PAYMENT_ID = "PDEA630971"; + private static final String PAYMENTS_AUTHORISATION_ID = "PDEA630971"; + private static final String PERIODIC_PAYMENT_ID = "PDEA744022"; + private static final String PERIODIC_AUTHORISATION_ID = "PDEA744022"; + private final Map> ids; + + private final PaymentInitiationService paymentInitiationService; + + UnicreditPaymentInitiationServiceWireMockTest(PaymentInitiationService paymentInitiationService) { + this.paymentInitiationService = paymentInitiationService; + this.ids = initiateMap(); + } + + private Map> initiateMap() { + Map> map = new HashMap<>(); + map.put(PaymentService.PAYMENTS, Pair.of(PAYMENTS_PAYMENT_ID, PAYMENTS_AUTHORISATION_ID)); + map.put(PaymentService.PERIODIC_PAYMENTS, Pair.of(PERIODIC_PAYMENT_ID, PERIODIC_AUTHORISATION_ID)); + return map; + } + + @ParameterizedTest + @MethodSource("paymentTypes") + void initiatePayment(PaymentService paymentService, PaymentProduct paymentProduct) throws IOException { + var requestResponse = new TestRequestResponse(format("pis/%s/%s/initiate-payment.json", paymentService, paymentProduct)); + + var response = paymentInitiationService.initiatePayment(paymentService, + paymentProduct, + requestResponse.requestHeaders(), + RequestParams.empty(), + requestResponse.requestBody(getPaymentClass(paymentService))); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(PaymentInitationRequestResponse201.class)); + } + + private Class getPaymentClass(PaymentService paymentService) { + if (PAYMENTS == paymentService) { + return PaymentInitiationJson.class; + } + return PeriodicPaymentInitiationJson.class; + } + + @ParameterizedTest + @MethodSource("paymentTypes") + void getPaymentStatus(PaymentService paymentService, PaymentProduct paymentProduct) throws IOException { + var requestResponse = new TestRequestResponse(format("pis/%s/%s/get-payment-status.json", paymentService, paymentProduct)); + + var response = paymentInitiationService.getPaymentInitiationStatus(paymentService, + paymentProduct, + ids.get(paymentService).getLeft(), + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(PaymentInitiationStatusResponse200Json.class)); + } + + @ParameterizedTest + @MethodSource("paymentTypes") + void getScaStatus(PaymentService paymentService, PaymentProduct paymentProduct) throws IOException { + var requestResponse = new TestRequestResponse(format("pis/%s/%s/get-sca-status.json", paymentService, paymentProduct)); + + if (PAYMENTS == paymentService) { + var response = paymentInitiationService.getPaymentInitiationScaStatus(paymentService, + paymentProduct, + ids.get(paymentService).getLeft(), + ids.get(paymentService).getRight(), + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ScaStatusResponse.class)); + } else { // get SCA Status is not implemented for periodic-payments + var requestHeaders = requestResponse.requestHeaders(); + var params = RequestParams.empty(); + + assertThatThrownBy(() -> paymentInitiationService.getPaymentInitiationScaStatus(paymentService, + paymentProduct, + ids.get(paymentService).getLeft(), + ids.get(paymentService).getRight(), + requestHeaders, + params)) + .asInstanceOf(type(ErrorResponseException.class)) + .matches(er -> 404 == er.getStatusCode()) + .extracting(ErrorResponseException::getErrorResponse, optional(ErrorResponse.class)) + .contains(requestResponse.responseBody(ErrorResponse.class)); + } + } + + @ParameterizedTest + @MethodSource("paymentTypes") + void authorizeTransaction(PaymentService paymentService, PaymentProduct paymentProduct) throws IOException { + var requestResponse = new TestRequestResponse(format("pis/%s/%s/authorise-transaction.json", paymentService, paymentProduct)); + + var response = paymentInitiationService.updatePaymentPsuData(paymentService, + paymentProduct, + ids.get(paymentService).getLeft(), + ids.get(paymentService).getRight(), + requestResponse.requestHeaders(), + requestResponse.requestParams(), + requestResponse.requestBody(TransactionAuthorisation.class)); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ScaStatusResponse.class)); + } + + @ParameterizedTest + @MethodSource("paymentTypes") + void authenticatePsu(PaymentService paymentService, PaymentProduct paymentProduct) throws IOException { + var requestResponse = new TestRequestResponse(format("pis/%s/%s/authenticate-psu.json", paymentService, paymentProduct)); + + var response = paymentInitiationService.startPaymentAuthorisation(paymentService, + paymentProduct, + ids.get(paymentService).getLeft(), + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(StartScaprocessResponse.class)); + } + + @Disabled("Sandbox and Production environments have different UpdatePsuAuthentication models, thus can't run this test for" + + "avoiding MismatchedInputException") + @ParameterizedTest + @MethodSource("paymentTypes") + void updatePsuAuthentication(PaymentService paymentService, PaymentProduct paymentProduct) throws IOException { + var requestResponse = new TestRequestResponse(format("pis/%s/%s/update-psu-authentication.json", paymentService, paymentProduct)); + + var response = paymentInitiationService.updatePaymentPsuData(paymentService, + paymentProduct, + ids.get(paymentService).getLeft(), + ids.get(paymentService).getRight(), + requestResponse.requestHeaders(), + requestResponse.requestParams(), + requestResponse.requestBody(UpdatePsuAuthentication.class)); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(UpdatePsuAuthenticationResponse.class)); + } + + private static Stream paymentTypes() { + return Stream.of(arguments(PAYMENTS, SEPA_CREDIT_TRANSFERS), + arguments(PERIODIC_PAYMENTS, SEPA_CREDIT_TRANSFERS)); + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/ais/authenticate-psu.json b/adapters/unicredit-adapter/src/test/resources/ais/authenticate-psu.json new file mode 100644 index 000000000..9b5551bd7 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/ais/authenticate-psu.json @@ -0,0 +1,24 @@ +{ + "request": { + "headers": { + "X-Request-ID": "665a5b2c-c020-4fd5-8082-b34995c5b601", + "PSU-ID": "bgdemo", + "Content-Type": "application/json; charset=UTF-8", + "TPP-Redirect-URI": "https://example.com" + } + }, + "response": { + "body": { + "scaStatus": "received", + "authorisationId": "12f6ed9d-fd09-4aea-97bc-aeb61052cf3e", + "_links": { + "updatePsuAuthentication": { + "href": "https://api-sandbox.unicredit.de/hydrogen/v1/consents/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e/authorisations/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e?correlationId=AOTACU" + }, + "scaStatus": { + "href": "https://api-sandbox.unicredit.de/hydrogen/v1/consents/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e/authorisations/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e" + } + } + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/ais/authorise-transaction.json b/adapters/unicredit-adapter/src/test/resources/ais/authorise-transaction.json new file mode 100644 index 000000000..fbba57c86 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/ais/authorise-transaction.json @@ -0,0 +1,23 @@ +{ + "request": { + "headers": { + "X-Request-ID": "c6101e8e-c7b7-498c-809d-590fcc48fd83", + "PSU-ID": "bgdemo", + "PSU-ID-Type": "HVB_ONLINEBANKING", + "Content-Type": "application/json; charset=UTF-8" + }, + "params": { + "lfdNumber": "525", + "correlationId": "AOTACU", + "authenticationCurrentNumber": 525 + }, + "body": { + "scaAuthenticationData": "123456" + } + }, + "response": { + "body": { + "scaStatus": "finalised" + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/ais/create-consent.json b/adapters/unicredit-adapter/src/test/resources/ais/create-consent.json new file mode 100644 index 000000000..b3f9786f1 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/ais/create-consent.json @@ -0,0 +1,49 @@ +{ + "request": { + "headers": { + "X-Request-ID": "4ba82f21-6083-430a-8bdf-4f7c9e8c4d43", + "PSU-ID": "bgdemo", + "PSU-ID-Type": "HVB_ONLINEBANKING", + "PSU-IP-Address": "0.0.0.0", + "Content-Type": "application/json; charset=UTF-8", + "TPP-Redirect-URI": "https://example.com" + }, + "body": { + "access": { + "accounts": [ + { + "iban": "DE49700202700123456785", + "currency": "EUR" + } + ], + "balances": [ + { + "iban": "DE49700202700123456785", + "currency": "EUR" + } + ], + "transactions": [ + { + "iban": "DE49700202700123456785", + "currency": "EUR" + } + ] + }, + "recurringIndicator": true, + "validUntil": "2021-09-22", + "frequencyPerDay": 4, + "combinedServiceIndicator": false + } + }, + "response": { + "body": { + "consentStatus": "received", + "consentId": "12f6ed9d-fd09-4aea-97bc-aeb61052cf3e", + "_links": { + "startAuthorisation": { + "href": "https://api-sandbox.unicredit.de/hydrogen/v1/consents/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e/authorisations" + } + } + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/ais/delete-consent.json b/adapters/unicredit-adapter/src/test/resources/ais/delete-consent.json new file mode 100644 index 000000000..ea477591f --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/ais/delete-consent.json @@ -0,0 +1,7 @@ +{ + "request": { + "headers": { + "X-Request-ID": "45aa0040-5b02-4cab-8855-3868fb8e7105" + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/ais/get-accounts.json b/adapters/unicredit-adapter/src/test/resources/ais/get-accounts.json new file mode 100644 index 000000000..4cbc23962 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/ais/get-accounts.json @@ -0,0 +1,57 @@ +{ + "request": { + "headers": { + "X-Request-ID": "cc29a35e-2f59-4b2f-bc72-442e8f34a4dd", + "Consent-ID": "12f6ed9d-fd09-4aea-97bc-aeb61052cf3e", + "PSU-ID": "bgdemo" + }, + "params": { + "withBalance": "false" + } + }, + "response": { + "body": { + "accounts": [ + { + "resourceId": "3dc3d5b37023", + "iban": "DE49700202700123456785", + "currency": "EUR", + "name": "Account-1", + "product": "lorem ipsum", + "bic": "HYVEDEMMXXX", + "usage": "PRIV", + "details": "lorem ipsum", + "balances": [ + { + "balanceAmount": { + "currency": "EUR", + "amount": "123456.78" + }, + "balanceType": "expected", + "lastChangeDateTime": "2019-10-14T09:00:00Z", + "referenceDate": "2019-10-14" + }, + { + "balanceAmount": { + "currency": "EUR", + "amount": "234567.89" + }, + "balanceType": "authorised", + "lastChangeDateTime": "2019-10-13T20:00:00Z", + "referenceDate": "2019-10-13" + }, + { + "balanceAmount": { + "currency": "EUR", + "amount": "29944" + }, + "balanceType": "closingBooked", + "lastChangeDateTime": "2019-10-13T20:00:00Z", + "referenceDate": "2019-10-13" + } + ] + } + ] + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/ais/get-balances.json b/adapters/unicredit-adapter/src/test/resources/ais/get-balances.json new file mode 100644 index 000000000..2b7f51441 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/ais/get-balances.json @@ -0,0 +1,41 @@ +{ + "request": { + "headers": { + "X-Request-ID": "991cc90c-5795-4dad-b802-b7315f192227", + "Consent-ID": "12f6ed9d-fd09-4aea-97bc-aeb61052cf3e" + } + }, + "response": { + "body": { + "account": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "balances": [{ + "balanceAmount": { + "currency": "EUR", + "amount": "123456.78" + }, + "balanceType": "expected", + "lastChangeDateTime": "2019-10-14T09:00:00Z", + "referenceDate": "2019-10-14" + },{ + "balanceAmount": { + "currency": "EUR", + "amount": "234567.89" + }, + "balanceType": "authorised", + "lastChangeDateTime": "2019-10-13T20:00:00Z", + "referenceDate": "2019-10-13" + },{ + "balanceAmount": { + "currency": "EUR", + "amount": "29944" + }, + "balanceType": "closingBooked", + "lastChangeDateTime": "2019-10-13T20:00:00Z", + "referenceDate": "2019-10-13" + }] + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/ais/get-consent-status.json b/adapters/unicredit-adapter/src/test/resources/ais/get-consent-status.json new file mode 100644 index 000000000..1b63319b0 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/ais/get-consent-status.json @@ -0,0 +1,12 @@ +{ + "request": { + "headers": { + "X-Request-ID": "d27dedbd-9cfa-4c00-8bc6-f6a8f2223870" + } + }, + "response": { + "body": { + "consentStatus": "valid" + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/ais/get-sca-status.json b/adapters/unicredit-adapter/src/test/resources/ais/get-sca-status.json new file mode 100644 index 000000000..2119ec7df --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/ais/get-sca-status.json @@ -0,0 +1,18 @@ +{ + "request": { + "headers": { + "X-Request-ID": "a0448f06-780e-4875-8227-6dc3c1433fb7" + } + }, + "response": { + "body": { + "tppMessages": [ + { + "category": "ERROR", + "code": "RESOURCE_UNKNOWN", + "text": "The resource you are looking for was not found in our system" + } + ] + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/ais/get-transactions.json b/adapters/unicredit-adapter/src/test/resources/ais/get-transactions.json new file mode 100644 index 000000000..b496b0f37 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/ais/get-transactions.json @@ -0,0 +1,192 @@ +{ + "request": { + "headers": { + "X-Request-ID": "c558ad1b-9e19-4fae-ac89-90a0f811f1ff", + "Consent-ID": "12f6ed9d-fd09-4aea-97bc-aeb61052cf3e" + }, + "params": { + "dateFrom": "2020-07-06", + "dateTo": "2020-08-06", + "bookingStatus": "booked", + "withBalance": "true" + } + }, + "response": { + "body": { + "account": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "transactions": { + "booked": [ + { + "transactionId": "1234567890123456", + "endToEndId": "AAA10000234567890123456", + "bookingDate": "2019-09-28", + "valueDate": "2019-09-29", + "transactionAmount": { + "currency": "EUR", + "amount": "180.12" + }, + "creditorName": "Lorem ipsum", + "creditorAccount": { + "iban": "DE31701500000012345674", + "currency": "EUR" + }, + "debtorName": "Our Customer", + "debtorAccount": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "remittanceInformationUnstructured": "Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN", + "proprietaryBankTransactionCode": "ÜBERWEISUNG (DIRECT BANKING", + "additionalInformation": "ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001" + }, + { + "transactionId": "3456789012345612", + "endToEndId": "BBB30000456789012345612", + "bookingDate": "2019-09-02", + "valueDate": "2019-09-02", + "transactionAmount": { + "currency": "EUR", + "amount": "18119.12" + }, + "creditorName": "Our Customer", + "creditorAccount": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "debtorName": "duo dolores", + "debtorAccount": { + "iban": "DE72200505500000987651", + "currency": "EUR" + }, + "remittanceInformationUnstructured": "Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN", + "proprietaryBankTransactionCode": "ÜBERWEISUNG (DIRECT BANKING", + "additionalInformation": "ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001" + }, + { + "transactionId": "5678901234561234", + "endToEndId": "CCC50000678901234561234", + "bookingDate": "2019-09-08", + "valueDate": "2019-09-08", + "transactionAmount": { + "currency": "EUR", + "amount": "119.12" + }, + "creditorName": "Our Customer", + "creditorAccount": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "debtorName": "duo dolores", + "debtorAccount": { + "iban": "DE72200505500000987651", + "currency": "EUR" + }, + "remittanceInformationUnstructured": "Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN", + "proprietaryBankTransactionCode": "ÜBERWEISUNG (DIRECT BANKING", + "additionalInformation": "ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001" + }, + { + "transactionId": "7890123456123456", + "endToEndId": "DDD70000890123456123456", + "creditorId": "DE94ZZZ00000012345", + "bookingDate": "2019-09-13", + "valueDate": "2019-09-13", + "transactionAmount": { + "currency": "EUR", + "amount": "472.96" + }, + "creditorName": "voluptates repudiandae", + "creditorAccount": { + "iban": "DE12500105170648489890", + "currency": "EUR" + }, + "debtorName": "Our Customer", + "debtorAccount": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "remittanceInformationUnstructured": " Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN", + "proprietaryBankTransactionCode": "ÜBERWEISUNG (DIRECT BANKING", + "additionalInformation": "ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001" + }, + { + "transactionId": "9012345612345678", + "endToEndId": "EEE90000012345612345678", + "mandateId": "87654321", + "creditorId": "DE94ZZZ000000234567", + "bookingDate": "2019-09-25", + "valueDate": "2019-09-25", + "transactionAmount": { + "currency": "EUR", + "amount": "21.80" + }, + "creditorName": "Itaque earum", + "creditorAccount": { + "iban": "DE12500400000123456780", + "currency": "EUR" + }, + "debtorName": "Our Customer", + "debtorAccount": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "remittanceInformationUnstructured": "Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN", + "proprietaryBankTransactionCode": "ÜBERWEISUNG (DIRECT BANKING", + "additionalInformation": "Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN" + }, + { + "transactionId": "9112345612345678", + "endToEndId": "FFF90000112345612345678", + "mandateId": "86101000320", + "bookingDate": "2019-10-05", + "valueDate": "2019-10-05", + "transactionAmount": { + "currency": "EUR", + "amount": "2000.00" + }, + "creditorName": "Card Transaction Card: 1234-1711-1234-1234", + "creditorAccount": { + "iban": "BE68844010370034", + "currency": "EUR" + }, + "debtorName": "Our Customer", + "debtorAccount": { + "iban": "NL18ABNA0484869868", + "currency": "EUR" + }, + "remittanceInformationUnstructured": " Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN", + "proprietaryBankTransactionCode": "ÜBERWEISUNG (DIRECT BANKING", + "additionalInformation": "ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001" + }, + { + "transactionId": "5678901234567890", + "endToEndId": "CCC50000678901234567890", + "bookingDate": "2019-10-08", + "valueDate": "2019-10-08", + "transactionAmount": { + "currency": "EUR", + "amount": "9269.12" + }, + "creditorName": "Our Customer", + "creditorAccount": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "debtorName": "At vero", + "debtorAccount": { + "iban": "DE12500400000123456780", + "currency": "EUR" + }, + "remittanceInformationUnstructured": " Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFEREN", + "proprietaryBankTransactionCode": "ÜBERWEISUNG (DIRECT BANKING", + "additionalInformation": "ÜBERWEISUNG (DIRECT BANKING Testpartner BIC HYVEDEMM300/IBAN DE1234 1234567898765432 KUNDENREF 8768371263817631 82 Test TF5 DRITTANB 11.06.2020/12:20 TAN 039844 REFERENZNR VPE2006161504000 000000001" + } + ] + } + } + + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/ais/update-psu-authentication.json b/adapters/unicredit-adapter/src/test/resources/ais/update-psu-authentication.json new file mode 100644 index 000000000..88cceda37 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/ais/update-psu-authentication.json @@ -0,0 +1,37 @@ +{ + "request": { + "headers": { + "X-Request-ID": "665a5b2c-c020-4fd5-8082-b34995c5b603", + "PSU-ID": "bgdemo", + "PSU-ID-Type": "HVB_ONLINEBANKING", + "Content-Type": "application/json", + "TPP-Redirect-URI": "https://example.com" + }, + "params": { + "correlationId": "AOTACU" + }, + "body": { + "psuData": { + "password": "bgpassword" + } + } + }, + "response": { + "body": { + "scaStatus" : "started", + "chosenScaMethod" : { + "authenticationType" : "SMS_OTP", + "authenticationMethodId" : "03" + }, + "challengeData" : { + "otpMaxLength" : 6, + "otpFormat" : "integer" + }, + "_links" : { + "authoriseTransaction" : { + "href" : "https://api-sandbox.unicredit.de/hydrogen/v1/consents/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e/authorisations/12f6ed9d-fd09-4aea-97bc-aeb61052cf3e?lfdNumber=525&correlationId=AOTACU&authenticationCurrentNumber=525" + } + } + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/authenticate-psu.json b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/authenticate-psu.json new file mode 100644 index 000000000..2d372f78b --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/authenticate-psu.json @@ -0,0 +1,24 @@ +{ + "request": { + "headers": { + "X-Request-ID": "662388a0-92f3-4d1d-bb95-b4c28fb19fbe", + "PSU-ID": "bgdemo", + "TPP-Redirect-URI": "http://localhost:8080/redirect", + "Content-Type": "application/json" + } + }, + "response": { + "body": { + "scaStatus": "received", + "authorisationId": "PDEA630971", + "_links": { + "updatePsuAuthentication": { + "href": "https://api-sandbox.unicredit.de/hydrogen/v1/payments/sepa-credit-transfers/PDEA630971/authorisations/PDEA630971?correlationId=NCVY87" + }, + "scaStatus": { + "href": "https://api-sandbox.unicredit.de/hydrogen/v1/payments/sepa-credit-transfers/PDEA630971/authorisations/PDEA630971" + } + } + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/authorise-transaction.json b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/authorise-transaction.json new file mode 100644 index 000000000..6fc082449 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/authorise-transaction.json @@ -0,0 +1,25 @@ +{ + "request": { + "headers": { + "X-Request-ID": "04f6c752-1f2a-4102-b926-52c2f5906afb", + "PSU-ID": "bgdemo", + "TPP-Redirect-URI": "http://localhost:8080/redirect", + "PSU-IP-Address": "0.0.0.0", + "PSU-ID-Type": "HVB_ONLINEBANKING", + "Content-Type": "application/json" + }, + "params": { + "lfdNumber": "966", + "correlationId": "NCVY87", + "authenticationCurrentNumber": "966" + }, + "body": { + "scaAuthenticationData": "123456" + } + }, + "response": { + "body": { + "scaStatus": "finalised" + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json new file mode 100644 index 000000000..eb47afb0b --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json @@ -0,0 +1,12 @@ +{ + "request": { + "headers": { + "X-Request-ID": "06b43276-40f6-4ba4-aa8a-50c8e7f2781d" + } + }, + "response": { + "body": { + "transactionStatus": "ACSP" + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json new file mode 100644 index 000000000..b408183af --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json @@ -0,0 +1,12 @@ +{ + "request": { + "headers": { + "X-Request-ID": "610cc155-67bf-48b0-91cb-2830321f1857" + } + }, + "response": { + "body": { + "scaStatus": "finalised" + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json new file mode 100644 index 000000000..eec7a2c30 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json @@ -0,0 +1,41 @@ +{ + "request": { + "headers": { + "X-Request-ID": "e56a3492-e9c7-4357-9b77-0a3bdafdd608", + "PSU-ID": "bgdemo", + "TPP-Redirect-URI": "http://localhost:8080/redirect", + "PSU-IP-Address": "0.0.0.0", + "PSU-ID-Type": "HVB_ONLINEBANKING", + "TPP-Redirect-Preferred": "false", + "Content-Type": "application/json" + }, + "body": { + "creditorAccount": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "creditorName": "merchant123", + "debtorAccount": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "instructedAmount": { + "amount": "20.99", + "currency": "EUR" + }, + "remittanceInformationUnstructured": "just", + "endToEndIdentification": "SandboxTPPTest1" + } + }, + "response": { + "body": { + "transactionStatus": "RCVD", + "paymentId": "PDEA630971", + "_links": { + "startAuthorisation": { + "href": "https://api-sandbox.unicredit.de/hydrogen/v1/payments/sepa-credit-transfers/PDEA630971/authorisations" + } + } + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/update-psu-authentication.json b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/update-psu-authentication.json new file mode 100644 index 000000000..5f549d606 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/payments/sepa-credit-transfers/update-psu-authentication.json @@ -0,0 +1,36 @@ +{ + "request": { + "headers": { + "X-Request-ID": "662388a0-92f3-4d1d-bb95-b4c28fb19fbf", + "PSU-ID": "bgdemo", + "PSU-ID-Type": "HVB_ONLINEBANKING", + "Content-Type": "application/json" + }, + "params": { + "correlationId": "NCVY87" + }, + "body": { + "psuData": { + "password": "bgpassword" + } + } + }, + "response": { + "body": { + "scaStatus" : "started", + "chosenScaMethod" : { + "authenticationType" : "SMS_OTP", + "authenticationMethodId" : "03" + }, + "challengeData" : { + "otpMaxLength" : 6, + "otpFormat" : "integer" + }, + "_links" : { + "authoriseTransaction" : { + "href" : "https://api-sandbox.unicredit.de/hydrogen/v1/payments/sepa-credit-transfers/PDEA630971/authorisations/PDEA630971?lfdNumber=966&correlationId=NCVY87&authenticationCurrentNumber=966" + } + } + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/authenticate-psu.json b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/authenticate-psu.json new file mode 100644 index 000000000..0460426bc --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/authenticate-psu.json @@ -0,0 +1,24 @@ +{ + "request": { + "headers": { + "X-Request-ID": "662388a0-92f3-4d1d-bb95-b4c28fb19fbe", + "PSU-ID": "bgdemo", + "TPP-Redirect-URI": "http://localhost:8080/redirect", + "Content-Type": "application/json" + } + }, + "response": { + "body": { + "scaStatus": "received", + "authorisationId": "PDEA744022", + "_links": { + "updatePsuAuthentication": { + "href": "https://api-sandbox.unicredit.de/hydrogen/v1/periodic-payments/sepa-credit-transfers/PDEA744022/authorisations/PDEA744022?correlationId=JZ9TZO" + }, + "scaStatus": { + "href": "https://api-sandbox.unicredit.de/hydrogen/v1/periodic-payments/sepa-credit-transfers/PDEA744022/authorisations/PDEA744022" + } + } + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/authorise-transaction.json b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/authorise-transaction.json new file mode 100644 index 000000000..64fda4ce3 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/authorise-transaction.json @@ -0,0 +1,23 @@ +{ + "request": { + "headers": { + "X-Request-ID": "04f6c752-1f2a-4102-b926-52c2f5906afc", + "PSU-ID": "bgdemo", + "PSU-ID-Type": "HVB_ONLINEBANKING", + "Content-Type": "application/json" + }, + "params": { + "lfdNumber": "987", + "correlationId": "JZ9TZO", + "authenticationCurrentNumber": "987" + }, + "body": { + "scaAuthenticationData": "123456" + } + }, + "response": { + "body": { + "scaStatus": "finalised" + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/get-payment-status.json b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/get-payment-status.json new file mode 100644 index 000000000..eb47afb0b --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/get-payment-status.json @@ -0,0 +1,12 @@ +{ + "request": { + "headers": { + "X-Request-ID": "06b43276-40f6-4ba4-aa8a-50c8e7f2781d" + } + }, + "response": { + "body": { + "transactionStatus": "ACSP" + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/get-sca-status.json b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/get-sca-status.json new file mode 100644 index 000000000..fbd04d9a7 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/get-sca-status.json @@ -0,0 +1,18 @@ +{ + "request": { + "headers": { + "X-Request-ID": "610cc155-67bf-48b0-91cb-2830321f1857" + } + }, + "response": { + "body": { + "tppMessages": [ + { + "category": "ERROR", + "code": "RESOURCE_UNKNOWN", + "text": "The resource you are looking for was not found in our system" + } + ] + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/initiate-payment.json b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/initiate-payment.json new file mode 100644 index 000000000..3146c4f51 --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/initiate-payment.json @@ -0,0 +1,46 @@ +{ + "request": { + "headers": { + "X-Request-ID": "e56a3492-e9c7-4357-9b77-0a3bdafdd608", + "PSU-ID": "bgdemo", + "TPP-Redirect-URI": "http://localhost:8080/redirect", + "PSU-IP-Address": "0.0.0.0", + "PSU-ID-Type": "HVB_ONLINEBANKING", + "TPP-Redirect-Preferred": "false", + "Content-Type": "application/json" + }, + "body": { + "endToEndIdentification": "SandboxTPPTest1", + "debtorAccount": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "instructedAmount": { + "currency": "EUR", + "amount": "20.99" + }, + "creditorAccount": { + "iban": "DE49700202700123456785", + "currency": "EUR" + }, + "creditorName": "Merchant123", + "remittanceInformationUnstructured": "just", + "startDate": "2021-09-20", + "endDate": "2021-10-20", + "executionRule": "following", + "frequency": "Monthly", + "dayOfExecution": "28" + } + }, + "response": { + "body": { + "transactionStatus": "PDNG", + "paymentId": "PDEA744022", + "_links": { + "startAuthorisation": { + "href": "https://api-sandbox.unicredit.de/hydrogen/v1/periodic-payments/sepa-credit-transfers/PDEA744022/authorisations" + } + } + } + } +} diff --git a/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/update-psu-authentication.json b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/update-psu-authentication.json new file mode 100644 index 000000000..296c4968e --- /dev/null +++ b/adapters/unicredit-adapter/src/test/resources/pis/periodic-payments/sepa-credit-transfers/update-psu-authentication.json @@ -0,0 +1,36 @@ +{ + "request": { + "headers": { + "X-Request-ID": "662388a0-92f3-4d1d-bb95-b4c28fb19fbf", + "PSU-ID": "bgdemo", + "PSU-ID-Type": "HVB_ONLINEBANKING", + "Content-Type": "application/json" + }, + "params": { + "correlationId": "JZ9TZO" + }, + "body": { + "psuData": { + "password": "bgpassword" + } + } + }, + "response": { + "body": { + "scaStatus" : "started", + "chosenScaMethod" : { + "authenticationType" : "SMS_OTP", + "authenticationMethodId" : "03" + }, + "challengeData" : { + "otpMaxLength" : 6, + "otpFormat" : "integer" + }, + "_links" : { + "authoriseTransaction" : { + "href" : "https://api-sandbox.unicredit.de/hydrogen/v1/periodic-payments/sepa-credit-transfers/PDEA744022/authorisations/PDEA744022?lfdNumber=987&correlationId=JZ9TZO&authenticationCurrentNumber=987" + } + } + } + } +} diff --git a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc b/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc index c286023c9..db7027d40 100644 --- a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc +++ b/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc @@ -6,6 +6,7 @@ == Notices: - added WireMock stubs for `santander-adapter`. +- added WireMock stubs for `unicredit-adapter`. == Features: From 7ab466c3082c417dbca75bf4e64e8d6a200f00a1 Mon Sep 17 00:00:00 2001 From: Alexander Berezkin Date: Mon, 27 Sep 2021 10:56:55 +0300 Subject: [PATCH 08/10] Commerzbank and Comdirect wiremock (#627) * added ais stubs for commerzbank * added pis sepa payments stubs for commerzbank * added ais stubs for comdirect * added pis sepa payments stubs for comdirect * added notes into docs --- README.md | 2 + adapters/comdirect-adapter/pom.xml | 7 + .../comdirect-adapter/__files/.gitkeep | 0 .../mappings/ais-create-consent.json | 51 ++++++++ .../mappings/ais-delete-consent.json | 36 ++++++ .../mappings/ais-get-access-token.json | 38 ++++++ .../mappings/ais-get-accounts.json | 41 ++++++ .../mappings/ais-get-balances.json | 41 ++++++ .../ais-get-consent-authorisations.json | 38 ++++++ .../mappings/ais-get-consent-status.json | 38 ++++++ .../mappings/ais-get-sca-status.json | 38 ++++++ .../mappings/ais-get-transactions.json | 41 ++++++ .../mappings/pis-get-access-token.json | 38 ++++++ ...yments-sct-get-payment-authorisations.json | 38 ++++++ .../pis-payments-sct-get-payment-status.json | 38 ++++++ .../pis-payments-sct-get-sca-status.json | 38 ++++++ .../pis-payments-sct-initiate-payment.json | 52 ++++++++ ...AccountInformationServiceWireMockTest.java | 122 ++++++++++++++++++ .../ComdirectOauth2ServiceWireMockTest.java | 36 ++++++ ...tPaymentInitiationServiceWireMockTest.java | 84 ++++++++++++ .../test/resources/ais/create-consent.json | 57 ++++++++ .../test/resources/ais/delete-consent.json | 8 ++ .../src/test/resources/ais/get-accounts.json | 78 +++++++++++ .../src/test/resources/ais/get-balances.json | 66 ++++++++++ .../ais/get-consent-authorisations.json | 13 ++ .../resources/ais/get-consent-status.json | 13 ++ .../test/resources/ais/get-sca-status.json | 13 ++ .../test/resources/ais/get-transactions.json | 71 ++++++++++ .../resources/oauth2/get-access-token.json | 23 ++++ .../get-payment-authorisations.json | 13 ++ .../get-payment-status.json | 13 ++ .../sepa-credit-transfers/get-sca-status.json | 13 ++ .../initiate-payment.json | 47 +++++++ adapters/commerzbank-adapter/pom.xml | 7 + .../model/CommerzbankTransactionsReport.java | 10 +- .../commerzbank-adapter/__files/.gitkeep | 0 .../mappings/ais-create-consent.json | 51 ++++++++ .../mappings/ais-delete-consent.json | 36 ++++++ .../mappings/ais-get-access-token.json | 38 ++++++ .../mappings/ais-get-accounts.json | 41 ++++++ .../mappings/ais-get-balances.json | 41 ++++++ .../ais-get-consent-authorisations.json | 38 ++++++ .../mappings/ais-get-consent-status.json | 38 ++++++ .../mappings/ais-get-sca-status.json | 38 ++++++ .../mappings/ais-get-transactions.json | 41 ++++++ .../mappings/pis-get-access-token.json | 38 ++++++ ...yments-sct-get-payment-authorisations.json | 38 ++++++ .../pis-payments-sct-get-payment-status.json | 38 ++++++ .../pis-payments-sct-get-sca-status.json | 38 ++++++ .../pis-payments-sct-initiate-payment.json | 52 ++++++++ ...AccountInformationServiceWireMockTest.java | 122 ++++++++++++++++++ .../CommerzbankOauth2ServiceWireMockTest.java | 36 ++++++ ...kPaymentInitiationServiceWireMockTest.java | 84 ++++++++++++ .../test/resources/ais/create-consent.json | 57 ++++++++ .../test/resources/ais/delete-consent.json | 8 ++ .../src/test/resources/ais/get-accounts.json | 78 +++++++++++ .../src/test/resources/ais/get-balances.json | 66 ++++++++++ .../ais/get-consent-authorisations.json | 13 ++ .../resources/ais/get-consent-status.json | 13 ++ .../test/resources/ais/get-sca-status.json | 13 ++ .../test/resources/ais/get-transactions.json | 71 ++++++++++ .../resources/oauth2/get-access-token.json | 23 ++++ .../get-payment-authorisations.json | 13 ++ .../get-payment-status.json | 13 ++ .../sepa-credit-transfers/get-sca-status.json | 13 ++ .../initiate-payment.json | 47 +++++++ ...AccountInformationServiceWireMockTest.java | 2 +- ...lances.json.json => ais-get-balances.json} | 0 .../DRAFT_Release_notes_0.1.16.adoc | 2 + 69 files changed, 2496 insertions(+), 6 deletions(-) create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/__files/.gitkeep create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-create-consent.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-delete-consent.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-access-token.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-accounts.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-balances.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-consent-authorisations.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-consent-status.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-sca-status.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-transactions.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-get-access-token.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-payment-authorisations.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-payment-status.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-sca-status.json create mode 100644 adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-initiate-payment.json create mode 100644 adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectAccountInformationServiceWireMockTest.java create mode 100644 adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectOauth2ServiceWireMockTest.java create mode 100644 adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectPaymentInitiationServiceWireMockTest.java create mode 100644 adapters/comdirect-adapter/src/test/resources/ais/create-consent.json create mode 100644 adapters/comdirect-adapter/src/test/resources/ais/delete-consent.json create mode 100644 adapters/comdirect-adapter/src/test/resources/ais/get-accounts.json create mode 100644 adapters/comdirect-adapter/src/test/resources/ais/get-balances.json create mode 100644 adapters/comdirect-adapter/src/test/resources/ais/get-consent-authorisations.json create mode 100644 adapters/comdirect-adapter/src/test/resources/ais/get-consent-status.json create mode 100644 adapters/comdirect-adapter/src/test/resources/ais/get-sca-status.json create mode 100644 adapters/comdirect-adapter/src/test/resources/ais/get-transactions.json create mode 100644 adapters/comdirect-adapter/src/test/resources/oauth2/get-access-token.json create mode 100644 adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-authorisations.json create mode 100644 adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json create mode 100644 adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json create mode 100644 adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/__files/.gitkeep create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-create-consent.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-delete-consent.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-access-token.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-accounts.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-balances.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-consent-authorisations.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-consent-status.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-sca-status.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-transactions.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-get-access-token.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-payment-authorisations.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-payment-status.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-sca-status.json create mode 100644 adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-initiate-payment.json create mode 100644 adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankAccountInformationServiceWireMockTest.java create mode 100644 adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankOauth2ServiceWireMockTest.java create mode 100644 adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankPaymentInitiationServiceWireMockTest.java create mode 100644 adapters/commerzbank-adapter/src/test/resources/ais/create-consent.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/ais/delete-consent.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/ais/get-accounts.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/ais/get-balances.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/ais/get-consent-authorisations.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/ais/get-consent-status.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/ais/get-sca-status.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/ais/get-transactions.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/oauth2/get-access-token.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-authorisations.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json create mode 100644 adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json rename adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/{ais-get-balances.json.json => ais-get-balances.json} (100%) diff --git a/README.md b/README.md index 5f74f1ebe..5a5eb1eef 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,8 @@ Not all adapters have written stubs though. Responses available for the next ada - verlag-adapter - santander-adapter - unicredit-adapter +- commerzbank-adapter +- comdirect-adapter New stubs will be added in time. diff --git a/adapters/comdirect-adapter/pom.xml b/adapters/comdirect-adapter/pom.xml index b18f52f9f..d22829092 100644 --- a/adapters/comdirect-adapter/pom.xml +++ b/adapters/comdirect-adapter/pom.xml @@ -24,6 +24,13 @@ + + de.adorsys.xs2a.adapter + xs2a-adapter-test + ${project.version} + test + + pro.javatar.commons javatar-commons diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/__files/.gitkeep b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/__files/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-create-consent.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-create-consent.json new file mode 100644 index 000000000..7290d13fc --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-create-consent.json @@ -0,0 +1,51 @@ +{ + "id" : "ecb7864a-81d7-4ef0-ab96-8c9f382eb0ae", + "name" : "berlingroup_v1_consents", + "request" : { + "urlPattern" : ".*/v1/consents", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "TPP-Redirect-URI" : { + "matches" : ".+" + }, + "PSU-IP-Address" : { + "matches" : ".+" + }, + "Content-Type" : { + "equalTo" : "application/json; charset=UTF-8" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"access\":{\"accounts\":[{\"iban\":\"FR7630076020821234567890186\",\"currency\":\"EUR\"}],\"balances\":[{\"iban\":\"FR7630076020821234567890186\",\"currency\":\"EUR\"}],\"transactions\":[{\"iban\":\"FR7630076020821234567890186\",\"currency\":\"EUR\"}]},\"recurringIndicator\":true,\"validUntil\":\"${json-unit.regex}\\\\d{4}-[01]\\\\d-[0-3]\\\\d\",\"frequencyPerDay\":4,\"combinedServiceIndicator\":false}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\n \"consentStatus\" : \"received\",\n \"consentId\" : \"VALID_CONSENT_ID\",\n \"_links\" : {\n \"scaOAuth\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/.well-known/openid-configuration?authorizationId=22222222-2222-2222-2222-222222222222\"\n },\n \"scaStatus\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/consents/VALID_CONSENT_ID/authorisations/22222222-2222-2222-2222-222222222222\"\n },\n \"status\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/consents/VALID_CONSENT_ID/status\"\n },\n \"self\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/consents/VALID_CONSENT_ID\"\n }\n }\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 08:17:50 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "a719675a-339a-45c6-be0a-7d995a65a6b0", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "ASPSP-SCA-Approach" : "REDIRECT", + "Location" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/consents/VALID_CONSENT_ID", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "ecb7864a-81d7-4ef0-ab96-8c9f382eb0ae", + "persistent" : true, + "insertionIndex" : 1 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-delete-consent.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-delete-consent.json new file mode 100644 index 000000000..85426a5e1 --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-delete-consent.json @@ -0,0 +1,36 @@ +{ + "id" : "73b0a3c8-be6a-47cc-855b-be1d2ac5dc18", + "name" : "berlingroup_v1_consents_valid_consent_id", + "request" : { + "urlPattern" : ".*/v1/consents/.+", + "method" : "DELETE", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + } + }, + "response" : { + "status" : 204, + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 08:18:15 GMT", + "X-Request-ID" : "0e708551-89f1-4285-91c0-c875db300361", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "73b0a3c8-be6a-47cc-855b-be1d2ac5dc18", + "persistent" : true, + "insertionIndex" : 9 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-access-token.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-access-token.json new file mode 100644 index 000000000..bcc130e1b --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-access-token.json @@ -0,0 +1,38 @@ +{ + "id" : "fe49eda2-bf1a-4a21-bd07-365dfdab5bb1", + "name" : "berlingroup_v1_token", + "request" : { + "urlPattern" : ".*/v1/token", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/x-www-form-urlencoded" + } + }, + "bodyPatterns" : [ { + "contains" : "code=AIS_VALID_CODE", + "caseInsensitive" : false + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"access_token\" : \"91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487\",\n \"token_type\" : \"Bearer\",\n \"expires_in\" : 3600,\n \"refresh_token\" : \"d6a8c7f67044463eb71fec654d69008515f3967dda4a4133b7f93470f5eb24394a7640fedbbb4660a05a2001a03a70e8\",\n \"scope\" : \"AIS:VALID_CONSENT_ID\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 08:17:53 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "fe49eda2-bf1a-4a21-bd07-365dfdab5bb1", + "persistent" : true, + "insertionIndex" : 2 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-accounts.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-accounts.json new file mode 100644 index 000000000..4a317d794 --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-accounts.json @@ -0,0 +1,41 @@ +{ + "id" : "dbf8f9d9-b727-48f5-8ba8-4b13a32e9427", + "name" : "berlingroup_v1_accounts", + "request" : { + "urlPattern" : ".*/v1/accounts\\?withBalance=false", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "VALID_CONSENT_ID" + }, + "Authorization" : { + "equalTo" : "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"accounts\" : [ {\n \"resourceId\" : \"ACCOUNT_ID_4\",\n \"name\" : \"Personal account 4\",\n \"bic\" : \"NORDFRPP\",\n \"currency\" : \"EUR\",\n \"cashAccountType\" : \"CACC\",\n \"iban\" : \"FR7630076020821234567890186\",\n \"_links\" : {\n \"account\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID_4\"\n }\n },\n \"product\" : \"SAC\"\n }, {\n \"resourceId\" : \"ACCOUNT_ID\",\n \"name\" : \"Main personal account\",\n \"bic\" : \"CCFRFRPP\",\n \"currency\" : \"EUR\",\n \"cashAccountType\" : \"CACC\",\n \"iban\" : \"FR7630056009271234567890182\",\n \"_links\" : {\n \"account\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID\"\n },\n \"balances\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/balances\"\n },\n \"transactions\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/transactions\"\n }\n },\n \"product\" : \"SAC\"\n }, {\n \"resourceId\" : \"ACCOUNT_ID_2\",\n \"name\" : \"Personal account 2\",\n \"bic\" : \"CMCIFRPAXXX\",\n \"currency\" : \"EUR\",\n \"cashAccountType\" : \"CACC\",\n \"iban\" : \"FR7611808009101234567890147\",\n \"_links\" : {\n \"account\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID_2\"\n },\n \"balances\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID_2/balances\"\n }\n },\n \"product\" : \"SAC\"\n }, {\n \"resourceId\" : \"ACCOUNT_ID_3\",\n \"name\" : \"Personal account 3\",\n \"bic\" : \"PSSTFRPPCNE\",\n \"currency\" : \"EUR\",\n \"cashAccountType\" : \"CACC\",\n \"iban\" : \"FR7610011000201234567890188\",\n \"_links\" : {\n \"account\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID_3\"\n }\n },\n \"product\" : \"SAC\"\n } ]\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 08:17:57 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "1eadb9b6-05fb-43cd-ad3e-d22daf50facc", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "dbf8f9d9-b727-48f5-8ba8-4b13a32e9427", + "persistent" : true, + "insertionIndex" : 3 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-balances.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-balances.json new file mode 100644 index 000000000..28eee8d3e --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-balances.json @@ -0,0 +1,41 @@ +{ + "id" : "e1b93eb0-85a0-488c-aaed-1466d71ed8d4", + "name" : "berlingroup_v1_accounts_account_id_balances", + "request" : { + "urlPattern" : ".*/v1/accounts/.+/balances", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "VALID_CONSENT_ID" + }, + "Authorization" : { + "equalTo" : "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"account\" : {\n \"iban\" : \"FR7630056009271234567890182\",\n \"currency\" : \"EUR\"\n },\n \"balances\" : [ {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 150.02\n },\n \"lastChangeDateTime\" : \"2018-02-26T00:00:00\",\n \"referenceDate\" : \"2021-09-24\",\n \"balanceType\" : \"closingBooked\"\n }, {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 100.02\n },\n \"lastChangeDateTime\" : \"2021-09-24T00:00:00\",\n \"referenceDate\" : \"2018-02-27\",\n \"balanceType\" : \"expected\"\n }, {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 100.02\n },\n \"lastChangeDateTime\" : \"2021-09-24T00:00:00\",\n \"referenceDate\" : \"2021-09-24\",\n \"balanceType\" : \"interimAvailable\"\n }, {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 110\n },\n \"lastChangeDateTime\" : \"2021-09-24T00:00:00\",\n \"referenceDate\" : \"2018-02-01\",\n \"balanceType\" : \"openingBooked\"\n }, {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 13.37\n },\n \"lastChangeDateTime\" : \"2021-09-24T00:00:00\",\n \"referenceDate\" : \"2021-09-24\",\n \"balanceType\" : \"interimBooked\"\n }, {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 42\n },\n \"lastChangeDateTime\" : \"2021-09-24T00:00:00\",\n \"referenceDate\" : \"2021-09-24\",\n \"balanceType\" : \"forwardAvailable\"\n } ]\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 08:18:04 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "c144f3f6-8881-4be9-9143-2b49e9c1949f", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "e1b93eb0-85a0-488c-aaed-1466d71ed8d4", + "persistent" : true, + "insertionIndex" : 5 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-consent-authorisations.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-consent-authorisations.json new file mode 100644 index 000000000..b27d9e792 --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-consent-authorisations.json @@ -0,0 +1,38 @@ +{ + "id" : "cafd9844-e3f2-4117-a87d-52095c9313ab", + "name" : "berlingroup_v1_consents_valid_consent_id_authorisations", + "request" : { + "urlPattern" : ".*/v1/consents/.+/authorisations", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"authorisationIds\" : [ \"11111111-1111-1111-1111-111111111111\", \"22222222-2222-2222-2222-222222222222\", \"99999999-9999-9999-9999-999999999999\" ]\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 08:18:08 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "93ab06a1-aecf-4aec-8df4-471fa9982783", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "cafd9844-e3f2-4117-a87d-52095c9313ab", + "persistent" : true, + "insertionIndex" : 6 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-consent-status.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-consent-status.json new file mode 100644 index 000000000..9faad92db --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-consent-status.json @@ -0,0 +1,38 @@ +{ + "id" : "9cd5ddf2-3524-4901-a6e0-55a9d11d941f", + "name" : "berlingroup_v1_consents_valid_consent_id_status", + "request" : { + "urlPattern" : ".*/v1/consents/.+/status", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"consentStatus\" : \"valid\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 08:18:13 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "5e28cd26-41f9-40c8-80c1-a134102c0802", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "9cd5ddf2-3524-4901-a6e0-55a9d11d941f", + "persistent" : true, + "insertionIndex" : 8 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-sca-status.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-sca-status.json new file mode 100644 index 000000000..62a25d5ed --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-sca-status.json @@ -0,0 +1,38 @@ +{ + "id" : "6b59308c-8dd0-45da-a07e-e1053e79031e", + "name" : "berlingroup_v1_consents_valid_consent_id_authorisations_11111111-1111-1111-1111-111111111111", + "request" : { + "urlPattern" : ".*/v1/consents/.+/authorisations/.+", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"scaStatus\" : \"finalised\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 08:18:10 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "7a31ae12-8d0d-46d8-af37-c268f0b38eb4", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "6b59308c-8dd0-45da-a07e-e1053e79031e", + "persistent" : true, + "insertionIndex" : 7 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-transactions.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-transactions.json new file mode 100644 index 000000000..11aa011b3 --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/ais-get-transactions.json @@ -0,0 +1,41 @@ +{ + "id" : "197c9e78-a319-4839-8f57-bfeb6d2a4b18", + "name" : "berlingroup_v1_accounts_account_id_transactions", + "request" : { + "urlPattern" : ".*/v1/accounts/.+/transactions\\?dateFrom=.+&dateTo=.+&bookingStatus=booked&withBalance=true", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "VALID_CONSENT_ID" + }, + "Authorization" : { + "equalTo" : "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"account\" : {\n \"iban\" : \"FR7630056009271234567890182\",\n \"currency\" : \"EUR\"\n },\n \"balances\" : [ {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 150.02\n },\n \"lastChangeDateTime\" : \"2018-02-26T00:00:00\",\n \"referenceDate\" : \"2021-09-24\",\n \"balanceType\" : \"closingBooked\"\n } ],\n \"transactions\" : {\n \"booked\" : [ {\n \"transactionId\" : \"1234567\",\n \"bookingDate\" : \"2021-09-14\",\n \"valueDate\" : \"2021-09-14\",\n \"transactionAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : -256.67\n },\n \"creditorName\" : \"John Miles\",\n \"creditorAccount\" : {\n \"iban\" : \"DE43533700240123456900\"\n },\n \"remittanceInformationUnstructured\" : \"Example 1\",\n \"_links\" : {\n \"transactionDetails\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/transactions/1234567\"\n }\n }\n } ],\n \"pending\" : [ ],\n \"_links\" : {\n \"first\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/transactions?dateFrom=1970-01-01&dateTo=2020-07-01&bookingStatus=BOOKED&withBalance=true&page=0\"\n },\n \"last\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/transactions?dateFrom=1970-01-01&dateTo=2020-07-01&bookingStatus=BOOKED&withBalance=true&page=0\"\n },\n \"account\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID\"\n },\n \"balances\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/balances\"\n },\n \"transactions\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/transactions\"\n }\n }\n }\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 08:18:00 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "7ad5023d-2a02-42c3-9dd5-33705c8365c0", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "197c9e78-a319-4839-8f57-bfeb6d2a4b18", + "persistent" : true, + "insertionIndex" : 4 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-get-access-token.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-get-access-token.json new file mode 100644 index 000000000..effc9fae2 --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-get-access-token.json @@ -0,0 +1,38 @@ +{ + "id" : "ac3d8b56-1221-4fc8-9fe9-377f3fed9de4", + "name" : "berlingroup_v1_token", + "request" : { + "urlPattern" : ".*/v1/token", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/x-www-form-urlencoded" + } + }, + "bodyPatterns" : [ { + "contains" : "code=PIS_VALID_CODE", + "caseInsensitive" : false + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"access_token\" : \"77afd3fae10c4d468dda1a8efea4d7d723c1f44e7db8493085be58d23e1d5e37a153fe97a7e14e569f10e168c2c5c61c\",\n \"token_type\" : \"Bearer\",\n \"expires_in\" : 300,\n \"refresh_token\" : \"666fc81ea4e84ec5a10423ce9677a7decee81d6e4b4f4ed5b8295ed74cc661cf2b24d2ba62d145f6a8fb9950665792c5\",\n \"scope\" : \"PIS:PAYMENT_ID_RCVD_SCT\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 15:00:31 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "ac3d8b56-1221-4fc8-9fe9-377f3fed9de4", + "persistent" : true, + "insertionIndex" : 11 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-payment-authorisations.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-payment-authorisations.json new file mode 100644 index 000000000..493bb976f --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-payment-authorisations.json @@ -0,0 +1,38 @@ +{ + "id" : "cd4c1bdd-218e-49d5-953c-1060b02e168c", + "name" : "berlingroup_v1_payments_sepa-credit-transfers_payment_id_patc_sct_authorisations", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/authorisations", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 77afd3fae10c4d468dda1a8efea4d7d723c1f44e7db8493085be58d23e1d5e37a153fe97a7e14e569f10e168c2c5c61c" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"authorisationIds\" : [ \"11111111-1111-1111-1111-111111111111\", \"22222222-2222-2222-2222-222222222222\", \"99999999-9999-9999-9999-999999999999\" ]\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 15:00:41 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "9a56d698-f008-43fd-a3fc-7564de11961b", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "cd4c1bdd-218e-49d5-953c-1060b02e168c", + "persistent" : true, + "insertionIndex" : 13 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-payment-status.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-payment-status.json new file mode 100644 index 000000000..b59c4c7c8 --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-payment-status.json @@ -0,0 +1,38 @@ +{ + "id" : "21b27c0f-6510-49fb-b5ac-66a1f37926c4", + "name" : "berlingroup_v1_payments_sepa-credit-transfers_payment_id_patc_sct_status", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/status", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 77afd3fae10c4d468dda1a8efea4d7d723c1f44e7db8493085be58d23e1d5e37a153fe97a7e14e569f10e168c2c5c61c" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"transactionStatus\" : \"PATC\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 15:00:37 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "42ccfae6-1068-42a4-879b-29e14510933f", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "21b27c0f-6510-49fb-b5ac-66a1f37926c4", + "persistent" : true, + "insertionIndex" : 12 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-sca-status.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-sca-status.json new file mode 100644 index 000000000..31771fcbe --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-get-sca-status.json @@ -0,0 +1,38 @@ +{ + "id" : "3d25cd53-7c70-48bd-a86a-85a733867870", + "name" : "berlingroup_v1_payments_sepa-credit-transfers_payment_id_patc_sct_authorisations_11111111-1111-1111-1111-111111111111", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/authorisations/.+", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 77afd3fae10c4d468dda1a8efea4d7d723c1f44e7db8493085be58d23e1d5e37a153fe97a7e14e569f10e168c2c5c61c" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"scaStatus\" : \"finalised\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 15:00:43 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "cbe5da32-b6c1-40d5-98e5-f5db081fb0b2", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "3d25cd53-7c70-48bd-a86a-85a733867870", + "persistent" : true, + "insertionIndex" : 14 +} diff --git a/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-initiate-payment.json b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-initiate-payment.json new file mode 100644 index 000000000..86237aa41 --- /dev/null +++ b/adapters/comdirect-adapter/src/main/resources/comdirect-adapter/mappings/pis-payments-sct-initiate-payment.json @@ -0,0 +1,52 @@ +{ + "id" : "a6926889-0bf0-49b7-a3b5-86be8408e392", + "name" : "berlingroup_v1_payments_sepa-credit-transfers", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "TPP-Redirect-URI" : { + "matches" : ".+" + }, + "PSU-IP-Address" : { + "matches" : ".+" + }, + "Content-Type" : { + "equalTo" : "application/json; charset=UTF-8" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"endToEndIdentification\":\"SandboxTPPTest1\",\"debtorAccount\":{\"iban\":\"FR8230066631856742938741993\",\"currency\":\"EUR\"},\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"${json-unit.regex}-?[0-9]{1,14}(\\\\.[0-9]{1,3})?\"},\"creditorAccount\":{\"iban\":\"FR8230066631856742938741993\",\"currency\":\"EUR\"},\"creditorName\":\"${json-unit.any-string}\",\"remittanceInformationUnstructured\":\"just\"}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\n \"transactionStatus\" : \"RCVD\",\n \"paymentId\" : \"PAYMENT_ID_RCVD_SCT\",\n \"_links\" : {\n \"scaOAuth\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/.well-known/openid-configuration?authorizationId=11111111-1111-1111-1111-111111111111\"\n },\n \"scaStatus\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT/authorisations/11111111-1111-1111-1111-111111111111\"\n },\n \"self\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT\"\n },\n \"status\" : {\n \"href\" : \"https://xs2a-sandbox.comdirect.de/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT/status\"\n }\n }\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Fri, 24 Sep 2021 15:00:28 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "5ea34488-9aec-462d-af31-c439933a7938", + "ASPSP-Notification-Support" : "true", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "ASPSP-SCA-Approach" : "REDIRECT", + "Location" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/payments/SEPA_CREDIT_TRANSFERS/PAYMENT_ID_RCVD_SCT", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "a6926889-0bf0-49b7-a3b5-86be8408e392", + "persistent" : true, + "insertionIndex" : 10 +} diff --git a/adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectAccountInformationServiceWireMockTest.java b/adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectAccountInformationServiceWireMockTest.java new file mode 100644 index 000000000..9803e52ab --- /dev/null +++ b/adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectAccountInformationServiceWireMockTest.java @@ -0,0 +1,122 @@ +package de.adorsys.xs2a.adapter.comdirect; + +import de.adorsys.xs2a.adapter.api.AccountInformationService; +import de.adorsys.xs2a.adapter.api.RequestParams; +import de.adorsys.xs2a.adapter.api.model.*; +import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; +import de.adorsys.xs2a.adapter.test.TestRequestResponse; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static org.assertj.core.api.Assertions.assertThat; + +@ServiceWireMockTest(ComdirectServiceProvider.class) +class ComdirectAccountInformationServiceWireMockTest { + + private static final String CONSENT_ID = "VALID_CONSENT_ID"; + private static final String ACCOUNT_ID = "ACCOUNT_ID"; + private static final String AUTHORISATION_ID = "11111111-1111-1111-1111-111111111111"; + + private final AccountInformationService accountInformationService; + + ComdirectAccountInformationServiceWireMockTest(AccountInformationService accountInformationService) { + this.accountInformationService = accountInformationService; + } + + @Test + void createConsent() throws IOException { + var requestResponse = new TestRequestResponse("ais/create-consent.json"); + + var response = accountInformationService.createConsent(requestResponse.requestHeaders(), + RequestParams.empty(), + requestResponse.requestBody(Consents.class)); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ConsentsResponse201.class)); + } + + @Test + void deleteConsent() throws IOException { + var requestResponse = new TestRequestResponse("ais/delete-consent.json"); + + var response = accountInformationService.deleteConsent(CONSENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getStatusCode()) + .isEqualTo(204); + } + + @Test + void getAccounts() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-accounts.json"); + + var response = accountInformationService.getAccountList(requestResponse.requestHeaders(), + requestResponse.requestParams()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(AccountList.class)); + } + + @Test + void getBalances() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-balances.json"); + + var response = accountInformationService.getBalances(ACCOUNT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ReadAccountBalanceResponse200.class)); + } + + @Test + void getConsentAuthorisation() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-consent-authorisations.json"); + + var response = accountInformationService.getConsentAuthorisation(CONSENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(Authorisations.class)); + } + + @Test + void getConsentStatus() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-consent-status.json"); + + var response = accountInformationService.getConsentStatus(CONSENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ConsentStatusResponse200.class)); + } + + @Test + void getScaStatus() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-sca-status.json"); + + var response = accountInformationService.getConsentScaStatus(CONSENT_ID, + AUTHORISATION_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ScaStatusResponse.class)); + } + + @Test + void getTransactions() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-transactions.json"); + + var response = accountInformationService.getTransactionList(ACCOUNT_ID, + requestResponse.requestHeaders(), + requestResponse.requestParams()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(TransactionsResponse200Json.class)); + } +} diff --git a/adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectOauth2ServiceWireMockTest.java b/adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectOauth2ServiceWireMockTest.java new file mode 100644 index 000000000..68c1682b7 --- /dev/null +++ b/adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectOauth2ServiceWireMockTest.java @@ -0,0 +1,36 @@ +package de.adorsys.xs2a.adapter.comdirect; + +import de.adorsys.xs2a.adapter.api.Oauth2Service; +import de.adorsys.xs2a.adapter.api.model.TokenResponse; +import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; +import de.adorsys.xs2a.adapter.test.TestRequestResponse; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.LinkedHashMap; + +import static org.assertj.core.api.Assertions.assertThat; + +@ServiceWireMockTest(ComdirectServiceProvider.class) +class ComdirectOauth2ServiceWireMockTest { + + private final Oauth2Service oauth2Service; + + ComdirectOauth2ServiceWireMockTest(Oauth2Service oauth2Service) { + this.oauth2Service = oauth2Service; + } + + @Test + void getAccessToken() throws IOException { + var requestResponse = new TestRequestResponse("oauth2/get-access-token.json"); + + var modifiableParams = new LinkedHashMap<>(requestResponse.requestParams().toMap()); + + var actualToken = oauth2Service.getToken(requestResponse.requestHeaders().toMap(), + new Oauth2Service.Parameters(modifiableParams)); + + assertThat(actualToken) + .isNotNull() + .isEqualTo(requestResponse.responseBody(TokenResponse.class)); + } +} diff --git a/adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectPaymentInitiationServiceWireMockTest.java b/adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectPaymentInitiationServiceWireMockTest.java new file mode 100644 index 000000000..7fd4021f8 --- /dev/null +++ b/adapters/comdirect-adapter/src/test/java/de/adorsys/xs2a/adapter/comdirect/ComdirectPaymentInitiationServiceWireMockTest.java @@ -0,0 +1,84 @@ +package de.adorsys.xs2a.adapter.comdirect; + +import de.adorsys.xs2a.adapter.api.PaymentInitiationService; +import de.adorsys.xs2a.adapter.api.RequestParams; +import de.adorsys.xs2a.adapter.api.model.*; +import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; +import de.adorsys.xs2a.adapter.test.TestRequestResponse; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static de.adorsys.xs2a.adapter.api.model.PaymentProduct.SEPA_CREDIT_TRANSFERS; +import static de.adorsys.xs2a.adapter.api.model.PaymentService.PAYMENTS; +import static org.assertj.core.api.Assertions.assertThat; + +@ServiceWireMockTest(ComdirectServiceProvider.class) +class ComdirectPaymentInitiationServiceWireMockTest { + + private static final String PAYMENT_ID = "PAYMENT_ID_RCVD_SCT"; + private static final String AUTHORISATION_ID = "11111111-1111-1111-1111-111111111111"; + + private final PaymentInitiationService paymentInitiationService; + + ComdirectPaymentInitiationServiceWireMockTest(PaymentInitiationService paymentInitiationService) { + this.paymentInitiationService = paymentInitiationService; + } + + @Test + void initiatePayment() throws IOException { + var requestResponse = new TestRequestResponse("pis/payments/sepa-credit-transfers/initiate-payment.json"); + + var response = paymentInitiationService.initiatePayment(PAYMENTS, + SEPA_CREDIT_TRANSFERS, + requestResponse.requestHeaders(), + RequestParams.empty(), + requestResponse.requestBody(PaymentInitiationJson.class)); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(PaymentInitationRequestResponse201.class)); + } + + @Test + void getPaymentStatus() throws IOException { + var requestResponse = new TestRequestResponse("pis/payments/sepa-credit-transfers/get-payment-status.json"); + + var response = paymentInitiationService.getPaymentInitiationStatus(PAYMENTS, + SEPA_CREDIT_TRANSFERS, + PAYMENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(PaymentInitiationStatusResponse200Json.class)); + } + + @Test + void getPaymentAuthorisations() throws IOException { + var requestResponse = new TestRequestResponse("pis/payments/sepa-credit-transfers/get-payment-authorisations.json"); + + var response = paymentInitiationService.getPaymentInitiationAuthorisation(PAYMENTS, + SEPA_CREDIT_TRANSFERS, + PAYMENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(Authorisations.class)); + } + + @Test + void getScaStatus() throws IOException { + var requestResponse = new TestRequestResponse("pis/payments/sepa-credit-transfers/get-sca-status.json"); + + var response = paymentInitiationService.getPaymentInitiationScaStatus(PAYMENTS, + SEPA_CREDIT_TRANSFERS, + PAYMENT_ID, + AUTHORISATION_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ScaStatusResponse.class)); + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/ais/create-consent.json b/adapters/comdirect-adapter/src/test/resources/ais/create-consent.json new file mode 100644 index 000000000..cb8688553 --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/ais/create-consent.json @@ -0,0 +1,57 @@ +{ + "request": { + "headers": { + "X-Request-ID": "b2323695-917b-43f1-abb2-0d247c1937f0", + "Content-Type": "application/json", + "PSU-IP-Address": "0.0.0.0", + "X-GTW-ASPSP-ID": "14a0c2ad-b9bf-4200-853a-a7abe541b714", + "TPP-Redirect-URI": "https://example.com" + }, + "body": { + "access": { + "balances": [ + { + "iban": "FR7630076020821234567890186", + "currency": "EUR" + } + ], + "transactions": [ + { + "iban": "FR7630076020821234567890186", + "currency": "EUR" + } + ], + "accounts": [ + { + "iban": "FR7630076020821234567890186", + "currency": "EUR" + } + ] + }, + "combinedServiceIndicator": "false", + "recurringIndicator": "true", + "validUntil": "2021-09-23", + "frequencyPerDay": "4" + } + }, + "response": { + "body": { + "consentStatus" : "received", + "consentId" : "VALID_CONSENT_ID", + "_links" : { + "scaOAuth" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/.well-known/openid-configuration?authorizationId=22222222-2222-2222-2222-222222222222" + }, + "scaStatus" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/consents/VALID_CONSENT_ID/authorisations/22222222-2222-2222-2222-222222222222" + }, + "status" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/consents/VALID_CONSENT_ID/status" + }, + "self" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/consents/VALID_CONSENT_ID" + } + } + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/ais/delete-consent.json b/adapters/comdirect-adapter/src/test/resources/ais/delete-consent.json new file mode 100644 index 000000000..3dacc89a7 --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/ais/delete-consent.json @@ -0,0 +1,8 @@ +{ + "request": { + "headers": { + "X-Request-ID": "68b4a545-ec12-47e4-9bd8-2984b4e4575f", + "Authorization": "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/ais/get-accounts.json b/adapters/comdirect-adapter/src/test/resources/ais/get-accounts.json new file mode 100644 index 000000000..06be518bc --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/ais/get-accounts.json @@ -0,0 +1,78 @@ +{ + "request": { + "headers": { + "X-Request-ID": "58fa1ca2-9adf-4555-b892-0eca1e4c5178", + "Consent-ID": "VALID_CONSENT_ID", + "Authorization": "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + }, + "params": { + "withBalance": "false" + } + }, + "response": { + "body": { + "accounts" : [ { + "resourceId" : "ACCOUNT_ID_4", + "name" : "Personal account 4", + "bic" : "NORDFRPP", + "currency" : "EUR", + "cashAccountType" : "CACC", + "iban" : "FR7630076020821234567890186", + "_links" : { + "account" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID_4" + } + }, + "product" : "SAC" + }, { + "resourceId" : "ACCOUNT_ID", + "name" : "Main personal account", + "bic" : "CCFRFRPP", + "currency" : "EUR", + "cashAccountType" : "CACC", + "iban" : "FR7630056009271234567890182", + "_links" : { + "account" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID" + }, + "balances" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/balances" + }, + "transactions" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/transactions" + } + }, + "product" : "SAC" + }, { + "resourceId" : "ACCOUNT_ID_2", + "name" : "Personal account 2", + "bic" : "CMCIFRPAXXX", + "currency" : "EUR", + "cashAccountType" : "CACC", + "iban" : "FR7611808009101234567890147", + "_links" : { + "account" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID_2" + }, + "balances" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID_2/balances" + } + }, + "product" : "SAC" + }, { + "resourceId" : "ACCOUNT_ID_3", + "name" : "Personal account 3", + "bic" : "PSSTFRPPCNE", + "currency" : "EUR", + "cashAccountType" : "CACC", + "iban" : "FR7610011000201234567890188", + "_links" : { + "account" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID_3" + } + }, + "product" : "SAC" + } ] + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/ais/get-balances.json b/adapters/comdirect-adapter/src/test/resources/ais/get-balances.json new file mode 100644 index 000000000..8254faf03 --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/ais/get-balances.json @@ -0,0 +1,66 @@ +{ + "request": { + "headers": { + "X-Request-ID": "991cc90c-5795-4dad-b802-b7315f192227", + "Consent-ID": "VALID_CONSENT_ID", + "Authorization": "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + }, + "response": { + "body": { + "account" : { + "iban" : "FR7630056009271234567890182", + "currency" : "EUR" + }, + "balances" : [ { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 150.02 + }, + "lastChangeDateTime" : "2018-02-26T00:00:00+01:00", + "referenceDate" : "2021-09-24", + "balanceType" : "closingBooked" + }, { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 100.02 + }, + "lastChangeDateTime" : "2021-09-24T00:00:00+02:00", + "referenceDate" : "2018-02-27", + "balanceType" : "expected" + }, { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 100.02 + }, + "lastChangeDateTime" : "2021-09-24T00:00:00+02:00", + "referenceDate" : "2021-09-24", + "balanceType" : "interimAvailable" + }, { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 110 + }, + "lastChangeDateTime" : "2021-09-24T00:00:00+02:00", + "referenceDate" : "2018-02-01", + "balanceType" : "openingBooked" + }, { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 13.37 + }, + "lastChangeDateTime" : "2021-09-24T00:00:00+02:00", + "referenceDate" : "2021-09-24", + "balanceType" : "interimBooked" + }, { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 42 + }, + "lastChangeDateTime" : "2021-09-24T00:00:00+02:00", + "referenceDate" : "2021-09-24", + "balanceType" : "forwardAvailable" + } ] + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/ais/get-consent-authorisations.json b/adapters/comdirect-adapter/src/test/resources/ais/get-consent-authorisations.json new file mode 100644 index 000000000..81ef967a7 --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/ais/get-consent-authorisations.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "991cc90c-5795-4dad-b802-b7315f192227", + "Authorization": "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + }, + "response": { + "body": { + "authorisationIds" : [ "11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222", "99999999-9999-9999-9999-999999999999" ] + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/ais/get-consent-status.json b/adapters/comdirect-adapter/src/test/resources/ais/get-consent-status.json new file mode 100644 index 000000000..1baa59ffb --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/ais/get-consent-status.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "b3b9856e-1334-48c9-a1e4-8a1e44d3811d", + "Authorization": "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + }, + "response": { + "body": { + "consentStatus": "valid" + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/ais/get-sca-status.json b/adapters/comdirect-adapter/src/test/resources/ais/get-sca-status.json new file mode 100644 index 000000000..644f16a79 --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/ais/get-sca-status.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "a0448f06-780e-4875-8227-6dc3c1433fb7", + "Authorization": "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + } + }, + "response": { + "body": { + "scaStatus" : "finalised" + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/ais/get-transactions.json b/adapters/comdirect-adapter/src/test/resources/ais/get-transactions.json new file mode 100644 index 000000000..80c80d68b --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/ais/get-transactions.json @@ -0,0 +1,71 @@ +{ + "request": { + "headers": { + "X-Request-ID": "c558ad1b-9e19-4fae-ac89-90a0f811f1ff", + "Consent-ID": "VALID_CONSENT_ID", + "Authorization": "Bearer 91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487" + }, + "params": { + "dateFrom": "2020-07-06", + "dateTo": "2020-08-06", + "bookingStatus": "booked", + "withBalance": "true" + } + }, + "response": { + "body": { + "account" : { + "iban" : "FR7630056009271234567890182", + "currency" : "EUR" + }, + "balances" : [ { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 150.02 + }, + "lastChangeDateTime" : "2018-02-26T00:00:00+01:00", + "referenceDate" : "2021-09-24", + "balanceType" : "closingBooked" + } ], + "transactions" : { + "booked" : [ { + "transactionId" : "1234567", + "bookingDate" : "2021-09-14", + "valueDate" : "2021-09-14", + "transactionAmount" : { + "currency" : "EUR", + "amount" : -256.67 + }, + "creditorName" : "John Miles", + "creditorAccount" : { + "iban" : "DE43533700240123456900" + }, + "remittanceInformationUnstructured" : "Example 1", + "_links" : { + "transactionDetails" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/transactions/1234567" + } + } + } ], + "pending" : [ ], + "_links" : { + "first" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/transactions?dateFrom=1970-01-01&dateTo=2020-07-01&bookingStatus=BOOKED&withBalance=true&page=0" + }, + "last" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/transactions?dateFrom=1970-01-01&dateTo=2020-07-01&bookingStatus=BOOKED&withBalance=true&page=0" + }, + "account" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID" + }, + "balances" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/balances" + }, + "transactions" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/accounts/ACCOUNT_ID/transactions" + } + } + } + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/oauth2/get-access-token.json b/adapters/comdirect-adapter/src/test/resources/oauth2/get-access-token.json new file mode 100644 index 000000000..8554c3848 --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/oauth2/get-access-token.json @@ -0,0 +1,23 @@ +{ + "request": { + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": { + "code": "AIS_VALID_CODE", + "redirect_uri": "https://client.example.com/cb", + "grant_type": "authorization_code", + "client_id": "VALID_CLIENT_ID", + "code_verifier": "any_value" + } + }, + "response": { + "body": { + "access_token" : "91bf86c06f494054a164154891d462c23caf8fe7b0994d4d8da674bc78c2141a5c84866e122c461fae87ca71ae6fe487", + "token_type" : "Bearer", + "expires_in" : 3600, + "refresh_token" : "d6a8c7f67044463eb71fec654d69008515f3967dda4a4133b7f93470f5eb24394a7640fedbbb4660a05a2001a03a70e8", + "scope" : "AIS:VALID_CONSENT_ID" + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-authorisations.json b/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-authorisations.json new file mode 100644 index 000000000..f8528ad3e --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-authorisations.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "06b43276-40f6-4ba4-aa8a-50c8e7f27820", + "Authorization": "Bearer 77afd3fae10c4d468dda1a8efea4d7d723c1f44e7db8493085be58d23e1d5e37a153fe97a7e14e569f10e168c2c5c61c" + } + }, + "response": { + "body": { + "authorisationIds" : [ "11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222", "99999999-9999-9999-9999-999999999999" ] + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json b/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json new file mode 100644 index 000000000..db44502e9 --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "06b43276-40f6-4ba4-aa8a-50c8e7f27820", + "Authorization": "Bearer 77afd3fae10c4d468dda1a8efea4d7d723c1f44e7db8493085be58d23e1d5e37a153fe97a7e14e569f10e168c2c5c61c" + } + }, + "response": { + "body": { + "transactionStatus": "PATC" + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json b/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json new file mode 100644 index 000000000..3054f80be --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "610cc155-67bf-48b0-91cb-2830321f1859", + "Authorization": "Bearer 77afd3fae10c4d468dda1a8efea4d7d723c1f44e7db8493085be58d23e1d5e37a153fe97a7e14e569f10e168c2c5c61c" + } + }, + "response": { + "body": { + "scaStatus": "finalised" + } + } +} diff --git a/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json b/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json new file mode 100644 index 000000000..5a4f3055f --- /dev/null +++ b/adapters/comdirect-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json @@ -0,0 +1,47 @@ +{ + "request": { + "headers": { + "X-Request-ID": "57f3a3cb-5699-4871-9bd5-aacddce09aa9", + "TPP-Redirect-URI": "https://example.com/redirect", + "PSU-IP-Address": "0.0.0.0", + "Content-Type": "application/json; charset=UTF-8" + }, + "body": { + "endToEndIdentification": "SandboxTPPTest1", + "debtorAccount": { + "iban": "FR8230066631856742938741993", + "currency": "EUR" + }, + "instructedAmount": { + "currency": "EUR", + "amount": "20.99" + }, + "creditorAccount": { + "iban": "FR8230066631856742938741993", + "currency": "EUR" + }, + "creditorName": "Anton Brueckner", + "remittanceInformationUnstructured": "just" + } + }, + "response": { + "body": { + "transactionStatus" : "RCVD", + "paymentId" : "PAYMENT_ID_RCVD_SCT", + "_links" : { + "scaOAuth" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/.well-known/openid-configuration?authorizationId=11111111-1111-1111-1111-111111111111" + }, + "scaStatus" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT/authorisations/11111111-1111-1111-1111-111111111111" + }, + "self" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT" + }, + "status" : { + "href" : "https://xs2a-sandbox.comdirect.de/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT/status" + } + } + } + } +} diff --git a/adapters/commerzbank-adapter/pom.xml b/adapters/commerzbank-adapter/pom.xml index 9e7acb1be..02e380f5e 100644 --- a/adapters/commerzbank-adapter/pom.xml +++ b/adapters/commerzbank-adapter/pom.xml @@ -24,6 +24,13 @@ + + de.adorsys.xs2a.adapter + xs2a-adapter-test + ${project.version} + test + + pro.javatar.commons javatar-commons diff --git a/adapters/commerzbank-adapter/src/main/java/de/adorsys/xs2a/adapter/commerzbank/model/CommerzbankTransactionsReport.java b/adapters/commerzbank-adapter/src/main/java/de/adorsys/xs2a/adapter/commerzbank/model/CommerzbankTransactionsReport.java index fa67a9088..4d4f83701 100644 --- a/adapters/commerzbank-adapter/src/main/java/de/adorsys/xs2a/adapter/commerzbank/model/CommerzbankTransactionsReport.java +++ b/adapters/commerzbank-adapter/src/main/java/de/adorsys/xs2a/adapter/commerzbank/model/CommerzbankTransactionsReport.java @@ -8,18 +8,18 @@ import java.util.Map; public class CommerzbankTransactionsReport { - private AccountReference accountReference; + private AccountReference account; private CommerzbankAccountReport transactions; private List balances; @JsonProperty("_links") private Map links; - public AccountReference getAccountReference() { - return accountReference; + public AccountReference getAccount() { + return account; } - public void setAccountReference(AccountReference accountReference) { - this.accountReference = accountReference; + public void setAccount(AccountReference account) { + this.account = account; } public CommerzbankAccountReport getTransactions() { diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/__files/.gitkeep b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/__files/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-create-consent.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-create-consent.json new file mode 100644 index 000000000..22b142d91 --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-create-consent.json @@ -0,0 +1,51 @@ +{ + "id" : "d076f6c0-4d4e-4597-a242-19068f2b1e53", + "name" : "berlingroup_v1_consents", + "request" : { + "urlPattern" : ".*/v1/consents", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "TPP-Redirect-URI" : { + "matches" : ".+" + }, + "PSU-IP-Address" : { + "matches" : ".+" + }, + "Content-Type" : { + "equalTo" : "application/json; charset=UTF-8" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"access\":{\"accounts\":[{\"iban\":\"DE78240176185167050131\",\"currency\":\"EUR\"}],\"balances\":[{\"iban\":\"DE78240176185167050131\",\"currency\":\"EUR\"}],\"transactions\":[{\"iban\":\"DE78240176185167050131\",\"currency\":\"EUR\"}]},\"recurringIndicator\":true,\"validUntil\":\"${json-unit.regex}\\\\d{4}-[01]\\\\d-[0-3]\\\\d\",\"frequencyPerDay\":4,\"combinedServiceIndicator\":false}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\n \"consentStatus\" : \"received\",\n \"consentId\" : \"VALID_CONSENT_ID\",\n \"_links\" : {\n \"scaOAuth\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/.well-known/openid-configuration?authorizationId=22222222-2222-2222-2222-222222222222\"\n },\n \"scaStatus\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/consents/VALID_CONSENT_ID/authorisations/22222222-2222-2222-2222-222222222222\"\n },\n \"status\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/consents/VALID_CONSENT_ID/status\"\n },\n \"self\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/consents/VALID_CONSENT_ID\"\n }\n }\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Wed, 22 Sep 2021 12:55:30 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "a212ef4c-9c0e-4418-bc81-0771cb6937d9", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "ASPSP-SCA-Approach" : "REDIRECT", + "Location" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/consents/VALID_CONSENT_ID", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "d076f6c0-4d4e-4597-a242-19068f2b1e53", + "persistent" : true, + "insertionIndex" : 1 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-delete-consent.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-delete-consent.json new file mode 100644 index 000000000..dfb5f1714 --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-delete-consent.json @@ -0,0 +1,36 @@ +{ + "id" : "29a9603f-bd58-41b6-9eb4-4f206023cdc2", + "name" : "berlingroup_v1_consents_valid_consent_id", + "request" : { + "urlPattern" : ".*/v1/consents/.+", + "method" : "DELETE", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + } + }, + "response" : { + "status" : 204, + "headers" : { + "Server" : "nginx", + "Date" : "Wed, 22 Sep 2021 12:55:56 GMT", + "X-Request-ID" : "4b8bd6db-3eee-42a0-80f0-192dcd043d13", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "29a9603f-bd58-41b6-9eb4-4f206023cdc2", + "persistent" : true, + "insertionIndex" : 9 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-access-token.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-access-token.json new file mode 100644 index 000000000..84f872a76 --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-access-token.json @@ -0,0 +1,38 @@ +{ + "id" : "56215ea0-958a-4129-957f-e32ce65ff1ee", + "name" : "berlingroup_v1_token", + "request" : { + "urlPattern" : ".*/v1/token", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/x-www-form-urlencoded" + } + }, + "bodyPatterns" : [ { + "contains" : "code=AIS_VALID_CODE", + "caseInsensitive" : false + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"access_token\" : \"3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd\",\n \"token_type\" : \"Bearer\",\n \"expires_in\" : 3600,\n \"refresh_token\" : \"bb3d791cdd23405b8a3d96f0c679ce0c0025470afcd349008c3d2120a4ef602e657c99f191e2494797c080a334453f62\",\n \"scope\" : \"AIS:VALID_CONSENT_ID\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Wed, 22 Sep 2021 12:55:33 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "56215ea0-958a-4129-957f-e32ce65ff1ee", + "persistent" : true, + "insertionIndex" : 2 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-accounts.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-accounts.json new file mode 100644 index 000000000..59651d260 --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-accounts.json @@ -0,0 +1,41 @@ +{ + "id" : "ac324b7f-89d1-48ec-a84a-99edc46a5c0d", + "name" : "berlingroup_v1_accounts", + "request" : { + "urlPattern" : ".*/v1/accounts\\?withBalance=false", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "VALID_CONSENT_ID" + }, + "Authorization" : { + "equalTo" : "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"accounts\" : [ {\n \"resourceId\" : \"ACCOUNT_ID_4\",\n \"name\" : \"Personal account 4\",\n \"bic\" : \"COBADETESTX\",\n \"currency\" : \"EUR\",\n \"cashAccountType\" : \"CACC\",\n \"iban\" : \"DE12876125829604834872\",\n \"_links\" : {\n \"account\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID_4\"\n }\n },\n \"product\" : \"SAC\"\n }, {\n \"resourceId\" : \"ACCOUNT_ID_3\",\n \"name\" : \"Personal account 3\",\n \"bic\" : \"COBADETESTX\",\n \"currency\" : \"EUR\",\n \"cashAccountType\" : \"CACC\",\n \"iban\" : \"DE73370690218842698791\",\n \"_links\" : {\n \"account\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID_3\"\n }\n },\n \"product\" : \"SAC\"\n }, {\n \"resourceId\" : \"ACCOUNT_ID\",\n \"name\" : \"Main personal account\",\n \"bic\" : \"COBADETESTX\",\n \"currency\" : \"EUR\",\n \"cashAccountType\" : \"CACC\",\n \"iban\" : \"DE78240176185167050131\",\n \"_links\" : {\n \"account\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID\"\n },\n \"balances\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/balances\"\n },\n \"transactions\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/transactions\"\n }\n },\n \"product\" : \"SAC\"\n }, {\n \"resourceId\" : \"ACCOUNT_ID_2\",\n \"name\" : \"Personal account 2\",\n \"bic\" : \"COBADETESTX\",\n \"currency\" : \"EUR\",\n \"cashAccountType\" : \"CACC\",\n \"iban\" : \"DE84900290172902694978\",\n \"_links\" : {\n \"account\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID_2\"\n },\n \"balances\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID_2/balances\"\n }\n },\n \"product\" : \"SAC\"\n } ]\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Wed, 22 Sep 2021 12:55:38 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "8d6fded3-2764-4547-b706-0a2376312665", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "ac324b7f-89d1-48ec-a84a-99edc46a5c0d", + "persistent" : true, + "insertionIndex" : 3 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-balances.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-balances.json new file mode 100644 index 000000000..738cae0c8 --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-balances.json @@ -0,0 +1,41 @@ +{ + "id" : "f4a5b811-78c8-4f94-8581-69b98373daf6", + "name" : "berlingroup_v1_accounts_account_id_balances", + "request" : { + "urlPattern" : ".*/v1/accounts/.+/balances", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "VALID_CONSENT_ID" + }, + "Authorization" : { + "equalTo" : "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"account\" : {\n \"iban\" : \"DE78240176185167050131\",\n \"currency\" : \"EUR\"\n },\n \"balances\" : [ {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 150.02\n },\n \"lastChangeDateTime\" : \"2018-02-26T00:00:00\",\n \"referenceDate\" : \"2021-09-22\",\n \"balanceType\" : \"closingBooked\"\n }, {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 100.02\n },\n \"lastChangeDateTime\" : \"2021-09-22T00:00:00\",\n \"referenceDate\" : \"2018-02-27\",\n \"balanceType\" : \"expected\"\n }, {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 100.02\n },\n \"lastChangeDateTime\" : \"2021-09-22T00:00:00\",\n \"referenceDate\" : \"2021-09-22\",\n \"balanceType\" : \"interimAvailable\"\n }, {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 110\n },\n \"lastChangeDateTime\" : \"2021-09-22T00:00:00\",\n \"referenceDate\" : \"2018-02-01\",\n \"balanceType\" : \"openingBooked\"\n }, {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 13.37\n },\n \"lastChangeDateTime\" : \"2021-09-22T00:00:00\",\n \"referenceDate\" : \"2021-09-22\",\n \"balanceType\" : \"interimBooked\"\n }, {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 42\n },\n \"lastChangeDateTime\" : \"2021-09-22T00:00:00\",\n \"referenceDate\" : \"2021-09-22\",\n \"balanceType\" : \"forwardAvailable\"\n } ]\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Wed, 22 Sep 2021 12:55:44 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "c9062cc0-7d3e-4707-a8e4-9403b5cb5087", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "f4a5b811-78c8-4f94-8581-69b98373daf6", + "persistent" : true, + "insertionIndex" : 5 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-consent-authorisations.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-consent-authorisations.json new file mode 100644 index 000000000..dd978f331 --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-consent-authorisations.json @@ -0,0 +1,38 @@ +{ + "id" : "a4278774-2ef4-4aba-8424-690c248f6aa3", + "name" : "berlingroup_v1_consents_valid_consent_id_authorisations", + "request" : { + "urlPattern" : ".*/v1/consents/.+/authorisations", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"authorisationIds\" : [ \"11111111-1111-1111-1111-111111111111\", \"22222222-2222-2222-2222-222222222222\", \"99999999-9999-9999-9999-999999999999\" ]\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Wed, 22 Sep 2021 12:55:47 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "b817f98e-4408-4e51-9a9a-ce906a11670f", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "a4278774-2ef4-4aba-8424-690c248f6aa3", + "persistent" : true, + "insertionIndex" : 6 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-consent-status.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-consent-status.json new file mode 100644 index 000000000..2d0274258 --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-consent-status.json @@ -0,0 +1,38 @@ +{ + "id" : "4404f75e-3ca4-4a0b-90ed-c38c1aa60e94", + "name" : "berlingroup_v1_consents_valid_consent_id_status", + "request" : { + "urlPattern" : ".*/v1/consents/.+/status", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"consentStatus\" : \"valid\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Wed, 22 Sep 2021 12:55:53 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "b455817c-fb55-432c-800d-9269b903a824", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "4404f75e-3ca4-4a0b-90ed-c38c1aa60e94", + "persistent" : true, + "insertionIndex" : 8 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-sca-status.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-sca-status.json new file mode 100644 index 000000000..f4fc2da0b --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-sca-status.json @@ -0,0 +1,38 @@ +{ + "id" : "bcdd355a-2b36-4828-9288-f54e0f80e745", + "name" : "berlingroup_v1_consents_valid_consent_id_authorisations_11111111-1111-1111-1111-111111111111", + "request" : { + "urlPattern" : ".*/v1/consents/.+/authorisations/.+", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"scaStatus\" : \"finalised\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Wed, 22 Sep 2021 12:55:51 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "5caa34e1-20f1-4a78-b7f9-f70b521b23be", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "bcdd355a-2b36-4828-9288-f54e0f80e745", + "persistent" : true, + "insertionIndex" : 7 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-transactions.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-transactions.json new file mode 100644 index 000000000..2fc53babe --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/ais-get-transactions.json @@ -0,0 +1,41 @@ +{ + "id" : "eabb071a-77c3-49dd-b6dd-53d53249f9ba", + "name" : "berlingroup_v1_accounts_account_id_transactions", + "request" : { + "urlPattern" : ".*/v1/accounts/.+/transactions\\?dateFrom=.+&dateTo=.+&bookingStatus=booked&withBalance=true", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Consent-ID" : { + "equalTo" : "VALID_CONSENT_ID" + }, + "Authorization" : { + "equalTo" : "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"account\" : {\n \"iban\" : \"DE78240176185167050131\",\n \"currency\" : \"EUR\"\n },\n \"balances\" : [ {\n \"balanceAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : 150.02\n },\n \"lastChangeDateTime\" : \"2018-02-26T00:00:00Z\",\n \"referenceDate\" : \"2021-09-22\",\n \"balanceType\" : \"closingBooked\"\n } ],\n \"transactions\" : {\n \"booked\" : [ {\n \"transactionId\" : \"1234567\",\n \"bookingDate\" : \"2021-09-12\",\n \"valueDate\" : \"2021-09-12\",\n \"transactionAmount\" : {\n \"currency\" : \"EUR\",\n \"amount\" : -256.67\n },\n \"creditorName\" : \"John Miles\",\n \"creditorAccount\" : {\n \"iban\" : \"DE43533700240123456900\"\n },\n \"remittanceInformationUnstructured\" : \"Example 1\",\n \"_links\" : {\n \"transactionDetails\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/transactions/1234567\"\n }\n }\n } ],\n \"pending\" : [ ],\n \"_links\" : {\n \"first\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/transactions?dateFrom=1970-01-01&dateTo=2020-07-01&bookingStatus=BOOKED&withBalance=true&page=0\"\n },\n \"last\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/transactions?dateFrom=1970-01-01&dateTo=2020-07-01&bookingStatus=BOOKED&withBalance=true&page=0\"\n },\n \"account\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID\"\n },\n \"balances\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/balances\"\n },\n \"transactions\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/transactions\"\n }\n }\n }\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Wed, 22 Sep 2021 12:55:41 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "9992fdfe-12a1-45a6-91a3-be547f21a7e1", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "eabb071a-77c3-49dd-b6dd-53d53249f9ba", + "persistent" : true, + "insertionIndex" : 4 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-get-access-token.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-get-access-token.json new file mode 100644 index 000000000..ac8e5042f --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-get-access-token.json @@ -0,0 +1,38 @@ +{ + "id" : "521863bc-5fd5-4745-855d-3853ab5762d4", + "name" : "berlingroup_v1_token", + "request" : { + "urlPattern" : ".*/v1/token", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/x-www-form-urlencoded" + } + }, + "bodyPatterns" : [ { + "contains" : "code=PIS_VALID_CODE", + "caseInsensitive" : false + } ] + }, + "response" : { + "status" : 200, + "body" : "{\n \"access_token\" : \"30701ab20e5048c29a24f9c2920bddd9c94f6f13da1b49faa17ef0194dd89374e24bac76c3944379a85705f1b16fbec7\",\n \"token_type\" : \"Bearer\",\n \"expires_in\" : 300,\n \"refresh_token\" : \"7a8c0775bbb548bf8bcd3284227bcb3711846858b9b24963b20db41b9d1b0a12de1da30882ef496eae8d44e4cef5ea79\",\n \"scope\" : \"PIS:PAYMENT_ID_RCVD_SCT\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Thu, 23 Sep 2021 15:04:16 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "521863bc-5fd5-4745-855d-3853ab5762d4", + "persistent" : true, + "insertionIndex" : 11 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-payment-authorisations.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-payment-authorisations.json new file mode 100644 index 000000000..485b5c7b0 --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-payment-authorisations.json @@ -0,0 +1,38 @@ +{ + "id" : "47d8ce5e-e21e-498d-a312-3862d0a92aed", + "name" : "berlingroup_v1_payments_sepa-credit-transfers_payment_id_patc_sct_authorisations", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/authorisations", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 30701ab20e5048c29a24f9c2920bddd9c94f6f13da1b49faa17ef0194dd89374e24bac76c3944379a85705f1b16fbec7" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"authorisationIds\" : [ \"22222222-2222-2222-2222-222222222222\", \"11111111-1111-1111-1111-111111111111\", \"99999999-9999-9999-9999-999999999999\" ]\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Thu, 23 Sep 2021 15:04:25 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "bc4be3c5-597c-42dd-bc83-b9e3be8db58c", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "47d8ce5e-e21e-498d-a312-3862d0a92aed", + "persistent" : true, + "insertionIndex" : 13 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-payment-status.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-payment-status.json new file mode 100644 index 000000000..12eeadab0 --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-payment-status.json @@ -0,0 +1,38 @@ +{ + "id" : "c71056a0-d3e6-459f-9a69-4479e28f39cc", + "name" : "berlingroup_v1_payments_sepa-credit-transfers_payment_id_patc_sct_status", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/status", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 30701ab20e5048c29a24f9c2920bddd9c94f6f13da1b49faa17ef0194dd89374e24bac76c3944379a85705f1b16fbec7" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"transactionStatus\" : \"PATC\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Thu, 23 Sep 2021 15:04:21 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "4f2316d5-bd9d-4d94-ad4f-5449c8642b48", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "c71056a0-d3e6-459f-9a69-4479e28f39cc", + "persistent" : true, + "insertionIndex" : 12 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-sca-status.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-sca-status.json new file mode 100644 index 000000000..69e4caa9d --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-get-sca-status.json @@ -0,0 +1,38 @@ +{ + "id" : "784d9ab6-66a2-4a0c-9e17-18ab4abb750f", + "name" : "berlingroup_v1_payments_sepa-credit-transfers_payment_id_patc_sct_authorisations_22222222-2222-2222-2222-222222222222", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers/.+/authorisations/.+", + "method" : "GET", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "Authorization" : { + "equalTo" : "Bearer 30701ab20e5048c29a24f9c2920bddd9c94f6f13da1b49faa17ef0194dd89374e24bac76c3944379a85705f1b16fbec7" + } + } + }, + "response" : { + "status" : 200, + "body" : "{\n \"scaStatus\" : \"received\"\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Thu, 23 Sep 2021 15:04:29 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "89491cc2-3a7e-4b4b-b003-8986d4a2995e", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "784d9ab6-66a2-4a0c-9e17-18ab4abb750f", + "persistent" : true, + "insertionIndex" : 14 +} diff --git a/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-initiate-payment.json b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-initiate-payment.json new file mode 100644 index 000000000..197fb334d --- /dev/null +++ b/adapters/commerzbank-adapter/src/main/resources/commerzbank-adapter/mappings/pis-payments-sct-initiate-payment.json @@ -0,0 +1,52 @@ +{ + "id" : "c1f8295a-a9a0-4165-bbbc-7b99267a9827", + "name" : "berlingroup_v1_payments_sepa-credit-transfers", + "request" : { + "urlPattern" : ".*/v1/payments/sepa-credit-transfers", + "method" : "POST", + "headers" : { + "X-Request-ID" : { + "matches" : ".+" + }, + "TPP-Redirect-URI" : { + "matches" : ".+" + }, + "PSU-IP-Address" : { + "matches" : ".+" + }, + "Content-Type" : { + "equalTo" : "application/json; charset=UTF-8" + } + }, + "bodyPatterns" : [ { + "equalToJson" : "{\"endToEndIdentification\":\"SandboxTPPTest1\",\"debtorAccount\":{\"iban\":\"DE86999999990000001000\",\"currency\":\"EUR\"},\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"${json-unit.regex}-?[0-9]{1,14}(\\\\.[0-9]{1,3})?\"},\"creditorAccount\":{\"iban\":\"DE86999999990000001000\",\"currency\":\"EUR\"},\"creditorName\":\"${json-unit.any-string}\",\"remittanceInformationUnstructured\":\"just\"}", + "ignoreArrayOrder" : true, + "ignoreExtraElements" : true + } ] + }, + "response" : { + "status" : 201, + "body" : "{\n \"transactionStatus\" : \"RCVD\",\n \"paymentId\" : \"PAYMENT_ID_RCVD_SCT\",\n \"_links\" : {\n \"scaOAuth\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/.well-known/openid-configuration?authorizationId=11111111-1111-1111-1111-111111111111\"\n },\n \"scaStatus\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT/authorisations/11111111-1111-1111-1111-111111111111\"\n },\n \"self\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT\"\n },\n \"status\" : {\n \"href\" : \"https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT/status\"\n }\n }\n}", + "headers" : { + "Server" : "nginx", + "Date" : "Thu, 23 Sep 2021 15:04:12 GMT", + "Content-Type" : "application/json;charset=UTF-8", + "X-Request-ID" : "cf96ca3d-5235-481c-999f-77d5ad9cc0da", + "ASPSP-Notification-Support" : "true", + "Strict-Transport-Security" : [ "max-age=31536000 ; includeSubDomains", "max-age=15768000; includeSubDomains" ], + "ASPSP-SCA-Approach" : "REDIRECT", + "Location" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/payments/SEPA_CREDIT_TRANSFERS/PAYMENT_ID_RCVD_SCT", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "1; mode=block", + "Pragma" : "no-cache", + "Expires" : "0", + "X-Frame-Options" : "DENY", + "Cache-Control" : "no-store, no-cache", + "Content-Security-Policy" : "default-src 'self'; script-src 'self' 'unsafe-eval'; img-src 'self'; style-src 'self' 'unsafe-inline' https://*.googleapis.com; font-src 'self' https://*.gstatic.com; object-src 'none'", + "Referrer-Policy" : "strict-origin" + } + }, + "uuid" : "c1f8295a-a9a0-4165-bbbc-7b99267a9827", + "persistent" : true, + "insertionIndex" : 10 +} diff --git a/adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankAccountInformationServiceWireMockTest.java b/adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankAccountInformationServiceWireMockTest.java new file mode 100644 index 000000000..8bdd87bd2 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankAccountInformationServiceWireMockTest.java @@ -0,0 +1,122 @@ +package de.adorsys.xs2a.adapter.commerzbank; + +import de.adorsys.xs2a.adapter.api.AccountInformationService; +import de.adorsys.xs2a.adapter.api.RequestParams; +import de.adorsys.xs2a.adapter.api.model.*; +import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; +import de.adorsys.xs2a.adapter.test.TestRequestResponse; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static org.assertj.core.api.Assertions.assertThat; + +@ServiceWireMockTest(CommerzbankServiceProvider.class) +class CommerzbankAccountInformationServiceWireMockTest { + + private static final String CONSENT_ID = "VALID_CONSENT_ID"; + private static final String ACCOUNT_ID = "ACCOUNT_ID"; + private static final String AUTHORISATION_ID = "11111111-1111-1111-1111-111111111111"; + + private final AccountInformationService accountInformationService; + + CommerzbankAccountInformationServiceWireMockTest(AccountInformationService accountInformationService) { + this.accountInformationService = accountInformationService; + } + + @Test + void createConsent() throws IOException { + var requestResponse = new TestRequestResponse("ais/create-consent.json"); + + var response = accountInformationService.createConsent(requestResponse.requestHeaders(), + RequestParams.empty(), + requestResponse.requestBody(Consents.class)); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ConsentsResponse201.class)); + } + + @Test + void deleteConsent() throws IOException { + var requestResponse = new TestRequestResponse("ais/delete-consent.json"); + + var response = accountInformationService.deleteConsent(CONSENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getStatusCode()) + .isEqualTo(204); + } + + @Test + void getAccounts() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-accounts.json"); + + var response = accountInformationService.getAccountList(requestResponse.requestHeaders(), + requestResponse.requestParams()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(AccountList.class)); + } + + @Test + void getBalances() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-balances.json"); + + var response = accountInformationService.getBalances(ACCOUNT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ReadAccountBalanceResponse200.class)); + } + + @Test + void getConsentAuthorisation() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-consent-authorisations.json"); + + var response = accountInformationService.getConsentAuthorisation(CONSENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(Authorisations.class)); + } + + @Test + void getConsentStatus() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-consent-status.json"); + + var response = accountInformationService.getConsentStatus(CONSENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ConsentStatusResponse200.class)); + } + + @Test + void getScaStatus() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-sca-status.json"); + + var response = accountInformationService.getConsentScaStatus(CONSENT_ID, + AUTHORISATION_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ScaStatusResponse.class)); + } + + @Test + void getTransactions() throws IOException { + var requestResponse = new TestRequestResponse("ais/get-transactions.json"); + + var response = accountInformationService.getTransactionList(ACCOUNT_ID, + requestResponse.requestHeaders(), + requestResponse.requestParams()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(TransactionsResponse200Json.class)); + } +} diff --git a/adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankOauth2ServiceWireMockTest.java b/adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankOauth2ServiceWireMockTest.java new file mode 100644 index 000000000..055d9a9f7 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankOauth2ServiceWireMockTest.java @@ -0,0 +1,36 @@ +package de.adorsys.xs2a.adapter.commerzbank; + +import de.adorsys.xs2a.adapter.api.Oauth2Service; +import de.adorsys.xs2a.adapter.api.model.TokenResponse; +import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; +import de.adorsys.xs2a.adapter.test.TestRequestResponse; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.LinkedHashMap; + +import static org.assertj.core.api.Assertions.assertThat; + +@ServiceWireMockTest(CommerzbankServiceProvider.class) +class CommerzbankOauth2ServiceWireMockTest { + + private final Oauth2Service oauth2Service; + + CommerzbankOauth2ServiceWireMockTest(Oauth2Service oauth2Service) { + this.oauth2Service = oauth2Service; + } + + @Test + void getAccessToken() throws IOException { + var requestResponse = new TestRequestResponse("oauth2/get-access-token.json"); + + var modifiableParams = new LinkedHashMap<>(requestResponse.requestParams().toMap()); + + var actualToken = oauth2Service.getToken(requestResponse.requestHeaders().toMap(), + new Oauth2Service.Parameters(modifiableParams)); + + assertThat(actualToken) + .isNotNull() + .isEqualTo(requestResponse.responseBody(TokenResponse.class)); + } +} diff --git a/adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankPaymentInitiationServiceWireMockTest.java b/adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankPaymentInitiationServiceWireMockTest.java new file mode 100644 index 000000000..21a3bac88 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/java/de/adorsys/xs2a/adapter/commerzbank/CommerzbankPaymentInitiationServiceWireMockTest.java @@ -0,0 +1,84 @@ +package de.adorsys.xs2a.adapter.commerzbank; + +import de.adorsys.xs2a.adapter.api.PaymentInitiationService; +import de.adorsys.xs2a.adapter.api.RequestParams; +import de.adorsys.xs2a.adapter.api.model.*; +import de.adorsys.xs2a.adapter.test.ServiceWireMockTest; +import de.adorsys.xs2a.adapter.test.TestRequestResponse; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static de.adorsys.xs2a.adapter.api.model.PaymentProduct.SEPA_CREDIT_TRANSFERS; +import static de.adorsys.xs2a.adapter.api.model.PaymentService.PAYMENTS; +import static org.assertj.core.api.Assertions.assertThat; + +@ServiceWireMockTest(CommerzbankServiceProvider.class) +class CommerzbankPaymentInitiationServiceWireMockTest { + + private static final String PAYMENT_ID = "PAYMENT_ID_RCVD_SCT"; + private static final String AUTHORISATION_ID = "22222222-2222-2222-2222-222222222222"; + + private final PaymentInitiationService paymentInitiationService; + + CommerzbankPaymentInitiationServiceWireMockTest(PaymentInitiationService paymentInitiationService) { + this.paymentInitiationService = paymentInitiationService; + } + + @Test + void initiatePayment() throws IOException { + var requestResponse = new TestRequestResponse("pis/payments/sepa-credit-transfers/initiate-payment.json"); + + var response = paymentInitiationService.initiatePayment(PAYMENTS, + SEPA_CREDIT_TRANSFERS, + requestResponse.requestHeaders(), + RequestParams.empty(), + requestResponse.requestBody(PaymentInitiationJson.class)); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(PaymentInitationRequestResponse201.class)); + } + + @Test + void getPaymentStatus() throws IOException { + var requestResponse = new TestRequestResponse("pis/payments/sepa-credit-transfers/get-payment-status.json"); + + var response = paymentInitiationService.getPaymentInitiationStatus(PAYMENTS, + SEPA_CREDIT_TRANSFERS, + PAYMENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(PaymentInitiationStatusResponse200Json.class)); + } + + @Test + void getPaymentAuthorisations() throws IOException { + var requestResponse = new TestRequestResponse("pis/payments/sepa-credit-transfers/get-payment-authorisations.json"); + + var response = paymentInitiationService.getPaymentInitiationAuthorisation(PAYMENTS, + SEPA_CREDIT_TRANSFERS, + PAYMENT_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(Authorisations.class)); + } + + @Test + void getScaStatus() throws IOException { + var requestResponse = new TestRequestResponse("pis/payments/sepa-credit-transfers/get-sca-status.json"); + + var response = paymentInitiationService.getPaymentInitiationScaStatus(PAYMENTS, + SEPA_CREDIT_TRANSFERS, + PAYMENT_ID, + AUTHORISATION_ID, + requestResponse.requestHeaders(), + RequestParams.empty()); + + assertThat(response.getBody()) + .isEqualTo(requestResponse.responseBody(ScaStatusResponse.class)); + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/ais/create-consent.json b/adapters/commerzbank-adapter/src/test/resources/ais/create-consent.json new file mode 100644 index 000000000..91ff56779 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/ais/create-consent.json @@ -0,0 +1,57 @@ +{ + "request": { + "headers": { + "X-Request-ID": "b2323695-917b-43f1-abb2-0d247c1937f0", + "Content-Type": "application/json", + "PSU-IP-Address": "0.0.0.0", + "X-GTW-ASPSP-ID": "14a0c2ad-b9bf-4200-853a-a7abe541b714", + "TPP-Redirect-URI": "https://example.com" + }, + "body": { + "access": { + "balances": [ + { + "iban": "DE78240176185167050131", + "currency": "EUR" + } + ], + "transactions": [ + { + "iban": "DE78240176185167050131", + "currency": "EUR" + } + ], + "accounts": [ + { + "iban": "DE78240176185167050131", + "currency": "EUR" + } + ] + }, + "combinedServiceIndicator": "false", + "recurringIndicator": "true", + "validUntil": "2021-09-23", + "frequencyPerDay": "4" + } + }, + "response": { + "body": { + "consentStatus" : "received", + "consentId" : "VALID_CONSENT_ID", + "_links" : { + "scaOAuth" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/.well-known/openid-configuration?authorizationId=22222222-2222-2222-2222-222222222222" + }, + "scaStatus" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/consents/VALID_CONSENT_ID/authorisations/22222222-2222-2222-2222-222222222222" + }, + "status" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/consents/VALID_CONSENT_ID/status" + }, + "self" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/consents/VALID_CONSENT_ID" + } + } + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/ais/delete-consent.json b/adapters/commerzbank-adapter/src/test/resources/ais/delete-consent.json new file mode 100644 index 000000000..b477112b3 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/ais/delete-consent.json @@ -0,0 +1,8 @@ +{ + "request": { + "headers": { + "X-Request-ID": "68b4a545-ec12-47e4-9bd8-2984b4e4575f", + "Authorization": "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/ais/get-accounts.json b/adapters/commerzbank-adapter/src/test/resources/ais/get-accounts.json new file mode 100644 index 000000000..b14535738 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/ais/get-accounts.json @@ -0,0 +1,78 @@ +{ + "request": { + "headers": { + "X-Request-ID": "58fa1ca2-9adf-4555-b892-0eca1e4c5178", + "Consent-ID": "VALID_CONSENT_ID", + "Authorization": "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + }, + "params": { + "withBalance": "false" + } + }, + "response": { + "body": { + "accounts" : [ { + "resourceId" : "ACCOUNT_ID_4", + "name" : "Personal account 4", + "bic" : "COBADETESTX", + "currency" : "EUR", + "cashAccountType" : "CACC", + "iban" : "DE12876125829604834872", + "_links" : { + "account" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID_4" + } + }, + "product" : "SAC" + }, { + "resourceId" : "ACCOUNT_ID_3", + "name" : "Personal account 3", + "bic" : "COBADETESTX", + "currency" : "EUR", + "cashAccountType" : "CACC", + "iban" : "DE73370690218842698791", + "_links" : { + "account" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID_3" + } + }, + "product" : "SAC" + }, { + "resourceId" : "ACCOUNT_ID", + "name" : "Main personal account", + "bic" : "COBADETESTX", + "currency" : "EUR", + "cashAccountType" : "CACC", + "iban" : "DE78240176185167050131", + "_links" : { + "account" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID" + }, + "balances" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/balances" + }, + "transactions" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/transactions" + } + }, + "product" : "SAC" + }, { + "resourceId" : "ACCOUNT_ID_2", + "name" : "Personal account 2", + "bic" : "COBADETESTX", + "currency" : "EUR", + "cashAccountType" : "CACC", + "iban" : "DE84900290172902694978", + "_links" : { + "account" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID_2" + }, + "balances" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID_2/balances" + } + }, + "product" : "SAC" + } ] + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/ais/get-balances.json b/adapters/commerzbank-adapter/src/test/resources/ais/get-balances.json new file mode 100644 index 000000000..758ae5f96 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/ais/get-balances.json @@ -0,0 +1,66 @@ +{ + "request": { + "headers": { + "X-Request-ID": "991cc90c-5795-4dad-b802-b7315f192227", + "Consent-ID": "VALID_CONSENT_ID", + "Authorization": "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + }, + "response": { + "body": { + "account" : { + "iban" : "DE78240176185167050131", + "currency" : "EUR" + }, + "balances" : [ { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 150.02 + }, + "lastChangeDateTime" : "2018-02-26T00:00:00+01:00", + "referenceDate" : "2021-09-22", + "balanceType" : "closingBooked" + }, { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 100.02 + }, + "lastChangeDateTime" : "2021-09-22T00:00:00+02:00", + "referenceDate" : "2018-02-27", + "balanceType" : "expected" + }, { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 100.02 + }, + "lastChangeDateTime" : "2021-09-22T00:00:00+02:00", + "referenceDate" : "2021-09-22", + "balanceType" : "interimAvailable" + }, { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 110 + }, + "lastChangeDateTime" : "2021-09-22T00:00:00+02:00", + "referenceDate" : "2018-02-01", + "balanceType" : "openingBooked" + }, { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 13.37 + }, + "lastChangeDateTime" : "2021-09-22T00:00:00+02:00", + "referenceDate" : "2021-09-22", + "balanceType" : "interimBooked" + }, { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 42 + }, + "lastChangeDateTime" : "2021-09-22T00:00:00+02:00", + "referenceDate" : "2021-09-22", + "balanceType" : "forwardAvailable" + } ] + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/ais/get-consent-authorisations.json b/adapters/commerzbank-adapter/src/test/resources/ais/get-consent-authorisations.json new file mode 100644 index 000000000..ad65dc0a8 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/ais/get-consent-authorisations.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "991cc90c-5795-4dad-b802-b7315f192227", + "Authorization": "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + }, + "response": { + "body": { + "authorisationIds" : [ "11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222", "99999999-9999-9999-9999-999999999999" ] + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/ais/get-consent-status.json b/adapters/commerzbank-adapter/src/test/resources/ais/get-consent-status.json new file mode 100644 index 000000000..a62f89b3c --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/ais/get-consent-status.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "b3b9856e-1334-48c9-a1e4-8a1e44d3811d", + "Authorization": "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + }, + "response": { + "body": { + "consentStatus": "valid" + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/ais/get-sca-status.json b/adapters/commerzbank-adapter/src/test/resources/ais/get-sca-status.json new file mode 100644 index 000000000..16563ca93 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/ais/get-sca-status.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "a0448f06-780e-4875-8227-6dc3c1433fb7", + "Authorization": "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + } + }, + "response": { + "body": { + "scaStatus" : "finalised" + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/ais/get-transactions.json b/adapters/commerzbank-adapter/src/test/resources/ais/get-transactions.json new file mode 100644 index 000000000..6b8429d42 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/ais/get-transactions.json @@ -0,0 +1,71 @@ +{ + "request": { + "headers": { + "X-Request-ID": "c558ad1b-9e19-4fae-ac89-90a0f811f1ff", + "Consent-ID": "VALID_CONSENT_ID", + "Authorization": "Bearer 3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd" + }, + "params": { + "dateFrom": "2020-07-06", + "dateTo": "2020-08-06", + "bookingStatus": "booked", + "withBalance": "true" + } + }, + "response": { + "body": { + "account" : { + "iban" : "DE78240176185167050131", + "currency" : "EUR" + }, + "balances" : [ { + "balanceAmount" : { + "currency" : "EUR", + "amount" : 150.02 + }, + "lastChangeDateTime" : "2018-02-26T00:00:00+01:00", + "referenceDate" : "2021-09-22", + "balanceType" : "closingBooked" + } ], + "transactions" : { + "booked" : [ { + "transactionId" : "1234567", + "bookingDate" : "2021-09-12", + "valueDate" : "2021-09-12", + "transactionAmount" : { + "currency" : "EUR", + "amount" : -256.67 + }, + "creditorName" : "John Miles", + "creditorAccount" : { + "iban" : "DE43533700240123456900" + }, + "remittanceInformationUnstructured" : "Example 1", + "_links" : { + "transactionDetails" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/transactions/1234567" + } + } + } ], + "pending" : [ ], + "_links" : { + "first" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/transactions?dateFrom=1970-01-01&dateTo=2020-07-01&bookingStatus=BOOKED&withBalance=true&page=0" + }, + "last" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/transactions?dateFrom=1970-01-01&dateTo=2020-07-01&bookingStatus=BOOKED&withBalance=true&page=0" + }, + "account" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID" + }, + "balances" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/balances" + }, + "transactions" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/accounts/ACCOUNT_ID/transactions" + } + } + } + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/oauth2/get-access-token.json b/adapters/commerzbank-adapter/src/test/resources/oauth2/get-access-token.json new file mode 100644 index 000000000..9867b7392 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/oauth2/get-access-token.json @@ -0,0 +1,23 @@ +{ + "request": { + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": { + "code": "AIS_VALID_CODE", + "redirect_uri": "https://client.example.com/cb", + "grant_type": "authorization_code", + "client_id": "VALID_CLIENT_ID", + "code_verifier": "any_value" + } + }, + "response": { + "body": { + "scope": "AIS:VALID_CONSENT_ID", + "access_token": "3b4481e417194853903641fc7eb3c1ce0a01afee216d49b0a4eea408490c84733a43c5e2edce48a89a34b84c3df0d8bd", + "token_type": "Bearer", + "expires_in": 3600, + "refresh_token": "bb3d791cdd23405b8a3d96f0c679ce0c0025470afcd349008c3d2120a4ef602e657c99f191e2494797c080a334453f62" + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-authorisations.json b/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-authorisations.json new file mode 100644 index 000000000..d92a87c5a --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-authorisations.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "06b43276-40f6-4ba4-aa8a-50c8e7f27820", + "Authorization": "Bearer 30701ab20e5048c29a24f9c2920bddd9c94f6f13da1b49faa17ef0194dd89374e24bac76c3944379a85705f1b16fbec7" + } + }, + "response": { + "body": { + "authorisationIds" : [ "22222222-2222-2222-2222-222222222222", "11111111-1111-1111-1111-111111111111", "99999999-9999-9999-9999-999999999999" ] + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json b/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json new file mode 100644 index 000000000..07dcb0000 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-payment-status.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "06b43276-40f6-4ba4-aa8a-50c8e7f2781f", + "Authorization": "Bearer 30701ab20e5048c29a24f9c2920bddd9c94f6f13da1b49faa17ef0194dd89374e24bac76c3944379a85705f1b16fbec7" + } + }, + "response": { + "body": { + "transactionStatus": "PATC" + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json b/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json new file mode 100644 index 000000000..0bbce91c7 --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/get-sca-status.json @@ -0,0 +1,13 @@ +{ + "request": { + "headers": { + "X-Request-ID": "610cc155-67bf-48b0-91cb-2830321f1859", + "Authorization": "Bearer 30701ab20e5048c29a24f9c2920bddd9c94f6f13da1b49faa17ef0194dd89374e24bac76c3944379a85705f1b16fbec7" + } + }, + "response": { + "body": { + "scaStatus": "received" + } + } +} diff --git a/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json b/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json new file mode 100644 index 000000000..ef4712d0b --- /dev/null +++ b/adapters/commerzbank-adapter/src/test/resources/pis/payments/sepa-credit-transfers/initiate-payment.json @@ -0,0 +1,47 @@ +{ + "request": { + "headers": { + "X-Request-ID": "57f3a3cb-5699-4871-9bd5-aacddce09aa9", + "TPP-Redirect-URI": "https://example.com/redirect", + "PSU-IP-Address": "0.0.0.0", + "Content-Type": "application/json; charset=UTF-8" + }, + "body": { + "endToEndIdentification": "SandboxTPPTest1", + "debtorAccount": { + "iban": "DE86999999990000001000", + "currency": "EUR" + }, + "instructedAmount": { + "currency": "EUR", + "amount": "20.99" + }, + "creditorAccount": { + "iban": "DE86999999990000001000", + "currency": "EUR" + }, + "creditorName": "Anton Brueckner", + "remittanceInformationUnstructured": "just" + } + }, + "response": { + "body": { + "transactionStatus" : "RCVD", + "paymentId" : "PAYMENT_ID_RCVD_SCT", + "_links" : { + "scaOAuth" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/.well-known/openid-configuration?authorizationId=11111111-1111-1111-1111-111111111111" + }, + "scaStatus" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT/authorisations/11111111-1111-1111-1111-111111111111" + }, + "self" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT" + }, + "status" : { + "href" : "https://psd2.api-sandbox.commerzbank.com/berlingroup/v1/payments/sepa-credit-transfers/PAYMENT_ID_RCVD_SCT/status" + } + } + } + } +} diff --git a/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderAccountInformationServiceWireMockTest.java b/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderAccountInformationServiceWireMockTest.java index 22302836c..ea366254c 100644 --- a/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderAccountInformationServiceWireMockTest.java +++ b/adapters/santander-adapter/src/test/java/de/adorsys/xs2a/adapter/santander/SantanderAccountInformationServiceWireMockTest.java @@ -85,7 +85,7 @@ void getConsentStatus() throws IOException { @Test void deleteConsent() throws IOException { - TestRequestResponse requestResponse = new TestRequestResponse("ais/get-consent-status.json"); + TestRequestResponse requestResponse = new TestRequestResponse("ais/delete-consent.json"); Response response = accountInformationService.deleteConsent(CONSENT_ID, requestResponse.requestHeaders(), diff --git a/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-balances.json.json b/adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-balances.json similarity index 100% rename from adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-balances.json.json rename to adapters/unicredit-adapter/src/main/resources/unicredit-adapter/mappings/ais-get-balances.json diff --git a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc b/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc index db7027d40..c9bb696c3 100644 --- a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc +++ b/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc @@ -7,6 +7,8 @@ == Notices: - added WireMock stubs for `santander-adapter`. - added WireMock stubs for `unicredit-adapter`. +- added WireMock stubs for `commerzbank-adapter`. +- added WireMock stubs for `comdirect-adapter`. == Features: From 21f74ca7adc2c8ae263d66cf497ab92db1f18b44 Mon Sep 17 00:00:00 2001 From: berezkin88 Date: Mon, 4 Oct 2021 18:09:37 +0300 Subject: [PATCH 09/10] release 0.1.16 --- docs/release_notes/DRAFT_Release_notes_0.1.17.adoc | 11 +++++++++++ ...se_notes_0.1.16.adoc => Release_notes_0.1.16.adoc} | 8 +------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 docs/release_notes/DRAFT_Release_notes_0.1.17.adoc rename docs/release_notes/{DRAFT_Release_notes_0.1.16.adoc => Release_notes_0.1.16.adoc} (77%) diff --git a/docs/release_notes/DRAFT_Release_notes_0.1.17.adoc b/docs/release_notes/DRAFT_Release_notes_0.1.17.adoc new file mode 100644 index 000000000..5bb7c029d --- /dev/null +++ b/docs/release_notes/DRAFT_Release_notes_0.1.17.adoc @@ -0,0 +1,11 @@ += Draft Release notes for version 0.1.17 (release date: xx.xx.20xx) + +.Added banks +|=== +|=== + +== Notices: + +== Features: + +== Fixes: diff --git a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc b/docs/release_notes/Release_notes_0.1.16.adoc similarity index 77% rename from docs/release_notes/DRAFT_Release_notes_0.1.16.adoc rename to docs/release_notes/Release_notes_0.1.16.adoc index c9bb696c3..0aa74596e 100644 --- a/docs/release_notes/DRAFT_Release_notes_0.1.16.adoc +++ b/docs/release_notes/Release_notes_0.1.16.adoc @@ -1,8 +1,4 @@ -= Draft Release notes for version 0.1.16 (release date: xx.10.2021) - -.Added banks -|=== -|=== += Release notes for version 0.1.16 (release date: 04.10.2021) == Notices: - added WireMock stubs for `santander-adapter`. @@ -10,8 +6,6 @@ - added WireMock stubs for `commerzbank-adapter`. - added WireMock stubs for `comdirect-adapter`. -== Features: - == Fixes: - amended `release` script and rearranged steps. - adjusted WireMock stubs for `sparkasse-adapter` to work in both WireMock tests and in WireMock Mode. From 20b54d6eed954ae52470cc23b4f2c2e144dfcfdb Mon Sep 17 00:00:00 2001 From: berezkin88 Date: Mon, 4 Oct 2021 18:11:32 +0300 Subject: [PATCH 10/10] Prepare release 0.1.16 --- adapters/adorsys-adapter/pom.xml | 2 +- adapters/comdirect-adapter/pom.xml | 2 +- adapters/commerzbank-adapter/pom.xml | 2 +- adapters/consors-bank-adapter/pom.xml | 2 +- adapters/crealogix-adapter/pom.xml | 2 +- adapters/dab-bank-adapter/pom.xml | 2 +- adapters/deutsche-bank-adapter/pom.xml | 2 +- adapters/fiducia-adapter/pom.xml | 2 +- adapters/ing-adapter/pom.xml | 2 +- adapters/olb-adapter/pom.xml | 2 +- adapters/pom.xml | 2 +- adapters/santander-adapter/pom.xml | 2 +- adapters/sparda-bank-adapter/pom.xml | 2 +- adapters/sparkasse-adapter/pom.xml | 2 +- adapters/unicredit-adapter/pom.xml | 2 +- adapters/verlag-adapter/pom.xml | 2 +- pom.xml | 2 +- xs2a-adapter-app/pom.xml | 2 +- xs2a-adapter-aspsp-registry/pom.xml | 2 +- xs2a-adapter-generated-api/pom.xml | 2 +- xs2a-adapter-generated-rest-api/pom.xml | 2 +- xs2a-adapter-rest-api/pom.xml | 2 +- xs2a-adapter-rest-impl/pom.xml | 2 +- xs2a-adapter-rest2api-mapper/pom.xml | 2 +- xs2a-adapter-service-api/pom.xml | 2 +- xs2a-adapter-service-impl/pom.xml | 2 +- xs2a-adapter-service-loader/pom.xml | 2 +- xs2a-adapter-service-remote/pom.xml | 2 +- xs2a-adapter-test/pom.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/adapters/adorsys-adapter/pom.xml b/adapters/adorsys-adapter/pom.xml index a0790bcd3..ec514053f 100644 --- a/adapters/adorsys-adapter/pom.xml +++ b/adapters/adorsys-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/comdirect-adapter/pom.xml b/adapters/comdirect-adapter/pom.xml index d22829092..81f071867 100644 --- a/adapters/comdirect-adapter/pom.xml +++ b/adapters/comdirect-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/commerzbank-adapter/pom.xml b/adapters/commerzbank-adapter/pom.xml index 02e380f5e..547c91be0 100644 --- a/adapters/commerzbank-adapter/pom.xml +++ b/adapters/commerzbank-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/consors-bank-adapter/pom.xml b/adapters/consors-bank-adapter/pom.xml index 31bff64f5..69d75e981 100644 --- a/adapters/consors-bank-adapter/pom.xml +++ b/adapters/consors-bank-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/crealogix-adapter/pom.xml b/adapters/crealogix-adapter/pom.xml index 437251e33..9506a717c 100644 --- a/adapters/crealogix-adapter/pom.xml +++ b/adapters/crealogix-adapter/pom.xml @@ -5,7 +5,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/dab-bank-adapter/pom.xml b/adapters/dab-bank-adapter/pom.xml index 171c1cf7f..f24b1205e 100644 --- a/adapters/dab-bank-adapter/pom.xml +++ b/adapters/dab-bank-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/deutsche-bank-adapter/pom.xml b/adapters/deutsche-bank-adapter/pom.xml index f5ab0afdc..1fe91ae22 100644 --- a/adapters/deutsche-bank-adapter/pom.xml +++ b/adapters/deutsche-bank-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/fiducia-adapter/pom.xml b/adapters/fiducia-adapter/pom.xml index 09a4c1cf1..f09e5946e 100644 --- a/adapters/fiducia-adapter/pom.xml +++ b/adapters/fiducia-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/ing-adapter/pom.xml b/adapters/ing-adapter/pom.xml index cfff94bcd..31ae08419 100644 --- a/adapters/ing-adapter/pom.xml +++ b/adapters/ing-adapter/pom.xml @@ -8,7 +8,7 @@ xs2a-adapter de.adorsys.xs2a.adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/olb-adapter/pom.xml b/adapters/olb-adapter/pom.xml index 35e222ed8..33bc1a92b 100644 --- a/adapters/olb-adapter/pom.xml +++ b/adapters/olb-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/pom.xml b/adapters/pom.xml index 69b438d9d..cdb558fb5 100644 --- a/adapters/pom.xml +++ b/adapters/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/adapters/santander-adapter/pom.xml b/adapters/santander-adapter/pom.xml index 5a2c83f4c..123199ec3 100644 --- a/adapters/santander-adapter/pom.xml +++ b/adapters/santander-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/sparda-bank-adapter/pom.xml b/adapters/sparda-bank-adapter/pom.xml index c9705fe1f..ab2e8d736 100644 --- a/adapters/sparda-bank-adapter/pom.xml +++ b/adapters/sparda-bank-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/sparkasse-adapter/pom.xml b/adapters/sparkasse-adapter/pom.xml index 594e9f350..e291eea33 100644 --- a/adapters/sparkasse-adapter/pom.xml +++ b/adapters/sparkasse-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/unicredit-adapter/pom.xml b/adapters/unicredit-adapter/pom.xml index 82fb61753..54d30c31e 100644 --- a/adapters/unicredit-adapter/pom.xml +++ b/adapters/unicredit-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/adapters/verlag-adapter/pom.xml b/adapters/verlag-adapter/pom.xml index 80afc0854..d6bb5bbc5 100644 --- a/adapters/verlag-adapter/pom.xml +++ b/adapters/verlag-adapter/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 ../.. diff --git a/pom.xml b/pom.xml index 93f0c6b17..3ee0ce3f9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 pom xs2a-adapter diff --git a/xs2a-adapter-app/pom.xml b/xs2a-adapter-app/pom.xml index eb061f857..704b2e9ae 100644 --- a/xs2a-adapter-app/pom.xml +++ b/xs2a-adapter-app/pom.xml @@ -14,7 +14,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/xs2a-adapter-aspsp-registry/pom.xml b/xs2a-adapter-aspsp-registry/pom.xml index 51a308f05..c4eca4770 100644 --- a/xs2a-adapter-aspsp-registry/pom.xml +++ b/xs2a-adapter-aspsp-registry/pom.xml @@ -8,7 +8,7 @@ xs2a-adapter de.adorsys.xs2a.adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/xs2a-adapter-generated-api/pom.xml b/xs2a-adapter-generated-api/pom.xml index 4997d90bd..8ffc8f891 100644 --- a/xs2a-adapter-generated-api/pom.xml +++ b/xs2a-adapter-generated-api/pom.xml @@ -6,7 +6,7 @@ xs2a-adapter de.adorsys.xs2a.adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/xs2a-adapter-generated-rest-api/pom.xml b/xs2a-adapter-generated-rest-api/pom.xml index 6d7259715..e448cd992 100644 --- a/xs2a-adapter-generated-rest-api/pom.xml +++ b/xs2a-adapter-generated-rest-api/pom.xml @@ -8,7 +8,7 @@ xs2a-adapter de.adorsys.xs2a.adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/xs2a-adapter-rest-api/pom.xml b/xs2a-adapter-rest-api/pom.xml index 981093f84..b73ee1d00 100644 --- a/xs2a-adapter-rest-api/pom.xml +++ b/xs2a-adapter-rest-api/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/xs2a-adapter-rest-impl/pom.xml b/xs2a-adapter-rest-impl/pom.xml index 7bb53e619..829ed85f5 100644 --- a/xs2a-adapter-rest-impl/pom.xml +++ b/xs2a-adapter-rest-impl/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/xs2a-adapter-rest2api-mapper/pom.xml b/xs2a-adapter-rest2api-mapper/pom.xml index 48b115e9d..a235d8b1f 100644 --- a/xs2a-adapter-rest2api-mapper/pom.xml +++ b/xs2a-adapter-rest2api-mapper/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/xs2a-adapter-service-api/pom.xml b/xs2a-adapter-service-api/pom.xml index ebdada5bb..df5b27c88 100644 --- a/xs2a-adapter-service-api/pom.xml +++ b/xs2a-adapter-service-api/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/xs2a-adapter-service-impl/pom.xml b/xs2a-adapter-service-impl/pom.xml index 668fed6f0..7e3c119dc 100644 --- a/xs2a-adapter-service-impl/pom.xml +++ b/xs2a-adapter-service-impl/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/xs2a-adapter-service-loader/pom.xml b/xs2a-adapter-service-loader/pom.xml index c82e818cd..e78baed35 100644 --- a/xs2a-adapter-service-loader/pom.xml +++ b/xs2a-adapter-service-loader/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/xs2a-adapter-service-remote/pom.xml b/xs2a-adapter-service-remote/pom.xml index 402030094..fa9886879 100644 --- a/xs2a-adapter-service-remote/pom.xml +++ b/xs2a-adapter-service-remote/pom.xml @@ -6,7 +6,7 @@ de.adorsys.xs2a.adapter xs2a-adapter - 0.1.16-SNAPSHOT + 0.1.16 .. diff --git a/xs2a-adapter-test/pom.xml b/xs2a-adapter-test/pom.xml index 41ad0c497..2ba7d0cc0 100644 --- a/xs2a-adapter-test/pom.xml +++ b/xs2a-adapter-test/pom.xml @@ -6,7 +6,7 @@ xs2a-adapter de.adorsys.xs2a.adapter - 0.1.16-SNAPSHOT + 0.1.16 xs2a-adapter-test