diff --git a/.github/workflows/scan_dependencies.yml b/.github/workflows/scan_dependencies.yml new file mode 100644 index 0000000000..34b32008bd --- /dev/null +++ b/.github/workflows/scan_dependencies.yml @@ -0,0 +1,40 @@ +name: Scan Maven Dependencies + +on: + push: + paths: + - '**/pom.xml' + - '.github/workflows/scan_dependencies.yml' + pull_request: + paths: + - '**/pom.xml' + workflow_dispatch: + +jobs: + scan-pom-vulnerabilities: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 25 + uses: actions/setup-java@v3 + with: + java-version: '25' + distribution: 'temurin' + cache: 'maven' + + - name: Pre-download Maven dependencies + run: mvn dependency:go-offline -B + continue-on-error: true # Even if go-offline fails partially, the cache is populated enough for Trivy + + - name: Run Trivy vulnerability scanner on filesystem + uses: aquasecurity/trivy-action@master + with: + scan-type: 'fs' # Scan local filesystem instead of docker image + scan-ref: '.' # Scan the entire repository for pom.xml files + format: 'table' # Output results in table format + exit-code: '0' # Do not fail the workflow, just log vulnerabilities + ignore-unfixed: true # Ignore vulnerabilities without a fix + vuln-type: 'library' # Scan third-party libraries only + severity: 'CRITICAL,HIGH' # Focus on critical and high severity vulnerabilities diff --git a/development/docker/docker-compose.override.yml b/development/docker/docker-compose.override.yml index 5c2291bf36..403f0535ea 100644 --- a/development/docker/docker-compose.override.yml +++ b/development/docker/docker-compose.override.yml @@ -1,5 +1,3 @@ -version: "3.8" - services: obp-api: volumes: diff --git a/development/docker/docker-compose.yml b/development/docker/docker-compose.yml index 5b92c2c693..0badd12e22 100644 --- a/development/docker/docker-compose.yml +++ b/development/docker/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.8" - services: redis: container_name: obp-api-redis @@ -23,6 +21,8 @@ services: # Set Lift props location to find your props files - props.resource.dir=/app/props/ - JAVA_OPTS=-Drun.mode=production -Dprops.resource.dir=/app/props/ + - OBP_BIND_ADDRESS=0.0.0.0 + - OBP_DEV_PORT=8080 # Override Redis settings via environment variables (OBP-API system) # cache.redis.url -> OBP_CACHE_REDIS_URL # cache.redis.port -> OBP_CACHE_REDIS_PORT @@ -30,23 +30,35 @@ services: - OBP_CACHE_REDIS_PORT=6379 # Override database URL via environment variable (OBP-API system) # db.url -> OBP_DB_URL - - OBP_DB_URL=${OBP_DB_URL:-jdbc:postgresql://host.docker.internal:5432/obp_mapped?user=obp&password=f} + - OBP_DB_URL=${OBP_DB_URL:-jdbc:postgresql://postgres:5432/obp_mapped?user=obp&password=f} volumes: # Mount the props directory so the container uses your local props files - ../../obp-api/src/main/resources/props:/app/props - extra_hosts: - # Connect to local Postgres on the host - # In your config file: - # db.url=jdbc:postgresql://host.docker.internal:5432/YOUR_DB?user=YOUR_DB_USER&password=YOUR_DB_PASSWORD - - "host.docker.internal:host-gateway" depends_on: - redis + - postgres + networks: + - obp-network + + postgres: + container_name: obp-api-db + image: postgres:15-alpine + environment: + POSTGRES_DB: obp_mapped + POSTGRES_USER: obp + POSTGRES_PASSWORD: f + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data networks: - obp-network volumes: redis_data: name: obp-api-redis-data + postgres_data: + name: obp-api-db-data networks: obp-network: diff --git a/development/docker/entrypoint.sh b/development/docker/entrypoint.sh index dc20d7dddf..1797be5b7b 100644 --- a/development/docker/entrypoint.sh +++ b/development/docker/entrypoint.sh @@ -1,9 +1,9 @@ #!/bin/bash set -e -export MAVEN_OPTS="-Xss128m \ +export JAVA_OPTS="-Xss128m \ --add-opens=java.base/java.util.jar=ALL-UNNAMED \ --add-opens=java.base/java.lang=ALL-UNNAMED \ --add-opens=java.base/java.lang.reflect=ALL-UNNAMED" -exec java $MAVEN_OPTS -jar /app/obp-api.jar +exec java $JAVA_OPTS -jar /app/obp-api/target/obp-api.jar diff --git a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerJSONFactory.scala b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerJSONFactory.scala index cc7b83b7ae..e8abcfc360 100644 --- a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerJSONFactory.scala +++ b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerJSONFactory.scala @@ -23,6 +23,7 @@ import code.api.ResourceDocs1_4_0.SwaggerDefinitionsJSON.{NotSupportedYet, notSu //import code.api.STET.v1_4.OBP_STET_1_4 import code.api.UKOpenBanking.v2_0_0.OBP_UKOpenBanking_200 import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310 +import code.api.UKOpenBanking.v4_0_1.OBP_UKOpenBanking_401 import code.api.berlin.group.v1_3.{OBP_BERLIN_GROUP_1_3, OBP_BERLIN_GROUP_1_3_Alias} import code.api.v1_4_0.JSONFactory1_4_0 import com.openbankproject.commons.model.JsonFieldReName @@ -336,6 +337,7 @@ object SwaggerJSONFactory extends MdcLoggable { // Commented out: STET / Polish / AUOpenBanking Lift endpoints removed if (apiVersion == OBP_UKOpenBanking_200.apiVersion || OBP_UKOpenBanking_310.apiVersion == OBP_UKOpenBanking_200.apiVersion + || apiVersion == OBP_UKOpenBanking_401.apiVersion ) s"custom, proprietary license: personal use is allowed and free, modifications or re-publishing is not allowed" else if (apiVersion == OBP_BERLIN_GROUP_1_3.apiVersion || apiVersion == OBP_BERLIN_GROUP_1_3_Alias.apiVersion diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401.scala new file mode 100644 index 0000000000..4fe1f01288 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401.scala @@ -0,0 +1,50 @@ +package code.api.UKOpenBanking.v4_0_1 + +import cats.data.{Kleisli, OptionT} +import cats.effect._ +import code.api.util.APIUtil.ResourceDoc +import code.api.util.http4s.ResourceDocMiddleware +import code.util.Helper.MdcLoggable +import com.openbankproject.commons.util.ApiVersion +import org.http4s._ + +import scala.collection.mutable.ArrayBuffer + +/** + * UK Open Banking Read/Write v4.0.1 — http4s aggregator (mirror of Http4sUKOBv310). + * + * Collects resource docs and routes from every per-sub-API endpoint object, + * wraps the combined routes once with ResourceDocMiddleware (which builds the + * CallContext via anonymousAccess for these non-/obp paths), and exposes + * `wrappedRoutes` for wiring into Http4sApp.baseServices. + * + * Coverage: all 6 v4.0.1 sub-APIs (account-info / payment-initiation / + * confirmation-funds / event-notifications / events / vrp), ~89 endpoints. + * Spec-faithful scaffold — routes return synthesized OpenAPI example JSON; deepen + * to real OBP connector logic per endpoint later. + */ +object Http4sUKOBv401 extends MdcLoggable { + + type HttpF[A] = OptionT[IO, A] + + val implementedInApiVersion: ApiVersion = ApiVersion.ukOpenBankingV401 + + val resourceDocs: ArrayBuffer[ResourceDoc] = + Http4sUKOBv401AccountInfo.resourceDocs ++ + Http4sUKOBv401PaymentInitiation.resourceDocs ++ + Http4sUKOBv401ConfirmationFunds.resourceDocs ++ + Http4sUKOBv401EventNotifications.resourceDocs ++ + Http4sUKOBv401Events.resourceDocs ++ + Http4sUKOBv401Vrp.resourceDocs + + val allRoutes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + Http4sUKOBv401AccountInfo.routes(req) + .orElse(Http4sUKOBv401PaymentInitiation.routes(req)) + .orElse(Http4sUKOBv401ConfirmationFunds.routes(req)) + .orElse(Http4sUKOBv401EventNotifications.routes(req)) + .orElse(Http4sUKOBv401Events.routes(req)) + .orElse(Http4sUKOBv401Vrp.routes(req)) + } + + val wrappedRoutes: HttpRoutes[IO] = ResourceDocMiddleware.apply(resourceDocs)(allRoutes) +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401AccountInfo.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401AccountInfo.scala new file mode 100644 index 0000000000..cdbe5507c6 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401AccountInfo.scala @@ -0,0 +1,3333 @@ +package code.api.UKOpenBanking.v4_0_1 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc} +import code.api.util.ApiTag +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import com.openbankproject.commons.util.JsonAliases +import org.json4s.{Formats, JObject} +import org.http4s._ +import org.http4s.dsl.io._ +import com.openbankproject.commons.ExecutionContext.Implicits.global + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +// AUTO-GENERATED from UK Open Banking read-write-api-specs v4.0.1 (AccountInfo). +// Spec-faithful scaffold: routes return synthesized example JSON from the +// OpenAPI schemas (the specs carry no examples). Deepen to real OBP +// connector logic per endpoint later, mirroring v3_1_0. +object Http4sUKOBv401AccountInfo extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV401 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): JObject = JsonAliases.parse(s).asInstanceOf[JObject] + val ukV401Prefix = Root / ApiVersion.ukOpenBankingV401.urlPrefix / ApiVersion.ukOpenBankingV401.apiShortVersion + + private val EXREQ_createAccountAccessConsents: String = """{ + "Data": { + "Permissions": [ + "ReadAccountsBasic" + ], + "ExpirationDateTime": "2020-01-01T00:00:00+00:00", + "TransactionFromDateTime": "2020-01-01T00:00:00+00:00", + "TransactionToDateTime": "2020-01-01T00:00:00+00:00" + }, + "Risk": {} +}""" + private val EX_createAccountAccessConsents: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2024-05-29T00:00:00Z", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "U004", + "StatusReasonDescription": "Permissions field is missing", + "Path": "Data.Permissions" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "Permissions": [ + "ReadAccountsBasic" + ], + "ExpirationDateTime": "2020-01-01T00:00:00+00:00", + "TransactionFromDateTime": "2020-01-01T00:00:00+00:00", + "TransactionToDateTime": "2020-01-01T00:00:00+00:00" + }, + "Risk": {}, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createAccountAccessConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "aisp" / "account-access-consents" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createAccountAccessConsents))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createAccountAccessConsents), + "POST", + "/aisp/account-access-consents", + "Create an Account Access Consent", + """Enables an AISP to ask an ASPSP to create a new account-access-consent resource, by sending a copy of the consent to the ASPSP.""", + parseBody(EXREQ_createAccountAccessConsents), + parseBody(EX_createAccountAccessConsents), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Account Access Consents") :: Nil, + http4sPartialFunction = Some(createAccountAccessConsents) + ) + + private val EX_getAccountAccessConsentsConsentId: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2024-05-29T00:00:00Z", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "U004", + "StatusReasonDescription": "Permissions field is missing", + "Path": "Data.Permissions" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "Permissions": [ + "ReadAccountsBasic" + ], + "ExpirationDateTime": "2020-01-01T00:00:00+00:00", + "TransactionFromDateTime": "2020-01-01T00:00:00+00:00", + "TransactionToDateTime": "2020-01-01T00:00:00+00:00" + }, + "Risk": {}, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountAccessConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "account-access-consents" / consentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountAccessConsentsConsentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountAccessConsentsConsentId), + "GET", + "/aisp/account-access-consents/CONSENT_ID", + "Get an Account Access Consent", + """Enables an AISP to retrieve the status of an AIS consent.""", + EmptyBody, + parseBody(EX_getAccountAccessConsentsConsentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Account Access Consents") :: Nil, + http4sPartialFunction = Some(getAccountAccessConsentsConsentId) + ) + + private val EX_deleteAccountAccessConsentsConsentId: String = """{}""" + lazy val deleteAccountAccessConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ DELETE -> `ukV401Prefix` / "aisp" / "account-access-consents" / consentId => + EndpointHelpers.executeDelete(req) { cc => Future.successful(()) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(deleteAccountAccessConsentsConsentId), + "DELETE", + "/aisp/account-access-consents/CONSENT_ID", + "Delete an Account Access Consent", + """Enables an AISP to inform the ASPSP that the PSU has revoked their consent.""", + EmptyBody, + parseBody(EX_deleteAccountAccessConsentsConsentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Account Access Consents") :: Nil, + http4sPartialFunction = Some(deleteAccountAccessConsentsConsentId) + ) + + private val EX_getAccounts: String = """{ + "Data": { + "Account": [ + { + "AccountId": "22289", + "Status": "Enabled", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "Currency": "string", + "AccountCategory": "Business", + "AccountTypeCode": "CACC", + "Description": "string", + "Nickname": "string", + "OpeningDate": "2020-01-01T00:00:00+00:00", + "MaturityDate": "2020-01-01T00:00:00+00:00", + "SwitchStatus": "string", + "Account": [ + { + "SchemeName": "string", + "Identification": "80200112344562", + "Name": "Jane Smith", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SecondaryIdentification": "87562298675897" + } + ], + "StatementFrequencyAndFormat": [ + { + "Frequency": "YEAR", + "CommunicationMethod": "EMAL", + "Format": "DPDF", + "DeliveryAddress": { + "AddressType": {}, + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": {}, + "BuildingNumber": {}, + "BuildingName": {}, + "Floor": {}, + "UnitNumber": {}, + "Room": {}, + "PostBox": {}, + "TownLocationName": {}, + "DistrictName": {}, + "CareOf": {}, + "PostCode": {}, + "TownName": {}, + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [] + } + } + ], + "Servicer": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "80200112344562", + "Name": "Agent Name" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccounts: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccounts)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccounts), + "GET", + "/aisp/accounts", + "Get Accounts", + """Enables an AISP to retrieve a list of a PSU's accounts and information about those account(s) that the PSU has consented to.""", + EmptyBody, + parseBody(EX_getAccounts), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Accounts") :: Nil, + http4sPartialFunction = Some(getAccounts) + ) + + private val EX_getAccountsAccountId: String = """{ + "Data": { + "Account": [ + { + "AccountId": "22289", + "Status": "Enabled", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "Currency": "string", + "AccountCategory": "Business", + "AccountTypeCode": "CACC", + "Description": "string", + "Nickname": "string", + "OpeningDate": "2020-01-01T00:00:00+00:00", + "MaturityDate": "2020-01-01T00:00:00+00:00", + "SwitchStatus": "string", + "Account": [ + { + "SchemeName": "string", + "Identification": "80200112344562", + "Name": "Jane Smith", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SecondaryIdentification": "87562298675897" + } + ], + "StatementFrequencyAndFormat": [ + { + "Frequency": "YEAR", + "CommunicationMethod": "EMAL", + "Format": "DPDF", + "DeliveryAddress": { + "AddressType": {}, + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": {}, + "BuildingNumber": {}, + "BuildingName": {}, + "Floor": {}, + "UnitNumber": {}, + "Room": {}, + "PostBox": {}, + "TownLocationName": {}, + "DistrictName": {}, + "CareOf": {}, + "PostCode": {}, + "TownName": {}, + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [] + } + } + ], + "Servicer": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "80200112344562", + "Name": "Agent Name" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountId), + "GET", + "/aisp/accounts/ACCOUNT_ID", + "Get an Account by AccountId", + """Enables an AISP to retrieve information about a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Accounts") :: Nil, + http4sPartialFunction = Some(getAccountsAccountId) + ) + + private val EX_getAccountsAccountIdBalances: String = """{ + "Data": { + "Balance": [ + { + "AccountId": "22289", + "CreditDebitIndicator": "Credit", + "Type": "CLAV", + "DateTime": "2020-01-01T00:00:00+00:00", + "Amount": { + "Amount": "1209.06", + "Currency": "GBP", + "SubType": "BCUR" + }, + "CreditLine": [ + { + "Included": true, + "Type": "Available", + "Amount": { + "Amount": {}, + "Currency": {} + } + } + ], + "LocalAmount": { + "Amount": "1209.06", + "Currency": "GBP", + "SubType": "BCUR" + } + } + ], + "TotalValue": { + "Amount": "1209.06", + "Currency": "GBP" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdBalances: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "balances" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdBalances)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdBalances), + "GET", + "/aisp/accounts/ACCOUNT_ID/balances", + "Get Balances for an AccountId", + """Enables an AISP to retrieve account balance information for a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdBalances), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Balances") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdBalances) + ) + + private val EX_getAccountsAccountIdBeneficiaries: String = """{ + "Data": { + "Beneficiary": [ + { + "AccountId": "22289", + "BeneficiaryId": "Ben1", + "BeneficiaryType": "Ordinary", + "Reference": "Towbar Club", + "SupplementaryData": {}, + "CreditorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "80200112344562", + "Name": "Agent Name", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "LEI": "IZ9Q00LZEVUKWCQY6X15" + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "80200112344562", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdBeneficiaries: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "beneficiaries" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdBeneficiaries)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdBeneficiaries), + "GET", + "/aisp/accounts/ACCOUNT_ID/beneficiaries", + "Get Beneficiaries for an AccountId", + """Enables an AISP to retrieve Beneficiary information for a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdBeneficiaries), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Beneficiaries") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdBeneficiaries) + ) + + private val EX_getAccountsAccountIdDirectDebits: String = """{ + "Data": { + "DirectDebit": [ + { + "AccountId": "22289", + "DirectDebitId": "string", + "DirectDebitStatusCode": "ACTV", + "MandateRelatedInformation": { + "MandateIdentification": "Golfers", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2024-04-25T12:46:49.425Z", + "RecurringPaymentDateTime": "2024-04-25T12:46:49.425Z", + "FinalPaymentDateTime": "2024-04-25T12:46:49.425Z", + "Frequency": { + "Type": "MNTH", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "To pay monthly membership" + }, + "Name": "string", + "PreviousPaymentDateTime": "2020-01-01T00:00:00+00:00", + "PreviousPaymentAmount": { + "Amount": "1209.06", + "Currency": "GBP" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdDirectDebits: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "direct-debits" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdDirectDebits)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdDirectDebits), + "GET", + "/aisp/accounts/ACCOUNT_ID/direct-debits", + "Get Direct Debits for an AccountId", + """Enables an AISP to retrieve Direct Debit information for a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdDirectDebits), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Direct Debits") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdDirectDebits) + ) + + private val EX_getAccountsAccountIdOffers: String = """{ + "Data": { + "Offer": [ + { + "AccountId": "22289", + "OfferId": "Offer1", + "OfferType": "LimitIncrease", + "Description": "Credit limit increase for the account up to £10000.00", + "StartDateTime": "2024-05-29T00:00:00Z", + "EndDateTime": "2024-06-29T00:00:00Z", + "Rate": "100.00", + "Value": 10, + "Term": "Starting first of the month and ending at the end of year", + "URL": "http://modelbank.com/offer/offer1", + "Amount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "Fee": { + "Amount": "1209.06", + "Currency": "GBP" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdOffers: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "offers" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdOffers)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdOffers), + "GET", + "/aisp/accounts/ACCOUNT_ID/offers", + "Get Offers for an AccountId", + """Enables an AISP to retrieve any offer information for a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdOffers), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Offers") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdOffers) + ) + + private val EX_getAccountsAccountIdParties: String = """{ + "Data": { + "Party": [ + { + "PartyId": "PXSIF023", + "PartyNumber": "20202002", + "PartyType": "Joint", + "Name": "Mx Jane Smith", + "FullLegalName": "Jane Smith", + "LegalStructure": "UK.OBIE.Individual", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "BeneficialOwnership": true, + "AccountRole": "string", + "EmailAddress": "d.user@semiotec.co.jp", + "Phone": "+44-2079460000", + "Mobile": "+44-7700900000", + "Relationships": { + "Account": { + "Related": "https://api.alphabank.com/open-banking/v4.0/aisp/accounts/89019", + "Id": "89019" + } + }, + "Address": [ + { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + ] + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdParties: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "parties" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdParties)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdParties), + "GET", + "/aisp/accounts/ACCOUNT_ID/parties", + "Get Parties for an AccountId", + """Enables an AISP to retrieve details about the PSU account-holder(s)/operator(s).""", + EmptyBody, + parseBody(EX_getAccountsAccountIdParties), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Parties") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdParties) + ) + + private val EX_getAccountsAccountIdParty: String = """{ + "Data": { + "Party": { + "PartyId": "PXSIF023", + "PartyNumber": "20202002", + "PartyType": "Joint", + "Name": "Mx Jane Smith", + "FullLegalName": "Jane Smith", + "LegalStructure": "UK.OBIE.Individual", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "BeneficialOwnership": true, + "AccountRole": "string", + "EmailAddress": "d.user@semiotec.co.jp", + "Phone": "+44-2079460000", + "Mobile": "+44-7700900000", + "Relationships": { + "Account": { + "Related": "https://api.alphabank.com/open-banking/v4.0/aisp/accounts/89019", + "Id": "89019" + } + }, + "Address": [ + { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdParty: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "party" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdParty)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdParty), + "GET", + "/aisp/accounts/ACCOUNT_ID/party", + "Get Party for an AccountId", + """Enables an AISP to retrieve details about the party that gave permission to the AISP to view a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdParty), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Parties") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdParty) + ) + + private val EX_getAccountsAccountIdProduct: String = """{ + "Data": { + "Product": [ + { + "ProductName": "321 Product", + "ProductId": "51B", + "AccountId": "22289", + "SecondaryProductId": "CA78", + "ProductType": "PersonalCurrentAccount", + "MarketingStateId": "22878123", + "OtherProductType": { + "Name": "e-Wallet", + "Description": "Virtual wallet", + "ProductDetails": { + "Segment": [ + "GEAS" + ], + "FeeFreeLength": 0, + "FeeFreeLengthPeriod": "PACT", + "MonthlyMaximumCharge": "string", + "Notes": [ + "string" + ], + "OtherSegment": { + "Code": {}, + "Name": {}, + "Description": {} + } + }, + "CreditInterest": { + "TierBandSet": [ + {} + ] + }, + "Overdraft": { + "Notes": [ + "string" + ], + "OverdraftTierBandSet": [ + {} + ] + }, + "LoanInterest": { + "Notes": [ + "string" + ], + "LoanInterestTierBandSet": [ + {} + ] + }, + "Repayment": { + "RepaymentType": "USBA", + "RepaymentFrequency": "SMDA", + "AmountType": "RABD", + "Notes": [ + "string" + ], + "OtherRepaymentType": { + "Code": {}, + "Name": {}, + "Description": {} + }, + "OtherRepaymentFrequency": { + "Code": {}, + "Name": {}, + "Description": {} + }, + "OtherAmountType": { + "Code": {}, + "Name": {}, + "Description": {} + }, + "RepaymentFeeCharges": { + "RepaymentFeeChargeDetail": [], + "RepaymentFeeChargeCap": [] + }, + "RepaymentHoliday": [ + {} + ] + }, + "OtherFeesCharges": [ + { + "TariffType": "TTEL", + "TariffName": "string", + "OtherTariffType": {}, + "FeeChargeDetail": [], + "FeeChargeCap": [] + } + ], + "SupplementaryData": {} + }, + "BCA": { + "ProductDetails": { + "Segment": [ + "ClientAccount" + ], + "FeeFreeLength": 0, + "FeeFreeLengthPeriod": "Day", + "Notes": [ + "string" + ] + }, + "CreditInterest": { + "TierBandSet": [ + {} + ] + }, + "Overdraft": { + "Notes": [ + "string" + ], + "OverdraftTierBandSet": [ + {} + ] + }, + "OtherFeesCharges": [ + { + "TariffType": "Electronic", + "TariffName": "TariffName", + "OtherTariffType": {}, + "FeeChargeDetail": [], + "FeeChargeCap": [] + } + ] + }, + "PCA": { + "ProductDetails": { + "Segment": [ + "Basic" + ], + "MonthlyMaximumCharge": "MonthlyMaximumCharge", + "Notes": [ + "string" + ] + }, + "CreditInterest": { + "TierBandSet": [ + {} + ] + }, + "Overdraft": { + "Notes": [ + "string" + ], + "OverdraftTierBandSet": [ + {} + ] + }, + "OtherFeesCharges": { + "FeeChargeDetail": [ + {} + ], + "FeeChargeCap": [ + {} + ] + } + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdProduct: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "product" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdProduct)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdProduct), + "GET", + "/aisp/accounts/ACCOUNT_ID/product", + "Get Product for an AccountId", + """Enables an AISP to retrieve the account product information for a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdProduct), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Products") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdProduct) + ) + + private val EX_getAccountsAccountIdScheduledPayments: String = """{ + "Data": { + "ScheduledPayment": [ + { + "AccountId": "22289", + "ScheduledPaymentId": "SP03", + "ScheduledPaymentDateTime": "2017-07-12T00:00:00+00:00", + "ScheduledType": "Arrival", + "Reference": "Towbar Club", + "DebtorReference": "REF51561806", + "InstructedAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "CreditorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "80200112344562", + "Name": "Agent Name", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "LEI": "IZ9Q00LZEVUKWCQY6X15" + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdScheduledPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "scheduled-payments" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdScheduledPayments)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdScheduledPayments), + "GET", + "/aisp/accounts/ACCOUNT_ID/scheduled-payments", + "Get Scheduled Payments for an AccountId", + """Enables an AISP to retrieve Scheduled Payment information for a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdScheduledPayments), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Scheduled Payments") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdScheduledPayments) + ) + + private val EX_getAccountsAccountIdStandingOrders: String = """{ + "Data": { + "StandingOrder": [ + { + "AccountId": "22289", + "StandingOrderId": "Ben5", + "NextPaymentDateTime": "2017-07-12T00:00:00+00:00", + "LastPaymentDateTime": "2017-07-12T00:00:00+00:00", + "NumberOfPayments": "string", + "StandingOrderStatusCode": "ACTV", + "FirstPaymentAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "NextPaymentAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "LastPaymentAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "FinalPaymentAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "CreditorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "80200112344562", + "Name": "Agent Name", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "LEI": "IZ9Q00LZEVUKWCQY6X15" + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + }, + "SupplementaryData": {}, + "MandateRelatedInformation": { + "MandateIdentification": "Golfers", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2024-04-25T12:46:49.425Z", + "RecurringPaymentDateTime": "2024-04-25T12:46:49.425Z", + "FinalPaymentDateTime": "2024-04-25T12:46:49.425Z", + "Frequency": { + "Type": "MNTH", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "To pay monthly membership" + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [], + "ReferredDocumentAmount": {}, + "CreditorReferenceInformation": {}, + "Invoicer": {}, + "Invoicee": {}, + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [] + } + ], + "Unstructured": [ + "string" + ] + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdStandingOrders: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "standing-orders" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdStandingOrders)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdStandingOrders), + "GET", + "/aisp/accounts/ACCOUNT_ID/standing-orders", + "Get Standing Orders for an AccountId", + """Enables an AISP to retrieve Standing Order information for a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdStandingOrders), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Standing Orders") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdStandingOrders) + ) + + private val EX_getAccountsAccountIdStatements: String = """{ + "Data": { + "Statement": [ + { + "AccountId": "22289", + "StatementId": "8sfhke-sifhkeuf-97813", + "StatementReference": "002", + "Type": "RegularPeriodic", + "StartDateTime": "2017-07-12T00:00:00+00:00", + "EndDateTime": "2017-07-12T00:00:00+00:00", + "CreationDateTime": "2024-05-29T00:00:00Z", + "StatementDescription": [ + "August 2017 Statement" + ], + "StatementBenefit": [ + { + "Type": "UK.OBIE.Cashback", + "Amount": { + "Amount": {}, + "Currency": {} + } + } + ], + "StatementFee": [ + { + "Description": "International usage charge", + "CreditDebitIndicator": "Credit", + "Type": "UK.OBIE.Annual", + "Rate": 0.05, + "RateType": "UK.OBIE.AER", + "Frequency": "UK.OBIE.StatementMonthly", + "Amount": { + "Amount": {}, + "Currency": {} + } + } + ], + "StatementInterest": [ + { + "Description": "Interest occurred over statement duration", + "CreditDebitIndicator": "Credit", + "Type": "UK.OBIE.Total", + "Rate": 0.05, + "RateType": "UK.OBIE.FixedRate", + "Frequency": "UK.OBIE.Monthly", + "Amount": { + "Amount": {}, + "Currency": {} + } + } + ], + "StatementAmount": [ + { + "CreditDebitIndicator": "Credit", + "Type": "UK.OBIE.CreditLimit", + "Amount": { + "Amount": {}, + "Currency": {}, + "SubType": "BCUR" + }, + "LocalAmount": { + "Amount": {}, + "Currency": {}, + "SubType": "BCUR" + } + } + ], + "StatementDateTime": [ + { + "DateTime": "2024-05-29T00:00:00Z", + "Type": "UK.OBIE.NextStatement" + } + ], + "StatementRate": [ + { + "Rate": "0.224", + "Type": "UK.OBIE.AnnualCash" + } + ], + "StatementValue": [ + { + "Value": "string", + "Type": "UK.OBIE.Credit" + } + ], + "TotalValue": { + "Amount": "1209.06", + "Currency": "GBP" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdStatements: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "statements" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdStatements)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdStatements), + "GET", + "/aisp/accounts/ACCOUNT_ID/statements", + "Get Statements for an AccountId", + """Enables an AISP to retrieve statement information for a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdStatements), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Statements") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdStatements) + ) + + private val EX_getAccountsAccountIdStatementsStatementId: String = """{ + "Data": { + "Statement": [ + { + "AccountId": "22289", + "StatementId": "8sfhke-sifhkeuf-97813", + "StatementReference": "002", + "Type": "RegularPeriodic", + "StartDateTime": "2017-07-12T00:00:00+00:00", + "EndDateTime": "2017-07-12T00:00:00+00:00", + "CreationDateTime": "2024-05-29T00:00:00Z", + "StatementDescription": [ + "August 2017 Statement" + ], + "StatementBenefit": [ + { + "Type": "UK.OBIE.Cashback", + "Amount": { + "Amount": {}, + "Currency": {} + } + } + ], + "StatementFee": [ + { + "Description": "International usage charge", + "CreditDebitIndicator": "Credit", + "Type": "UK.OBIE.Annual", + "Rate": 0.05, + "RateType": "UK.OBIE.AER", + "Frequency": "UK.OBIE.StatementMonthly", + "Amount": { + "Amount": {}, + "Currency": {} + } + } + ], + "StatementInterest": [ + { + "Description": "Interest occurred over statement duration", + "CreditDebitIndicator": "Credit", + "Type": "UK.OBIE.Total", + "Rate": 0.05, + "RateType": "UK.OBIE.FixedRate", + "Frequency": "UK.OBIE.Monthly", + "Amount": { + "Amount": {}, + "Currency": {} + } + } + ], + "StatementAmount": [ + { + "CreditDebitIndicator": "Credit", + "Type": "UK.OBIE.CreditLimit", + "Amount": { + "Amount": {}, + "Currency": {}, + "SubType": "BCUR" + }, + "LocalAmount": { + "Amount": {}, + "Currency": {}, + "SubType": "BCUR" + } + } + ], + "StatementDateTime": [ + { + "DateTime": "2024-05-29T00:00:00Z", + "Type": "UK.OBIE.NextStatement" + } + ], + "StatementRate": [ + { + "Rate": "0.224", + "Type": "UK.OBIE.AnnualCash" + } + ], + "StatementValue": [ + { + "Value": "string", + "Type": "UK.OBIE.Credit" + } + ], + "TotalValue": { + "Amount": "1209.06", + "Currency": "GBP" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdStatementsStatementId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "statements" / statementId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdStatementsStatementId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdStatementsStatementId), + "GET", + "/aisp/accounts/ACCOUNT_ID/statements/STATEMENT_ID", + "Get Statement by StatementId for an AccountId", + """Enables an AISP to retrieve the statement information resource for a specific statement.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdStatementsStatementId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Statements") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdStatementsStatementId) + ) + + private val EX_getAccountsAccountIdStatementsStatementIdFile: String = """{}""" + lazy val getAccountsAccountIdStatementsStatementIdFile: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "statements" / statementId / "file" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdStatementsStatementIdFile)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdStatementsStatementIdFile), + "GET", + "/aisp/accounts/ACCOUNT_ID/statements/STATEMENT_ID/file", + "Get Statement file by StatementId for an AccountId", + """Enables an AISP to retrieve a non-json representation of a specific statement.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdStatementsStatementIdFile), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Statements") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdStatementsStatementIdFile) + ) + + private val EX_getAccountsAccountIdStatementsStatementIdTransactions: String = """{ + "Data": { + "Transaction": [ + { + "AccountId": "22289", + "TransactionId": "string", + "TransactionReference": "string", + "StatementReference": [ + "002" + ], + "CreditDebitIndicator": "Credit", + "Status": "BOOK", + "TransactionMutability": "Mutable", + "BookingDateTime": "2020-01-01T00:00:00+00:00", + "ValueDateTime": "2020-01-01T00:00:00+00:00", + "TransactionInformation": "string", + "AddressLine": "string", + "Amount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "ChargeAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "CurrencyExchange": { + "SourceCurrency": "string", + "TargetCurrency": "string", + "UnitCurrency": "string", + "ExchangeRate": 0, + "ContractIdentification": "string", + "QuotationDate": "2020-01-01T00:00:00+00:00", + "InstructedAmount": { + "Amount": "1209.06", + "Currency": "GBP" + } + }, + "BankTransactionCode": { + "Code": "string", + "SubCode": "string" + }, + "ProprietaryBankTransactionCode": { + "Code": "string", + "Issuer": "string" + }, + "ExtendedProprietaryBankTransactionCodes": [ + { + "Code": "string", + "Issuer": "string", + "Description": "string" + } + ], + "Balance": { + "CreditDebitIndicator": "Credit", + "Type": "CLAV", + "Amount": { + "Amount": "1209.06", + "Currency": "GBP" + } + }, + "MerchantDetails": { + "MerchantName": "string", + "MerchantCategoryCode": "string" + }, + "CreditorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "string", + "Name": "Agent Name", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "80200112344562", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + }, + "DebtorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "string", + "Name": "Agent Name", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "80200112344562", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + }, + "CardInstrument": { + "CardSchemeName": "AmericanExpress", + "AuthorisationType": "ConsumerDevice", + "Name": "string", + "Identification": "string" + }, + "SupplementaryData": {}, + "CategoryPurposeCode": "BONU", + "PaymentPurposeCode": "BKDF", + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "IntermediaryAgent1": { + "Name": "string", + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "ProcessingStatus": "PDNG" + }, + "IntermediaryAgent2": { + "Name": "string", + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "ProcessingStatus": "PDNG" + }, + "IntermediaryAgent3": { + "Name": "string", + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "ProcessingStatus": "PDNG" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdStatementsStatementIdTransactions: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "statements" / statementId / "transactions" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdStatementsStatementIdTransactions)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdStatementsStatementIdTransactions), + "GET", + "/aisp/accounts/ACCOUNT_ID/statements/STATEMENT_ID/transactions", + "Get Statement Transactions for an AccountId", + """Enables an AISP to retrieve transactions that appear on a selected statement for a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdStatementsStatementIdTransactions), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Statements") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdStatementsStatementIdTransactions) + ) + + private val EX_getAccountsAccountIdTransactions: String = """{ + "Data": { + "Transaction": [ + { + "AccountId": "22289", + "TransactionId": "string", + "TransactionReference": "string", + "StatementReference": [ + "002" + ], + "CreditDebitIndicator": "Credit", + "Status": "BOOK", + "TransactionMutability": "Mutable", + "BookingDateTime": "2020-01-01T00:00:00+00:00", + "ValueDateTime": "2020-01-01T00:00:00+00:00", + "TransactionInformation": "string", + "AddressLine": "string", + "Amount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "ChargeAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "CurrencyExchange": { + "SourceCurrency": "string", + "TargetCurrency": "string", + "UnitCurrency": "string", + "ExchangeRate": 0, + "ContractIdentification": "string", + "QuotationDate": "2020-01-01T00:00:00+00:00", + "InstructedAmount": { + "Amount": "1209.06", + "Currency": "GBP" + } + }, + "BankTransactionCode": { + "Code": "string", + "SubCode": "string" + }, + "ProprietaryBankTransactionCode": { + "Code": "string", + "Issuer": "string" + }, + "ExtendedProprietaryBankTransactionCodes": [ + { + "Code": "string", + "Issuer": "string", + "Description": "string" + } + ], + "Balance": { + "CreditDebitIndicator": "Credit", + "Type": "CLAV", + "Amount": { + "Amount": "1209.06", + "Currency": "GBP" + } + }, + "MerchantDetails": { + "MerchantName": "string", + "MerchantCategoryCode": "string" + }, + "CreditorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "string", + "Name": "Agent Name", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "80200112344562", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + }, + "DebtorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "string", + "Name": "Agent Name", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "80200112344562", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + }, + "CardInstrument": { + "CardSchemeName": "AmericanExpress", + "AuthorisationType": "ConsumerDevice", + "Name": "string", + "Identification": "string" + }, + "SupplementaryData": {}, + "CategoryPurposeCode": "BONU", + "PaymentPurposeCode": "BKDF", + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "IntermediaryAgent1": { + "Name": "string", + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "ProcessingStatus": "PDNG" + }, + "IntermediaryAgent2": { + "Name": "string", + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "ProcessingStatus": "PDNG" + }, + "IntermediaryAgent3": { + "Name": "string", + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "ProcessingStatus": "PDNG" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getAccountsAccountIdTransactions: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "accounts" / accountId / "transactions" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getAccountsAccountIdTransactions)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getAccountsAccountIdTransactions), + "GET", + "/aisp/accounts/ACCOUNT_ID/transactions", + "Get Transactions for an AccountId", + """Enables an AISP to retrieve transaction information for a specific PSU account.""", + EmptyBody, + parseBody(EX_getAccountsAccountIdTransactions), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Transactions") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdTransactions) + ) + + private val EX_getBalances: String = """{ + "Data": { + "Balance": [ + { + "AccountId": "22289", + "CreditDebitIndicator": "Credit", + "Type": "CLAV", + "DateTime": "2020-01-01T00:00:00+00:00", + "Amount": { + "Amount": "1209.06", + "Currency": "GBP", + "SubType": "BCUR" + }, + "CreditLine": [ + { + "Included": true, + "Type": "Available", + "Amount": { + "Amount": {}, + "Currency": {} + } + } + ], + "LocalAmount": { + "Amount": "1209.06", + "Currency": "GBP", + "SubType": "BCUR" + } + } + ], + "TotalValue": { + "Amount": "1209.06", + "Currency": "GBP" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getBalances: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "balances" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getBalances)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getBalances), + "GET", + "/aisp/balances", + "Get Balances", + """Enables an AISP to retrieve balance information for account(s) that the PSU has consented to.""", + EmptyBody, + parseBody(EX_getBalances), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Balances") :: Nil, + http4sPartialFunction = Some(getBalances) + ) + + private val EX_getBeneficiaries: String = """{ + "Data": { + "Beneficiary": [ + { + "AccountId": "22289", + "BeneficiaryId": "Ben1", + "BeneficiaryType": "Ordinary", + "Reference": "Towbar Club", + "SupplementaryData": {}, + "CreditorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "80200112344562", + "Name": "Agent Name", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "LEI": "IZ9Q00LZEVUKWCQY6X15" + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "80200112344562", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getBeneficiaries: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "beneficiaries" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getBeneficiaries)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getBeneficiaries), + "GET", + "/aisp/beneficiaries", + "Get Beneficiaries", + """Enables an AISP to retrieve Beneficiary information for account(s) that the PSU has consented to.""", + EmptyBody, + parseBody(EX_getBeneficiaries), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Beneficiaries") :: Nil, + http4sPartialFunction = Some(getBeneficiaries) + ) + + private val EX_getDirectDebits: String = """{ + "Data": { + "DirectDebit": [ + { + "AccountId": "22289", + "DirectDebitId": "string", + "DirectDebitStatusCode": "ACTV", + "MandateRelatedInformation": { + "MandateIdentification": "Golfers", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2024-04-25T12:46:49.425Z", + "RecurringPaymentDateTime": "2024-04-25T12:46:49.425Z", + "FinalPaymentDateTime": "2024-04-25T12:46:49.425Z", + "Frequency": { + "Type": "MNTH", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "To pay monthly membership" + }, + "Name": "string", + "PreviousPaymentDateTime": "2020-01-01T00:00:00+00:00", + "PreviousPaymentAmount": { + "Amount": "1209.06", + "Currency": "GBP" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getDirectDebits: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "direct-debits" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getDirectDebits)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getDirectDebits), + "GET", + "/aisp/direct-debits", + "Get Direct Debits", + """Enables an AISP to retrieve Direct Debit information for account(s) that the PSU has consented to.""", + EmptyBody, + parseBody(EX_getDirectDebits), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Direct Debits") :: Nil, + http4sPartialFunction = Some(getDirectDebits) + ) + + private val EX_getOffers: String = """{ + "Data": { + "Offer": [ + { + "AccountId": "22289", + "OfferId": "Offer1", + "OfferType": "LimitIncrease", + "Description": "Credit limit increase for the account up to £10000.00", + "StartDateTime": "2024-05-29T00:00:00Z", + "EndDateTime": "2024-06-29T00:00:00Z", + "Rate": "100.00", + "Value": 10, + "Term": "Starting first of the month and ending at the end of year", + "URL": "http://modelbank.com/offer/offer1", + "Amount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "Fee": { + "Amount": "1209.06", + "Currency": "GBP" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getOffers: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "offers" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getOffers)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getOffers), + "GET", + "/aisp/offers", + "Get Offers", + """Enables an AISP to retrieve any offer information for account(s) that the PSU has consented to.""", + EmptyBody, + parseBody(EX_getOffers), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Offers") :: Nil, + http4sPartialFunction = Some(getOffers) + ) + + private val EX_getParty: String = """{ + "Data": { + "Party": { + "PartyId": "PXSIF023", + "PartyNumber": "20202002", + "PartyType": "Joint", + "Name": "Mx Jane Smith", + "FullLegalName": "Jane Smith", + "LegalStructure": "UK.OBIE.Individual", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "BeneficialOwnership": true, + "AccountRole": "string", + "EmailAddress": "d.user@semiotec.co.jp", + "Phone": "+44-2079460000", + "Mobile": "+44-7700900000", + "Relationships": { + "Account": { + "Related": "https://api.alphabank.com/open-banking/v4.0/aisp/accounts/89019", + "Id": "89019" + } + }, + "Address": [ + { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getParty: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "party" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getParty)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getParty), + "GET", + "/aisp/party", + "Get Party", + """Retrieve details about the party that gave permission to the AISP to view an account(s).""", + EmptyBody, + parseBody(EX_getParty), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Parties") :: Nil, + http4sPartialFunction = Some(getParty) + ) + + private val EX_getProducts: String = """{ + "Data": { + "Product": [ + { + "ProductName": "321 Product", + "ProductId": "51B", + "AccountId": "22289", + "SecondaryProductId": "CA78", + "ProductType": "PersonalCurrentAccount", + "MarketingStateId": "22878123", + "OtherProductType": { + "Name": "e-Wallet", + "Description": "Virtual wallet", + "ProductDetails": { + "Segment": [ + "GEAS" + ], + "FeeFreeLength": 0, + "FeeFreeLengthPeriod": "PACT", + "MonthlyMaximumCharge": "string", + "Notes": [ + "string" + ], + "OtherSegment": { + "Code": {}, + "Name": {}, + "Description": {} + } + }, + "CreditInterest": { + "TierBandSet": [ + {} + ] + }, + "Overdraft": { + "Notes": [ + "string" + ], + "OverdraftTierBandSet": [ + {} + ] + }, + "LoanInterest": { + "Notes": [ + "string" + ], + "LoanInterestTierBandSet": [ + {} + ] + }, + "Repayment": { + "RepaymentType": "USBA", + "RepaymentFrequency": "SMDA", + "AmountType": "RABD", + "Notes": [ + "string" + ], + "OtherRepaymentType": { + "Code": {}, + "Name": {}, + "Description": {} + }, + "OtherRepaymentFrequency": { + "Code": {}, + "Name": {}, + "Description": {} + }, + "OtherAmountType": { + "Code": {}, + "Name": {}, + "Description": {} + }, + "RepaymentFeeCharges": { + "RepaymentFeeChargeDetail": [], + "RepaymentFeeChargeCap": [] + }, + "RepaymentHoliday": [ + {} + ] + }, + "OtherFeesCharges": [ + { + "TariffType": "TTEL", + "TariffName": "string", + "OtherTariffType": {}, + "FeeChargeDetail": [], + "FeeChargeCap": [] + } + ], + "SupplementaryData": {} + }, + "BCA": { + "ProductDetails": { + "Segment": [ + "ClientAccount" + ], + "FeeFreeLength": 0, + "FeeFreeLengthPeriod": "Day", + "Notes": [ + "string" + ] + }, + "CreditInterest": { + "TierBandSet": [ + {} + ] + }, + "Overdraft": { + "Notes": [ + "string" + ], + "OverdraftTierBandSet": [ + {} + ] + }, + "OtherFeesCharges": [ + { + "TariffType": "Electronic", + "TariffName": "TariffName", + "OtherTariffType": {}, + "FeeChargeDetail": [], + "FeeChargeCap": [] + } + ] + }, + "PCA": { + "ProductDetails": { + "Segment": [ + "Basic" + ], + "MonthlyMaximumCharge": "MonthlyMaximumCharge", + "Notes": [ + "string" + ] + }, + "CreditInterest": { + "TierBandSet": [ + {} + ] + }, + "Overdraft": { + "Notes": [ + "string" + ], + "OverdraftTierBandSet": [ + {} + ] + }, + "OtherFeesCharges": { + "FeeChargeDetail": [ + {} + ], + "FeeChargeCap": [ + {} + ] + } + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getProducts: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "products" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getProducts)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getProducts), + "GET", + "/aisp/products", + "Get Products", + """Enables an AISP to retrieve the account product information for account(s) that the PSU has consented to.""", + EmptyBody, + parseBody(EX_getProducts), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Products") :: Nil, + http4sPartialFunction = Some(getProducts) + ) + + private val EX_getScheduledPayments: String = """{ + "Data": { + "ScheduledPayment": [ + { + "AccountId": "22289", + "ScheduledPaymentId": "SP03", + "ScheduledPaymentDateTime": "2017-07-12T00:00:00+00:00", + "ScheduledType": "Arrival", + "Reference": "Towbar Club", + "DebtorReference": "REF51561806", + "InstructedAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "CreditorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "80200112344562", + "Name": "Agent Name", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "LEI": "IZ9Q00LZEVUKWCQY6X15" + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getScheduledPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "scheduled-payments" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getScheduledPayments)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getScheduledPayments), + "GET", + "/aisp/scheduled-payments", + "Get Scheduled Payments", + """Enables an AISP to retrieve Scheduled Payment information for account(s) that the PSU has consented to.""", + EmptyBody, + parseBody(EX_getScheduledPayments), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Scheduled Payments") :: Nil, + http4sPartialFunction = Some(getScheduledPayments) + ) + + private val EX_getStandingOrders: String = """{ + "Data": { + "StandingOrder": [ + { + "AccountId": "22289", + "StandingOrderId": "Ben5", + "NextPaymentDateTime": "2017-07-12T00:00:00+00:00", + "LastPaymentDateTime": "2017-07-12T00:00:00+00:00", + "NumberOfPayments": "string", + "StandingOrderStatusCode": "ACTV", + "FirstPaymentAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "NextPaymentAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "LastPaymentAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "FinalPaymentAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "CreditorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "80200112344562", + "Name": "Agent Name", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "LEI": "IZ9Q00LZEVUKWCQY6X15" + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + }, + "SupplementaryData": {}, + "MandateRelatedInformation": { + "MandateIdentification": "Golfers", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2024-04-25T12:46:49.425Z", + "RecurringPaymentDateTime": "2024-04-25T12:46:49.425Z", + "FinalPaymentDateTime": "2024-04-25T12:46:49.425Z", + "Frequency": { + "Type": "MNTH", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "To pay monthly membership" + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [], + "ReferredDocumentAmount": {}, + "CreditorReferenceInformation": {}, + "Invoicer": {}, + "Invoicee": {}, + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [] + } + ], + "Unstructured": [ + "string" + ] + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getStandingOrders: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "standing-orders" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getStandingOrders)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getStandingOrders), + "GET", + "/aisp/standing-orders", + "Get Standing Orders", + """Enables an AISP to retrieve Standing Order information for account(s) that the PSU has consented to.""", + EmptyBody, + parseBody(EX_getStandingOrders), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Standing Orders") :: Nil, + http4sPartialFunction = Some(getStandingOrders) + ) + + private val EX_getStatements: String = """{ + "Data": { + "Statement": [ + { + "AccountId": "22289", + "StatementId": "8sfhke-sifhkeuf-97813", + "StatementReference": "002", + "Type": "RegularPeriodic", + "StartDateTime": "2017-07-12T00:00:00+00:00", + "EndDateTime": "2017-07-12T00:00:00+00:00", + "CreationDateTime": "2024-05-29T00:00:00Z", + "StatementDescription": [ + "August 2017 Statement" + ], + "StatementBenefit": [ + { + "Type": "UK.OBIE.Cashback", + "Amount": { + "Amount": {}, + "Currency": {} + } + } + ], + "StatementFee": [ + { + "Description": "International usage charge", + "CreditDebitIndicator": "Credit", + "Type": "UK.OBIE.Annual", + "Rate": 0.05, + "RateType": "UK.OBIE.AER", + "Frequency": "UK.OBIE.StatementMonthly", + "Amount": { + "Amount": {}, + "Currency": {} + } + } + ], + "StatementInterest": [ + { + "Description": "Interest occurred over statement duration", + "CreditDebitIndicator": "Credit", + "Type": "UK.OBIE.Total", + "Rate": 0.05, + "RateType": "UK.OBIE.FixedRate", + "Frequency": "UK.OBIE.Monthly", + "Amount": { + "Amount": {}, + "Currency": {} + } + } + ], + "StatementAmount": [ + { + "CreditDebitIndicator": "Credit", + "Type": "UK.OBIE.CreditLimit", + "Amount": { + "Amount": {}, + "Currency": {}, + "SubType": "BCUR" + }, + "LocalAmount": { + "Amount": {}, + "Currency": {}, + "SubType": "BCUR" + } + } + ], + "StatementDateTime": [ + { + "DateTime": "2024-05-29T00:00:00Z", + "Type": "UK.OBIE.NextStatement" + } + ], + "StatementRate": [ + { + "Rate": "0.224", + "Type": "UK.OBIE.AnnualCash" + } + ], + "StatementValue": [ + { + "Value": "string", + "Type": "UK.OBIE.Credit" + } + ], + "TotalValue": { + "Amount": "1209.06", + "Currency": "GBP" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getStatements: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "statements" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getStatements)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getStatements), + "GET", + "/aisp/statements", + "Get Statements", + """Enables an AISP to retrieve statement information for account(s) that the PSU has consented to.""", + EmptyBody, + parseBody(EX_getStatements), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Statements") :: Nil, + http4sPartialFunction = Some(getStatements) + ) + + private val EX_getTransactions: String = """{ + "Data": { + "Transaction": [ + { + "AccountId": "22289", + "TransactionId": "string", + "TransactionReference": "string", + "StatementReference": [ + "002" + ], + "CreditDebitIndicator": "Credit", + "Status": "BOOK", + "TransactionMutability": "Mutable", + "BookingDateTime": "2020-01-01T00:00:00+00:00", + "ValueDateTime": "2020-01-01T00:00:00+00:00", + "TransactionInformation": "string", + "AddressLine": "string", + "Amount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "ChargeAmount": { + "Amount": "1209.06", + "Currency": "GBP" + }, + "CurrencyExchange": { + "SourceCurrency": "string", + "TargetCurrency": "string", + "UnitCurrency": "string", + "ExchangeRate": 0, + "ContractIdentification": "string", + "QuotationDate": "2020-01-01T00:00:00+00:00", + "InstructedAmount": { + "Amount": "1209.06", + "Currency": "GBP" + } + }, + "BankTransactionCode": { + "Code": "string", + "SubCode": "string" + }, + "ProprietaryBankTransactionCode": { + "Code": "string", + "Issuer": "string" + }, + "ExtendedProprietaryBankTransactionCodes": [ + { + "Code": "string", + "Issuer": "string", + "Description": "string" + } + ], + "Balance": { + "CreditDebitIndicator": "Credit", + "Type": "CLAV", + "Amount": { + "Amount": "1209.06", + "Currency": "GBP" + } + }, + "MerchantDetails": { + "MerchantName": "string", + "MerchantCategoryCode": "string" + }, + "CreditorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "string", + "Name": "Agent Name", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "80200112344562", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + }, + "DebtorAgent": { + "SchemeName": "UK.OBIE.BICFI", + "Identification": "string", + "Name": "Agent Name", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "80200112344562", + "Name": "Jane Smith", + "SecondaryIdentification": "87562298675897", + "Proxy": { + "Identification": "2360549017905188", + "Code": "TELE", + "Type": "string" + } + }, + "CardInstrument": { + "CardSchemeName": "AmericanExpress", + "AuthorisationType": "ConsumerDevice", + "Name": "string", + "Identification": "string" + }, + "SupplementaryData": {}, + "CategoryPurposeCode": "BONU", + "PaymentPurposeCode": "BKDF", + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "IntermediaryAgent1": { + "Name": "string", + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "ProcessingStatus": "PDNG" + }, + "IntermediaryAgent2": { + "Name": "string", + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "ProcessingStatus": "PDNG" + }, + "IntermediaryAgent3": { + "Name": "string", + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "Finance", + "SubDepartment": "Payroll", + "StreetName": "Bank Street", + "BuildingNumber": "11", + "BuildingName": "string", + "Floor": "11", + "UnitNumber": "A88", + "Room": "Basement 03", + "PostBox": "PO Box 123456", + "TownLocationName": "London", + "DistrictName": "Greater London", + "CareOf": "Jane Smith", + "PostCode": "EC2N 4AG", + "TownName": "London", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "ProcessingStatus": "PDNG" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getTransactions: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "aisp" / "transactions" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getTransactions)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getTransactions), + "GET", + "/aisp/transactions", + "Get Transactions", + """Enables an AISP to retrieve transaction information for account(s) that the PSU has consented to.""", + EmptyBody, + parseBody(EX_getTransactions), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Transactions") :: Nil, + http4sPartialFunction = Some(getTransactions) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createAccountAccessConsents(req) + .orElse(getAccountAccessConsentsConsentId(req) + .orElse(deleteAccountAccessConsentsConsentId(req) + .orElse(getAccounts(req) + .orElse(getAccountsAccountId(req) + .orElse(getAccountsAccountIdBalances(req) + .orElse(getAccountsAccountIdBeneficiaries(req) + .orElse(getAccountsAccountIdDirectDebits(req) + .orElse(getAccountsAccountIdOffers(req) + .orElse(getAccountsAccountIdParties(req) + .orElse(getAccountsAccountIdParty(req) + .orElse(getAccountsAccountIdProduct(req) + .orElse(getAccountsAccountIdScheduledPayments(req) + .orElse(getAccountsAccountIdStandingOrders(req) + .orElse(getAccountsAccountIdStatements(req) + .orElse(getAccountsAccountIdStatementsStatementId(req) + .orElse(getAccountsAccountIdStatementsStatementIdFile(req) + .orElse(getAccountsAccountIdStatementsStatementIdTransactions(req) + .orElse(getAccountsAccountIdTransactions(req) + .orElse(getBalances(req) + .orElse(getBeneficiaries(req) + .orElse(getDirectDebits(req) + .orElse(getOffers(req) + .orElse(getParty(req) + .orElse(getProducts(req) + .orElse(getScheduledPayments(req) + .orElse(getStandingOrders(req) + .orElse(getStatements(req) + .orElse(getTransactions(req))))))))))))))))))))))))))))) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401ConfirmationFunds.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401ConfirmationFunds.scala new file mode 100644 index 0000000000..65649e21fe --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401ConfirmationFunds.scala @@ -0,0 +1,242 @@ +package code.api.UKOpenBanking.v4_0_1 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc} +import code.api.util.ApiTag +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import com.openbankproject.commons.util.JsonAliases +import org.json4s.{Formats, JObject} +import org.http4s._ +import org.http4s.dsl.io._ +import com.openbankproject.commons.ExecutionContext.Implicits.global + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +// AUTO-GENERATED from UK Open Banking read-write-api-specs v4.0.1 (ConfirmationFunds). +// Spec-faithful scaffold: routes return synthesized example JSON from the +// OpenAPI schemas (the specs carry no examples). Deepen to real OBP +// connector logic per endpoint later, mirroring v3_1_0. +object Http4sUKOBv401ConfirmationFunds extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV401 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): JObject = JsonAliases.parse(s).asInstanceOf[JObject] + val ukV401Prefix = Root / ApiVersion.ukOpenBankingV401.urlPrefix / ApiVersion.ukOpenBankingV401.apiShortVersion + + private val EXREQ_createFundsConfirmationConsents: String = """{ + "Data": { + "ExpirationDateTime": "2020-01-01T00:00:00+00:00", + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + } + } +}""" + private val EX_createFundsConfirmationConsents: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00", + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createFundsConfirmationConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "cbpii" / "funds-confirmation-consents" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createFundsConfirmationConsents))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createFundsConfirmationConsents), + "POST", + "/cbpii/funds-confirmation-consents", + "Create a Funds Confirmation Consent", + """Enables a CBPII to ask an ASPSP to create a new funds-confirmation-consent resource, by sending a copy of the consent to the ASPSP.""", + parseBody(EXREQ_createFundsConfirmationConsents), + parseBody(EX_createFundsConfirmationConsents), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Funds Confirmation Consents") :: Nil, + http4sPartialFunction = Some(createFundsConfirmationConsents) + ) + + private val EX_getFundsConfirmationConsentsConsentId: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00", + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getFundsConfirmationConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "cbpii" / "funds-confirmation-consents" / consentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getFundsConfirmationConsentsConsentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getFundsConfirmationConsentsConsentId), + "GET", + "/cbpii/funds-confirmation-consents/CONSENT_ID", + "Get a Funds Confirmation Consent", + """Enables a CBPII to retrieve the status of a Funds Confirmation Consent resource.""", + EmptyBody, + parseBody(EX_getFundsConfirmationConsentsConsentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Funds Confirmation Consents") :: Nil, + http4sPartialFunction = Some(getFundsConfirmationConsentsConsentId) + ) + + private val EX_deleteFundsConfirmationConsentsConsentId: String = """{}""" + lazy val deleteFundsConfirmationConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ DELETE -> `ukV401Prefix` / "cbpii" / "funds-confirmation-consents" / consentId => + EndpointHelpers.executeDelete(req) { cc => Future.successful(()) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(deleteFundsConfirmationConsentsConsentId), + "DELETE", + "/cbpii/funds-confirmation-consents/CONSENT_ID", + "Delete a Funds Confirmation Consent", + """Enables a CBPII to inform the PSU’s ASPSP that the PSU has revoked their consent to provide funds confirmations.""", + EmptyBody, + parseBody(EX_deleteFundsConfirmationConsentsConsentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Funds Confirmation Consents") :: Nil, + http4sPartialFunction = Some(deleteFundsConfirmationConsentsConsentId) + ) + + private val EXREQ_createFundsConfirmations: String = """{ + "Data": { + "ConsentId": "string", + "Reference": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + } + } +}""" + private val EX_createFundsConfirmations: String = """{ + "Data": { + "FundsConfirmationId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "FundsAvailable": true, + "Reference": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createFundsConfirmations: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "cbpii" / "funds-confirmations" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createFundsConfirmations))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createFundsConfirmations), + "POST", + "/cbpii/funds-confirmations", + "Create a Funds Confirmation Request", + """Enables a CBPII to check whether a PSU has sufficient available funds for a CBPII transaction.""", + parseBody(EXREQ_createFundsConfirmations), + parseBody(EX_createFundsConfirmations), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Funds Confirmations") :: Nil, + http4sPartialFunction = Some(createFundsConfirmations) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createFundsConfirmationConsents(req) + .orElse(getFundsConfirmationConsentsConsentId(req) + .orElse(deleteFundsConfirmationConsentsConsentId(req) + .orElse(createFundsConfirmations(req)))) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401EventNotifications.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401EventNotifications.scala new file mode 100644 index 0000000000..000fbbafcd --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401EventNotifications.scala @@ -0,0 +1,56 @@ +package code.api.UKOpenBanking.v4_0_1 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc} +import code.api.util.ApiTag +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import com.openbankproject.commons.util.JsonAliases +import org.json4s.{Formats, JObject} +import org.http4s._ +import org.http4s.dsl.io._ +import com.openbankproject.commons.ExecutionContext.Implicits.global + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +// AUTO-GENERATED from UK Open Banking read-write-api-specs v4.0.1 (EventNotifications). +// Spec-faithful scaffold: routes return synthesized example JSON from the +// OpenAPI schemas (the specs carry no examples). Deepen to real OBP +// connector logic per endpoint later, mirroring v3_1_0. +object Http4sUKOBv401EventNotifications extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV401 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): JObject = JsonAliases.parse(s).asInstanceOf[JObject] + val ukV401Prefix = Root / ApiVersion.ukOpenBankingV401.urlPrefix / ApiVersion.ukOpenBankingV401.apiShortVersion + + private val EX_createEventNotification: String = """{}""" + lazy val createEventNotification: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "event-notifications" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createEventNotification))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createEventNotification), + "POST", + "/event-notifications", + "Send an event notification", + """Allows the ASPSP to send an event-notification resource to a TPP.""", + EmptyBody, + parseBody(EX_createEventNotification), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Event Notification") :: Nil, + http4sPartialFunction = Some(createEventNotification) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createEventNotification(req) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401Events.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401Events.scala new file mode 100644 index 0000000000..856a71325e --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401Events.scala @@ -0,0 +1,245 @@ +package code.api.UKOpenBanking.v4_0_1 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc} +import code.api.util.ApiTag +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import com.openbankproject.commons.util.JsonAliases +import org.json4s.{Formats, JObject} +import org.http4s._ +import org.http4s.dsl.io._ +import com.openbankproject.commons.ExecutionContext.Implicits.global + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +// AUTO-GENERATED from UK Open Banking read-write-api-specs v4.0.1 (Events). +// Spec-faithful scaffold: routes return synthesized example JSON from the +// OpenAPI schemas (the specs carry no examples). Deepen to real OBP +// connector logic per endpoint later, mirroring v3_1_0. +object Http4sUKOBv401Events extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV401 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): JObject = JsonAliases.parse(s).asInstanceOf[JObject] + val ukV401Prefix = Root / ApiVersion.ukOpenBankingV401.urlPrefix / ApiVersion.ukOpenBankingV401.apiShortVersion + + private val EX_getEventSubscriptions: String = """{ + "Data": { + "EventSubscription": [ + { + "EventSubscriptionId": "string", + "CallbackUrl": "string", + "Version": "string", + "EventTypes": [ + "string" + ] + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getEventSubscriptions: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "event-subscriptions" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getEventSubscriptions)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getEventSubscriptions), + "GET", + "/event-subscriptions", + "Get an Event Subscription", + """Enables a TPP to retrieve details of its event notifications subscription.""", + EmptyBody, + parseBody(EX_getEventSubscriptions), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Event Subscriptions") :: Nil, + http4sPartialFunction = Some(getEventSubscriptions) + ) + + private val EXREQ_createEventSubscriptions: String = """{ + "Data": { + "CallbackUrl": "string", + "Version": "string", + "EventTypes": [ + "string" + ] + } +}""" + private val EX_createEventSubscriptions: String = """{ + "Data": { + "EventSubscriptionId": "string", + "CallbackUrl": "string", + "Version": "string", + "EventTypes": [ + "string" + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createEventSubscriptions: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "event-subscriptions" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createEventSubscriptions))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createEventSubscriptions), + "POST", + "/event-subscriptions", + "Create an Event Subscription", + """Enables a TPP to subscribe to events notifications with an ASPSP.""", + parseBody(EXREQ_createEventSubscriptions), + parseBody(EX_createEventSubscriptions), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Event Subscriptions") :: Nil, + http4sPartialFunction = Some(createEventSubscriptions) + ) + + private val EXREQ_changeEventSubscriptionsEventSubscriptionId: String = """{ + "Data": { + "EventSubscriptionId": "string", + "CallbackUrl": "string", + "Version": "string", + "EventTypes": [ + "string" + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + private val EX_changeEventSubscriptionsEventSubscriptionId: String = """{ + "Data": { + "EventSubscriptionId": "string", + "CallbackUrl": "string", + "Version": "string", + "EventTypes": [ + "string" + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val changeEventSubscriptionsEventSubscriptionId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ PUT -> `ukV401Prefix` / "event-subscriptions" / eventSubscriptionId => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_changeEventSubscriptionsEventSubscriptionId))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(changeEventSubscriptionsEventSubscriptionId), + "PUT", + "/event-subscriptions/EVENT_SUBSCRIPTION_ID", + "Update an Event Subscription", + """Enables a TPP to ask an ASPSP to update its events notifications subscription.""", + parseBody(EXREQ_changeEventSubscriptionsEventSubscriptionId), + parseBody(EX_changeEventSubscriptionsEventSubscriptionId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Event Subscriptions") :: Nil, + http4sPartialFunction = Some(changeEventSubscriptionsEventSubscriptionId) + ) + + private val EX_deleteEventSubscriptionsEventSubscriptionId: String = """{}""" + lazy val deleteEventSubscriptionsEventSubscriptionId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ DELETE -> `ukV401Prefix` / "event-subscriptions" / eventSubscriptionId => + EndpointHelpers.executeDelete(req) { cc => Future.successful(()) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(deleteEventSubscriptionsEventSubscriptionId), + "DELETE", + "/event-subscriptions/EVENT_SUBSCRIPTION_ID", + "Delete an Event Subscription", + """Enables a TPP to ask an ASPSP to unsubscribe from events notifications.""", + EmptyBody, + parseBody(EX_deleteEventSubscriptionsEventSubscriptionId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Event Subscriptions") :: Nil, + http4sPartialFunction = Some(deleteEventSubscriptionsEventSubscriptionId) + ) + + private val EXREQ_createEvents: String = """{ + "maxEvents": 0, + "returnImmediately": true, + "ack": [ + "string" + ], + "setErrs": {} +}""" + private val EX_createEvents: String = """{ + "moreAvailable": true, + "sets": {} +}""" + lazy val createEvents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "events" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createEvents))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createEvents), + "POST", + "/events", + "Create Events", + """Enables a TPP to poll for, acknowledge, and receive event notifications.""", + parseBody(EXREQ_createEvents), + parseBody(EX_createEvents), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Events") :: Nil, + http4sPartialFunction = Some(createEvents) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getEventSubscriptions(req) + .orElse(createEventSubscriptions(req) + .orElse(changeEventSubscriptionsEventSubscriptionId(req) + .orElse(deleteEventSubscriptionsEventSubscriptionId(req) + .orElse(createEvents(req))))) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401PaymentInitiation.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401PaymentInitiation.scala new file mode 100644 index 0000000000..d02827321b --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401PaymentInitiation.scala @@ -0,0 +1,10726 @@ +package code.api.UKOpenBanking.v4_0_1 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc} +import code.api.util.ApiTag +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import com.openbankproject.commons.util.JsonAliases +import org.json4s.{Formats, JObject} +import org.http4s._ +import org.http4s.dsl.io._ +import com.openbankproject.commons.ExecutionContext.Implicits.global + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +// AUTO-GENERATED from UK Open Banking read-write-api-specs v4.0.1 (PaymentInitiation). +// Spec-faithful scaffold: routes return synthesized example JSON from the +// OpenAPI schemas (the specs carry no examples). Deepen to real OBP +// connector logic per endpoint later, mirroring v3_1_0. +object Http4sUKOBv401PaymentInitiation extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV401 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): JObject = JsonAliases.parse(s).asInstanceOf[JObject] + val ukV401Prefix = Root / ApiVersion.ukOpenBankingV401.urlPrefix / ApiVersion.ukOpenBankingV401.apiShortVersion + + private val EXREQ_createDomesticPaymentConsents: String = """{ + "Data": { + "ReadRefundAccount": "No", + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createDomesticPaymentConsents: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createDomesticPaymentConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "domestic-payment-consents" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createDomesticPaymentConsents))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createDomesticPaymentConsents), + "POST", + "/pisp/domestic-payment-consents", + "Create a Domestic Payment Consent", + """Enables a PISP to register an intent to initiate a Domestic Payment.""", + parseBody(EXREQ_createDomesticPaymentConsents), + parseBody(EX_createDomesticPaymentConsents), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Payment Consents") :: Nil, + http4sPartialFunction = Some(createDomesticPaymentConsents) + ) + + private val EX_getDomesticPaymentConsentsConsentId: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getDomesticPaymentConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-payment-consents" / consentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getDomesticPaymentConsentsConsentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getDomesticPaymentConsentsConsentId), + "GET", + "/pisp/domestic-payment-consents/CONSENT_ID", + "Get a Domestic Payment Consent", + """Enables a PISP to retrieve the status of an intent to initiate a Domestic Payment.""", + EmptyBody, + parseBody(EX_getDomesticPaymentConsentsConsentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Payment Consents") :: Nil, + http4sPartialFunction = Some(getDomesticPaymentConsentsConsentId) + ) + + private val EX_getDomesticPaymentConsentsConsentIdFundsConfirmation: String = """{ + "Data": { + "FundsAvailableResult": { + "FundsAvailableDateTime": "2020-01-01T00:00:00+00:00", + "FundsAvailable": true + }, + "SupplementaryData": {} + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getDomesticPaymentConsentsConsentIdFundsConfirmation: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-payment-consents" / consentId / "funds-confirmation" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getDomesticPaymentConsentsConsentIdFundsConfirmation)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getDomesticPaymentConsentsConsentIdFundsConfirmation), + "GET", + "/pisp/domestic-payment-consents/CONSENT_ID/funds-confirmation", + "Confirm availability of funds for a Domestic Payment", + """Enables a PISP to check whether a PSU has sufficient available funds for a Domestic Payment.""", + EmptyBody, + parseBody(EX_getDomesticPaymentConsentsConsentIdFundsConfirmation), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Payment Consents") :: Nil, + http4sPartialFunction = Some(getDomesticPaymentConsentsConsentIdFundsConfirmation) + ) + + private val EXREQ_createDomesticPayments: String = """{ + "Data": { + "ConsentId": "string", + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createDomesticPayments: String = """{ + "Data": { + "DomesticPaymentId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "RCVD", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createDomesticPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "domestic-payments" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createDomesticPayments))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createDomesticPayments), + "POST", + "/pisp/domestic-payments", + "Initiate a Domestic Payment", + """Enables a PISP to initiate an already PSU-approved Domestic Payment.""", + parseBody(EXREQ_createDomesticPayments), + parseBody(EX_createDomesticPayments), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Payments") :: Nil, + http4sPartialFunction = Some(createDomesticPayments) + ) + + private val EX_getDomesticPaymentsDomesticPaymentId: String = """{ + "Data": { + "DomesticPaymentId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "RCVD", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getDomesticPaymentsDomesticPaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-payments" / domesticPaymentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getDomesticPaymentsDomesticPaymentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getDomesticPaymentsDomesticPaymentId), + "GET", + "/pisp/domestic-payments/DOMESTIC_PAYMENT_ID", + "Get a Domestic Payment", + """Enables a PISP to retrieve the status of a Domestic Payment.""", + EmptyBody, + parseBody(EX_getDomesticPaymentsDomesticPaymentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Payments") :: Nil, + http4sPartialFunction = Some(getDomesticPaymentsDomesticPaymentId) + ) + + private val EX_getDomesticPaymentsDomesticPaymentIdPaymentDetails: String = """{ + "Data": { + "PaymentStatus": [ + { + "PaymentTransactionId": "string", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusDetail": { + "LocalInstrument": "string", + "Status": "CANC", + "StatusReason": "string", + "StatusReasonDescription": "string" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getDomesticPaymentsDomesticPaymentIdPaymentDetails: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-payments" / domesticPaymentId / "payment-details" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getDomesticPaymentsDomesticPaymentIdPaymentDetails)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getDomesticPaymentsDomesticPaymentIdPaymentDetails), + "GET", + "/pisp/domestic-payments/DOMESTIC_PAYMENT_ID/payment-details", + "Get details of a Domestic Payment", + """Enables a PISP to retrieve detailed information on the status of a Domestic Payment.""", + EmptyBody, + parseBody(EX_getDomesticPaymentsDomesticPaymentIdPaymentDetails), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Payments") :: Nil, + http4sPartialFunction = Some(getDomesticPaymentsDomesticPaymentIdPaymentDetails) + ) + + private val EXREQ_createDomesticScheduledPaymentConsents: String = """{ + "Data": { + "Permission": "Create", + "ReadRefundAccount": "No", + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createDomesticScheduledPaymentConsents: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "Permission": "Create", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createDomesticScheduledPaymentConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "domestic-scheduled-payment-consents" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createDomesticScheduledPaymentConsents))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createDomesticScheduledPaymentConsents), + "POST", + "/pisp/domestic-scheduled-payment-consents", + "Create a Domestic Scheduled Payment Consent", + """Enables a PISP to register an intent to initiate a Domestic Scheduled Payment.""", + parseBody(EXREQ_createDomesticScheduledPaymentConsents), + parseBody(EX_createDomesticScheduledPaymentConsents), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Scheduled Payment Consents") :: Nil, + http4sPartialFunction = Some(createDomesticScheduledPaymentConsents) + ) + + private val EX_getDomesticScheduledPaymentConsentsConsentId: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "Permission": "Create", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getDomesticScheduledPaymentConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-scheduled-payment-consents" / consentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getDomesticScheduledPaymentConsentsConsentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getDomesticScheduledPaymentConsentsConsentId), + "GET", + "/pisp/domestic-scheduled-payment-consents/CONSENT_ID", + "Get a Domestic Scheduled Payment Consent", + """Enables a PISP to retrieve the status of an intent to initiate a Domestic Scheduled Payment.""", + EmptyBody, + parseBody(EX_getDomesticScheduledPaymentConsentsConsentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Scheduled Payment Consents") :: Nil, + http4sPartialFunction = Some(getDomesticScheduledPaymentConsentsConsentId) + ) + + private val EXREQ_createDomesticScheduledPayments: String = """{ + "Data": { + "ConsentId": "string", + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createDomesticScheduledPayments: String = """{ + "Data": { + "DomesticScheduledPaymentId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createDomesticScheduledPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "domestic-scheduled-payments" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createDomesticScheduledPayments))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createDomesticScheduledPayments), + "POST", + "/pisp/domestic-scheduled-payments", + "Initiate a Domestic Scheduled Payment", + """Enables a PISP to initiate an already PSU-approved Domestic Scheduled Payment.""", + parseBody(EXREQ_createDomesticScheduledPayments), + parseBody(EX_createDomesticScheduledPayments), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Scheduled Payments") :: Nil, + http4sPartialFunction = Some(createDomesticScheduledPayments) + ) + + private val EX_getDomesticScheduledPaymentsDomesticScheduledPaymentId: String = """{ + "Data": { + "DomesticScheduledPaymentId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getDomesticScheduledPaymentsDomesticScheduledPaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-scheduled-payments" / domesticScheduledPaymentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getDomesticScheduledPaymentsDomesticScheduledPaymentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getDomesticScheduledPaymentsDomesticScheduledPaymentId), + "GET", + "/pisp/domestic-scheduled-payments/DOMESTIC_SCHEDULED_PAYMENT_ID", + "Get a Domestic Scheduled Payment", + """Enables a PISP to retrieve the status of a Domestic Scheduled Payment.""", + EmptyBody, + parseBody(EX_getDomesticScheduledPaymentsDomesticScheduledPaymentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Scheduled Payments") :: Nil, + http4sPartialFunction = Some(getDomesticScheduledPaymentsDomesticScheduledPaymentId) + ) + + private val EX_getDomesticScheduledPaymentsDomesticScheduledPaymentIdPaymentDetails: String = """{ + "Data": { + "PaymentStatus": [ + { + "PaymentTransactionId": "string", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusDetail": { + "LocalInstrument": "string", + "Status": "CANC", + "StatusReason": "string", + "StatusReasonDescription": "string" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getDomesticScheduledPaymentsDomesticScheduledPaymentIdPaymentDetails: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-scheduled-payments" / domesticScheduledPaymentId / "payment-details" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getDomesticScheduledPaymentsDomesticScheduledPaymentIdPaymentDetails)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getDomesticScheduledPaymentsDomesticScheduledPaymentIdPaymentDetails), + "GET", + "/pisp/domestic-scheduled-payments/DOMESTIC_SCHEDULED_PAYMENT_ID/payment-details", + "Get details of a Domestic Scheduled Payment", + """Enables a PISP to retrieve detailed information on the status of a Domestic Scheduled Payment.""", + EmptyBody, + parseBody(EX_getDomesticScheduledPaymentsDomesticScheduledPaymentIdPaymentDetails), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Scheduled Payments") :: Nil, + http4sPartialFunction = Some(getDomesticScheduledPaymentsDomesticScheduledPaymentIdPaymentDetails) + ) + + private val EXREQ_createDomesticStandingOrderConsents: String = """{ + "Data": { + "Permission": "Create", + "ReadRefundAccount": "No", + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "FirstPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "RecurringPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "FinalPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createDomesticStandingOrderConsents: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "Permission": "Create", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "FirstPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "RecurringPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "FinalPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createDomesticStandingOrderConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "domestic-standing-order-consents" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createDomesticStandingOrderConsents))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createDomesticStandingOrderConsents), + "POST", + "/pisp/domestic-standing-order-consents", + "Create a Domestic Standing Order Consent", + """Enables a PISP to register an intent to initiate a Domestic Standing Order arrangement.""", + parseBody(EXREQ_createDomesticStandingOrderConsents), + parseBody(EX_createDomesticStandingOrderConsents), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Standing Order Consents") :: Nil, + http4sPartialFunction = Some(createDomesticStandingOrderConsents) + ) + + private val EX_getDomesticStandingOrderConsentsConsentId: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "Permission": "Create", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "FirstPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "RecurringPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "FinalPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getDomesticStandingOrderConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-standing-order-consents" / consentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getDomesticStandingOrderConsentsConsentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getDomesticStandingOrderConsentsConsentId), + "GET", + "/pisp/domestic-standing-order-consents/CONSENT_ID", + "Get a Domestic Standing Order Consent", + """Enables a PISP to retrieve the status of an intent to initiate a Domestic Standing Order arrangement.""", + EmptyBody, + parseBody(EX_getDomesticStandingOrderConsentsConsentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Standing Order Consents") :: Nil, + http4sPartialFunction = Some(getDomesticStandingOrderConsentsConsentId) + ) + + private val EXREQ_createDomesticStandingOrders: String = """{ + "Data": { + "ConsentId": "string", + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "FirstPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "RecurringPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "FinalPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createDomesticStandingOrders: String = """{ + "Data": { + "DomesticStandingOrderId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "FirstPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "RecurringPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "FinalPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createDomesticStandingOrders: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "domestic-standing-orders" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createDomesticStandingOrders))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createDomesticStandingOrders), + "POST", + "/pisp/domestic-standing-orders", + "Submit a Domestic Standing Order", + """Enables a PISP to submit a Domestic Standing Order payment under an already PSU-approved Domestic Standing Order arrangement.""", + parseBody(EXREQ_createDomesticStandingOrders), + parseBody(EX_createDomesticStandingOrders), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Standing Orders") :: Nil, + http4sPartialFunction = Some(createDomesticStandingOrders) + ) + + private val EX_getDomesticStandingOrdersDomesticStandingOrderId: String = """{ + "Data": { + "DomesticStandingOrderId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "FirstPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "RecurringPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "FinalPaymentAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getDomesticStandingOrdersDomesticStandingOrderId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-standing-orders" / domesticStandingOrderId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getDomesticStandingOrdersDomesticStandingOrderId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getDomesticStandingOrdersDomesticStandingOrderId), + "GET", + "/pisp/domestic-standing-orders/DOMESTIC_STANDING_ORDER_ID", + "Get a Domestic Standing Order", + """Enables a PISP to retrieve the status of a Domestic Standing Order payment.""", + EmptyBody, + parseBody(EX_getDomesticStandingOrdersDomesticStandingOrderId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Standing Orders") :: Nil, + http4sPartialFunction = Some(getDomesticStandingOrdersDomesticStandingOrderId) + ) + + private val EX_getDomesticStandingOrdersDomesticStandingOrderIdPaymentDetails: String = """{ + "Data": { + "PaymentStatus": [ + { + "PaymentTransactionId": "string", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusDetail": { + "LocalInstrument": "string", + "Status": "CANC", + "StatusReason": "string", + "StatusReasonDescription": "string" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getDomesticStandingOrdersDomesticStandingOrderIdPaymentDetails: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-standing-orders" / domesticStandingOrderId / "payment-details" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getDomesticStandingOrdersDomesticStandingOrderIdPaymentDetails)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getDomesticStandingOrdersDomesticStandingOrderIdPaymentDetails), + "GET", + "/pisp/domestic-standing-orders/DOMESTIC_STANDING_ORDER_ID/payment-details", + "Get details of a Domestic Standing Order Payment", + """Enables a PISP to retrieve detailed information on the status of a Domestic Standing Order payment.""", + EmptyBody, + parseBody(EX_getDomesticStandingOrdersDomesticStandingOrderIdPaymentDetails), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic Standing Orders") :: Nil, + http4sPartialFunction = Some(getDomesticStandingOrdersDomesticStandingOrderIdPaymentDetails) + ) + + private val EXREQ_createFilePaymentConsents: String = """{ + "Data": { + "Initiation": { + "FileType": "string", + "FileHash": "string", + "FileReference": "string", + "NumberOfTransactions": "string", + "ControlSum": 0, + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "LocalInstrument": "string", + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + } + } +}""" + private val EX_createFilePaymentConsents: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "FileType": "string", + "FileHash": "string", + "FileReference": "string", + "NumberOfTransactions": "string", + "ControlSum": 0, + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "LocalInstrument": "string", + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createFilePaymentConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "file-payment-consents" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createFilePaymentConsents))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createFilePaymentConsents), + "POST", + "/pisp/file-payment-consents", + "Create a File Payment Consent", + """Enables a PISP to register an intent to initiate a File Payment.""", + parseBody(EXREQ_createFilePaymentConsents), + parseBody(EX_createFilePaymentConsents), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("File Payment Consents") :: Nil, + http4sPartialFunction = Some(createFilePaymentConsents) + ) + + private val EX_getFilePaymentConsentsConsentId: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "FileType": "string", + "FileHash": "string", + "FileReference": "string", + "NumberOfTransactions": "string", + "ControlSum": 0, + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "LocalInstrument": "string", + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getFilePaymentConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "file-payment-consents" / consentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getFilePaymentConsentsConsentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getFilePaymentConsentsConsentId), + "GET", + "/pisp/file-payment-consents/CONSENT_ID", + "Get a File Payment Consent", + """Enables a PISP to retrieve the status of an intent to initiate a File Payment.""", + EmptyBody, + parseBody(EX_getFilePaymentConsentsConsentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("File Payment Consents") :: Nil, + http4sPartialFunction = Some(getFilePaymentConsentsConsentId) + ) + + private val EX_getFilePaymentConsentsConsentIdFile: String = """{}""" + lazy val getFilePaymentConsentsConsentIdFile: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "file-payment-consents" / consentId / "file" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getFilePaymentConsentsConsentIdFile)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getFilePaymentConsentsConsentIdFile), + "GET", + "/pisp/file-payment-consents/CONSENT_ID/file", + "Get a File Payment Consent's Uploaded File", + """Enables a PISP to download a file that has been previously uploaded.""", + EmptyBody, + parseBody(EX_getFilePaymentConsentsConsentIdFile), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("File Payment Consents") :: Nil, + http4sPartialFunction = Some(getFilePaymentConsentsConsentIdFile) + ) + + private val EX_createFilePaymentConsentsConsentIdFile: String = """{}""" + lazy val createFilePaymentConsentsConsentIdFile: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "file-payment-consents" / consentId / "file" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createFilePaymentConsentsConsentIdFile))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createFilePaymentConsentsConsentIdFile), + "POST", + "/pisp/file-payment-consents/CONSENT_ID/file", + "Upload a File for a ConsentId", + """Enables a PISP to upload a file of payments to the ASPSP for PSU to authenticate.""", + EmptyBody, + parseBody(EX_createFilePaymentConsentsConsentIdFile), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("File Payment Consents") :: Nil, + http4sPartialFunction = Some(createFilePaymentConsentsConsentIdFile) + ) + + private val EXREQ_createFilePayments: String = """{ + "Data": { + "ConsentId": "string", + "Initiation": { + "FileType": "string", + "FileHash": "string", + "FileReference": "string", + "NumberOfTransactions": "string", + "ControlSum": 0, + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "LocalInstrument": "string", + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + } + } +}""" + private val EX_createFilePayments: String = """{ + "Data": { + "FilePaymentId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "PDNG", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "FileType": "string", + "FileHash": "string", + "FileReference": "string", + "NumberOfTransactions": "string", + "ControlSum": 0, + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "LocalInstrument": "string", + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createFilePayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "file-payments" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createFilePayments))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createFilePayments), + "POST", + "/pisp/file-payments", + "Submit a File Payment", + """Enables a PISP to instruct the ASPSP to start processing the payments within the file.""", + parseBody(EXREQ_createFilePayments), + parseBody(EX_createFilePayments), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("File Payments") :: Nil, + http4sPartialFunction = Some(createFilePayments) + ) + + private val EX_getFilePaymentsFilePaymentId: String = """{ + "Data": { + "FilePaymentId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "PDNG", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "FileType": "string", + "FileHash": "string", + "FileReference": "string", + "NumberOfTransactions": "string", + "ControlSum": 0, + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "LocalInstrument": "string", + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getFilePaymentsFilePaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "file-payments" / filePaymentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getFilePaymentsFilePaymentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getFilePaymentsFilePaymentId), + "GET", + "/pisp/file-payments/FILE_PAYMENT_ID", + "Get a File Payment by FilePaymentId", + """Enables a PISP to retrieve the status of a file payment.""", + EmptyBody, + parseBody(EX_getFilePaymentsFilePaymentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("File Payments") :: Nil, + http4sPartialFunction = Some(getFilePaymentsFilePaymentId) + ) + + private val EX_getFilePaymentsFilePaymentIdPaymentDetails: String = """{ + "Data": { + "PaymentStatus": [ + { + "PaymentTransactionId": "string", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusDetail": { + "LocalInstrument": "string", + "Status": "CANC", + "StatusReason": "string", + "StatusReasonDescription": "string" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getFilePaymentsFilePaymentIdPaymentDetails: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "file-payments" / filePaymentId / "payment-details" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getFilePaymentsFilePaymentIdPaymentDetails)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getFilePaymentsFilePaymentIdPaymentDetails), + "GET", + "/pisp/file-payments/FILE_PAYMENT_ID/payment-details", + "Get payment details for a File Payment", + """Enables a PISP to retrieve detailed information on the status of payments within a File.""", + EmptyBody, + parseBody(EX_getFilePaymentsFilePaymentIdPaymentDetails), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("File Payments") :: Nil, + http4sPartialFunction = Some(getFilePaymentsFilePaymentIdPaymentDetails) + ) + + private val EX_getFilePaymentsFilePaymentIdReportFile: String = """{}""" + lazy val getFilePaymentsFilePaymentIdReportFile: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "file-payments" / filePaymentId / "report-file" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getFilePaymentsFilePaymentIdReportFile)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getFilePaymentsFilePaymentIdReportFile), + "GET", + "/pisp/file-payments/FILE_PAYMENT_ID/report-file", + "Get a File Payment's Report File", + """Enables a PISP to download a payment report file from an ASPSP.""", + EmptyBody, + parseBody(EX_getFilePaymentsFilePaymentIdReportFile), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("File Payments") :: Nil, + http4sPartialFunction = Some(getFilePaymentsFilePaymentIdReportFile) + ) + + private val EXREQ_createInternationalPaymentConsents: String = """{ + "Data": { + "ReadRefundAccount": "No", + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createInternationalPaymentConsents: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createInternationalPaymentConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "international-payment-consents" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createInternationalPaymentConsents))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createInternationalPaymentConsents), + "POST", + "/pisp/international-payment-consents", + "Create an International Payment Consent", + """Enables a PISP to register an intent to initiate an International Payment.""", + parseBody(EXREQ_createInternationalPaymentConsents), + parseBody(EX_createInternationalPaymentConsents), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Payment Consents") :: Nil, + http4sPartialFunction = Some(createInternationalPaymentConsents) + ) + + private val EX_getInternationalPaymentConsentsConsentId: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getInternationalPaymentConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "international-payment-consents" / consentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getInternationalPaymentConsentsConsentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getInternationalPaymentConsentsConsentId), + "GET", + "/pisp/international-payment-consents/CONSENT_ID", + "Get an International Payment Consent", + """Enables a PISP to retrieve the status of an intent to initiate an International Payment.""", + EmptyBody, + parseBody(EX_getInternationalPaymentConsentsConsentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Payment Consents") :: Nil, + http4sPartialFunction = Some(getInternationalPaymentConsentsConsentId) + ) + + private val EX_getInternationalPaymentConsentsConsentIdFundsConfirmation: String = """{ + "Data": { + "FundsAvailableResult": { + "FundsAvailableDateTime": "2020-01-01T00:00:00+00:00", + "FundsAvailable": true + }, + "SupplementaryData": {} + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getInternationalPaymentConsentsConsentIdFundsConfirmation: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "international-payment-consents" / consentId / "funds-confirmation" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getInternationalPaymentConsentsConsentIdFundsConfirmation)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getInternationalPaymentConsentsConsentIdFundsConfirmation), + "GET", + "/pisp/international-payment-consents/CONSENT_ID/funds-confirmation", + "Confirm Funds Availability for an International Payment", + """Enables a PISP to check whether a PSU has sufficient available funds for an International Payment.""", + EmptyBody, + parseBody(EX_getInternationalPaymentConsentsConsentIdFundsConfirmation), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Payment Consents") :: Nil, + http4sPartialFunction = Some(getInternationalPaymentConsentsConsentIdFundsConfirmation) + ) + + private val EXREQ_createInternationalPayments: String = """{ + "Data": { + "ConsentId": "string", + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createInternationalPayments: String = """{ + "Data": { + "InternationalPaymentId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "RCVD", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createInternationalPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "international-payments" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createInternationalPayments))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createInternationalPayments), + "POST", + "/pisp/international-payments", + "Initiate an International Payment", + """Enables a PISP to initiate an already PSU-approved International Payment.""", + parseBody(EXREQ_createInternationalPayments), + parseBody(EX_createInternationalPayments), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Payments") :: Nil, + http4sPartialFunction = Some(createInternationalPayments) + ) + + private val EX_getInternationalPaymentsInternationalPaymentId: String = """{ + "Data": { + "InternationalPaymentId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "RCVD", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getInternationalPaymentsInternationalPaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "international-payments" / internationalPaymentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getInternationalPaymentsInternationalPaymentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getInternationalPaymentsInternationalPaymentId), + "GET", + "/pisp/international-payments/INTERNATIONAL_PAYMENT_ID", + "Get an International Payment", + """Enables a PISP to retrieve the status of an International Payment.""", + EmptyBody, + parseBody(EX_getInternationalPaymentsInternationalPaymentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Payments") :: Nil, + http4sPartialFunction = Some(getInternationalPaymentsInternationalPaymentId) + ) + + private val EX_getInternationalPaymentsInternationalPaymentIdPaymentDetails: String = """{ + "Data": { + "PaymentStatus": [ + { + "PaymentTransactionId": "string", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusDetail": { + "LocalInstrument": "string", + "Status": "CANC", + "StatusReason": "string", + "StatusReasonDescription": "string" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getInternationalPaymentsInternationalPaymentIdPaymentDetails: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "international-payments" / internationalPaymentId / "payment-details" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getInternationalPaymentsInternationalPaymentIdPaymentDetails)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getInternationalPaymentsInternationalPaymentIdPaymentDetails), + "GET", + "/pisp/international-payments/INTERNATIONAL_PAYMENT_ID/payment-details", + "Get details of an International Payment", + """Enables a PISP to retrieve detailed information on the status of an International Payment.""", + EmptyBody, + parseBody(EX_getInternationalPaymentsInternationalPaymentIdPaymentDetails), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Payments") :: Nil, + http4sPartialFunction = Some(getInternationalPaymentsInternationalPaymentIdPaymentDetails) + ) + + private val EXREQ_createInternationalScheduledPaymentConsents: String = """{ + "Data": { + "Permission": "Create", + "ReadRefundAccount": "No", + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "Name": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createInternationalScheduledPaymentConsents: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "Permission": "Create", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "Name": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createInternationalScheduledPaymentConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "international-scheduled-payment-consents" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createInternationalScheduledPaymentConsents))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createInternationalScheduledPaymentConsents), + "POST", + "/pisp/international-scheduled-payment-consents", + "Create an International Scheduled Payment Consent", + """Enables a PISP to register an intent to initiate an International Scheduled Payment.""", + parseBody(EXREQ_createInternationalScheduledPaymentConsents), + parseBody(EX_createInternationalScheduledPaymentConsents), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Scheduled Payments Consents") :: Nil, + http4sPartialFunction = Some(createInternationalScheduledPaymentConsents) + ) + + private val EX_getInternationalScheduledPaymentConsentsConsentId: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "Permission": "Create", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "Name": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getInternationalScheduledPaymentConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "international-scheduled-payment-consents" / consentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getInternationalScheduledPaymentConsentsConsentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getInternationalScheduledPaymentConsentsConsentId), + "GET", + "/pisp/international-scheduled-payment-consents/CONSENT_ID", + "Get an International Scheduled Payment Consent", + """Enables a PISP to retrieve the status of an intent to initiate an International Scheduled Payment.""", + EmptyBody, + parseBody(EX_getInternationalScheduledPaymentConsentsConsentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Scheduled Payments Consents") :: Nil, + http4sPartialFunction = Some(getInternationalScheduledPaymentConsentsConsentId) + ) + + private val EX_getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation: String = """{ + "Data": { + "FundsAvailableResult": { + "FundsAvailableDateTime": "2020-01-01T00:00:00+00:00", + "FundsAvailable": true + }, + "SupplementaryData": {} + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "international-scheduled-payment-consents" / consentId / "funds-confirmation" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation), + "GET", + "/pisp/international-scheduled-payment-consents/CONSENT_ID/funds-confirmation", + "Confirm Funds Availability for an International Scheduled Payment", + """Enables a PISP to check whether a PSU has sufficient available funds for an International Scheduled Payment.""", + EmptyBody, + parseBody(EX_getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Scheduled Payments Consents") :: Nil, + http4sPartialFunction = Some(getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation) + ) + + private val EXREQ_createInternationalScheduledPayments: String = """{ + "Data": { + "ConsentId": "string", + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "Name": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createInternationalScheduledPayments: String = """{ + "Data": { + "InternationalScheduledPaymentId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "Name": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createInternationalScheduledPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "international-scheduled-payments" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createInternationalScheduledPayments))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createInternationalScheduledPayments), + "POST", + "/pisp/international-scheduled-payments", + "Initiate an International Scheduled Payment", + """Enables a PISP to initiate an already PSU-approved International Scheduled Payment.""", + parseBody(EXREQ_createInternationalScheduledPayments), + parseBody(EX_createInternationalScheduledPayments), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Scheduled Payments") :: Nil, + http4sPartialFunction = Some(createInternationalScheduledPayments) + ) + + private val EX_getInternationalScheduledPaymentsInternationalScheduledPaymentId: String = """{ + "Data": { + "InternationalScheduledPaymentId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Initiation": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "LocalInstrument": "string", + "InstructionPriority": "Normal", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "RequestedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "ExchangeRateInformation": { + "UnitCurrency": "string", + "ExchangeRate": 0, + "RateType": "Actual", + "ContractIdentification": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "Name": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getInternationalScheduledPaymentsInternationalScheduledPaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "international-scheduled-payments" / internationalScheduledPaymentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getInternationalScheduledPaymentsInternationalScheduledPaymentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getInternationalScheduledPaymentsInternationalScheduledPaymentId), + "GET", + "/pisp/international-scheduled-payments/INTERNATIONAL_SCHEDULED_PAYMENT_ID", + "Get an International Scheduled Payment", + """Enables a PISP to retrieve the status of an International Scheduled Payment.""", + EmptyBody, + parseBody(EX_getInternationalScheduledPaymentsInternationalScheduledPaymentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Scheduled Payments") :: Nil, + http4sPartialFunction = Some(getInternationalScheduledPaymentsInternationalScheduledPaymentId) + ) + + private val EX_getInternationalScheduledPaymentsInternationalScheduledPaymentIdPaymentDetails: String = """{ + "Data": { + "PaymentStatus": [ + { + "PaymentTransactionId": "string", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusDetail": { + "LocalInstrument": "string", + "Status": "CANC", + "StatusReason": "string", + "StatusReasonDescription": "string" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getInternationalScheduledPaymentsInternationalScheduledPaymentIdPaymentDetails: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "international-scheduled-payments" / internationalScheduledPaymentId / "payment-details" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getInternationalScheduledPaymentsInternationalScheduledPaymentIdPaymentDetails)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getInternationalScheduledPaymentsInternationalScheduledPaymentIdPaymentDetails), + "GET", + "/pisp/international-scheduled-payments/INTERNATIONAL_SCHEDULED_PAYMENT_ID/payment-details", + "Get details of an International Scheduled Payment", + """Enables a PISP to retrieve detailed information on the status of an International Scheduled Payment.""", + EmptyBody, + parseBody(EX_getInternationalScheduledPaymentsInternationalScheduledPaymentIdPaymentDetails), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Scheduled Payments") :: Nil, + http4sPartialFunction = Some(getInternationalScheduledPaymentsInternationalScheduledPaymentIdPaymentDetails) + ) + + private val EXREQ_createInternationalStandingOrderConsents: String = """{ + "Data": { + "Permission": "Create", + "ReadRefundAccount": "No", + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createInternationalStandingOrderConsents: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "Permission": "Create", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createInternationalStandingOrderConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "international-standing-order-consents" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createInternationalStandingOrderConsents))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createInternationalStandingOrderConsents), + "POST", + "/pisp/international-standing-order-consents", + "Create an International Standing Order Consent", + """Enables a PISP to register an intent to initiate an International Standing Order arrangement.""", + parseBody(EXREQ_createInternationalStandingOrderConsents), + parseBody(EX_createInternationalStandingOrderConsents), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Standing Orders Consents") :: Nil, + http4sPartialFunction = Some(createInternationalStandingOrderConsents) + ) + + private val EX_getInternationalStandingOrderConsentsConsentId: String = """{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "Permission": "Create", + "ReadRefundAccount": "No", + "CutOffDateTime": "2020-01-01T00:00:00+00:00", + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + }, + "Authorisation": { + "AuthorisationType": "Any", + "CompletionDateTime": "2020-01-01T00:00:00+00:00" + }, + "SCASupportData": { + "RequestedSCAExemptionType": "BillPayment", + "AppliedAuthenticationApproach": "CA", + "ReferencePaymentOrderId": "string" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getInternationalStandingOrderConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "international-standing-order-consents" / consentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getInternationalStandingOrderConsentsConsentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getInternationalStandingOrderConsentsConsentId), + "GET", + "/pisp/international-standing-order-consents/CONSENT_ID", + "Get an International Standing Order Consent", + """Enables a PISP to retrieve the status of an intent to initiate an International Standing Order arrangement.""", + EmptyBody, + parseBody(EX_getInternationalStandingOrderConsentsConsentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Standing Orders Consents") :: Nil, + http4sPartialFunction = Some(getInternationalStandingOrderConsentsConsentId) + ) + + private val EXREQ_createInternationalStandingOrders: String = """{ + "Data": { + "ConsentId": "string", + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_createInternationalStandingOrders: String = """{ + "Data": { + "InternationalStandingOrderId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val createInternationalStandingOrders: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "international-standing-orders" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_createInternationalStandingOrders))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(createInternationalStandingOrders), + "POST", + "/pisp/international-standing-orders", + "Submit an International Standing Order", + """Enables a PISP to submit an International Standing Order payment under an already PSU-approved International Standing Order arrangement.""", + parseBody(EXREQ_createInternationalStandingOrders), + parseBody(EX_createInternationalStandingOrders), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Standing Orders") :: Nil, + http4sPartialFunction = Some(createInternationalStandingOrders) + ) + + private val EX_getInternationalStandingOrdersInternationalStandingOrderPaymentId: String = """{ + "Data": { + "InternationalStandingOrderId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "string", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "80200112344562", + "Invoicee": "80200112344562", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "NumberOfPayments": "string", + "ExtendedPurpose": "string", + "ChargeBearer": "BorneByCreditor", + "CurrencyOfTransfer": "string", + "DestinationCountryCode": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "Creditor": { + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAgent": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ], + "MandateRelatedInformation": { + "MandateIdentification": "string", + "Classification": "FIXE", + "CategoryPurposeCode": "BONU", + "FirstPaymentDateTime": "2020-01-01T00:00:00+00:00", + "RecurringPaymentDateTime": "2020-01-01T00:00:00+00:00", + "FinalPaymentDateTime": "2020-01-01T00:00:00+00:00", + "Frequency": { + "Type": "ADHO", + "CountPerPeriod": 1, + "PointInTime": "00" + }, + "Reason": "string" + }, + "SupplementaryData": {} + }, + "MultiAuthorisation": { + "Status": "AUTH", + "NumberRequired": 0, + "NumberReceived": 0, + "LastUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpirationDateTime": "2020-01-01T00:00:00+00:00" + }, + "Debtor": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15" + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getInternationalStandingOrdersInternationalStandingOrderPaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "international-standing-orders" / internationalStandingOrderPaymentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getInternationalStandingOrdersInternationalStandingOrderPaymentId)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getInternationalStandingOrdersInternationalStandingOrderPaymentId), + "GET", + "/pisp/international-standing-orders/INTERNATIONAL_STANDING_ORDER_PAYMENT_ID", + "Get an International Standing Order", + """Enables a PISP to retrieve the status of an International Standing Order payment.""", + EmptyBody, + parseBody(EX_getInternationalStandingOrdersInternationalStandingOrderPaymentId), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Standing Orders") :: Nil, + http4sPartialFunction = Some(getInternationalStandingOrdersInternationalStandingOrderPaymentId) + ) + + private val EX_getInternationalStandingOrdersInternationalStandingOrderPaymentIdPaymentDetails: String = """{ + "Data": { + "PaymentStatus": [ + { + "PaymentTransactionId": "string", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusDetail": { + "LocalInstrument": "string", + "Status": "CANC", + "StatusReason": "string", + "StatusReasonDescription": "string" + } + } + ] + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-01-01T00:00:00+00:00", + "LastAvailableDateTime": "2020-01-01T00:00:00+00:00" + } +}""" + lazy val getInternationalStandingOrdersInternationalStandingOrderPaymentIdPaymentDetails: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "international-standing-orders" / internationalStandingOrderPaymentId / "payment-details" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_getInternationalStandingOrdersInternationalStandingOrderPaymentIdPaymentDetails)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(getInternationalStandingOrdersInternationalStandingOrderPaymentIdPaymentDetails), + "GET", + "/pisp/international-standing-orders/INTERNATIONAL_STANDING_ORDER_PAYMENT_ID/payment-details", + "Get details of an International Standing Order Payment", + """Enables a PISP to retrieve detailed information on the status of an International Standing Order payment.""", + EmptyBody, + parseBody(EX_getInternationalStandingOrdersInternationalStandingOrderPaymentIdPaymentDetails), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("International Standing Orders") :: Nil, + http4sPartialFunction = Some(getInternationalStandingOrdersInternationalStandingOrderPaymentIdPaymentDetails) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createDomesticPaymentConsents(req) + .orElse(getDomesticPaymentConsentsConsentId(req) + .orElse(getDomesticPaymentConsentsConsentIdFundsConfirmation(req) + .orElse(createDomesticPayments(req) + .orElse(getDomesticPaymentsDomesticPaymentId(req) + .orElse(getDomesticPaymentsDomesticPaymentIdPaymentDetails(req) + .orElse(createDomesticScheduledPaymentConsents(req) + .orElse(getDomesticScheduledPaymentConsentsConsentId(req) + .orElse(createDomesticScheduledPayments(req) + .orElse(getDomesticScheduledPaymentsDomesticScheduledPaymentId(req) + .orElse(getDomesticScheduledPaymentsDomesticScheduledPaymentIdPaymentDetails(req) + .orElse(createDomesticStandingOrderConsents(req) + .orElse(getDomesticStandingOrderConsentsConsentId(req) + .orElse(createDomesticStandingOrders(req) + .orElse(getDomesticStandingOrdersDomesticStandingOrderId(req) + .orElse(getDomesticStandingOrdersDomesticStandingOrderIdPaymentDetails(req) + .orElse(createFilePaymentConsents(req) + .orElse(getFilePaymentConsentsConsentId(req) + .orElse(getFilePaymentConsentsConsentIdFile(req) + .orElse(createFilePaymentConsentsConsentIdFile(req) + .orElse(createFilePayments(req) + .orElse(getFilePaymentsFilePaymentId(req) + .orElse(getFilePaymentsFilePaymentIdPaymentDetails(req) + .orElse(getFilePaymentsFilePaymentIdReportFile(req) + .orElse(createInternationalPaymentConsents(req) + .orElse(getInternationalPaymentConsentsConsentId(req) + .orElse(getInternationalPaymentConsentsConsentIdFundsConfirmation(req) + .orElse(createInternationalPayments(req) + .orElse(getInternationalPaymentsInternationalPaymentId(req) + .orElse(getInternationalPaymentsInternationalPaymentIdPaymentDetails(req) + .orElse(createInternationalScheduledPaymentConsents(req) + .orElse(getInternationalScheduledPaymentConsentsConsentId(req) + .orElse(getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation(req) + .orElse(createInternationalScheduledPayments(req) + .orElse(getInternationalScheduledPaymentsInternationalScheduledPaymentId(req) + .orElse(getInternationalScheduledPaymentsInternationalScheduledPaymentIdPaymentDetails(req) + .orElse(createInternationalStandingOrderConsents(req) + .orElse(getInternationalStandingOrderConsentsConsentId(req) + .orElse(createInternationalStandingOrders(req) + .orElse(getInternationalStandingOrdersInternationalStandingOrderPaymentId(req) + .orElse(getInternationalStandingOrdersInternationalStandingOrderPaymentIdPaymentDetails(req))))))))))))))))))))))))))))))))))))))))) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401Vrp.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401Vrp.scala new file mode 100644 index 0000000000..e473691299 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/Http4sUKOBv401Vrp.scala @@ -0,0 +1,2548 @@ +package code.api.UKOpenBanking.v4_0_1 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc} +import code.api.util.ApiTag +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import com.openbankproject.commons.util.JsonAliases +import org.json4s.{Formats, JObject} +import org.http4s._ +import org.http4s.dsl.io._ +import com.openbankproject.commons.ExecutionContext.Implicits.global + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +// AUTO-GENERATED from UK Open Banking read-write-api-specs v4.0.1 (Vrp). +// Spec-faithful scaffold: routes return synthesized example JSON from the +// OpenAPI schemas (the specs carry no examples). Deepen to real OBP +// connector logic per endpoint later, mirroring v3_1_0. +object Http4sUKOBv401Vrp extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV401 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): JObject = JsonAliases.parse(s).asInstanceOf[JObject] + val ukV401Prefix = Root / ApiVersion.ukOpenBankingV401.urlPrefix / ApiVersion.ukOpenBankingV401.apiShortVersion + + private val EXREQ_domesticVrpConsentsPost: String = """{ + "Data": { + "ReadRefundAccount": "Yes", + "ControlParameters": { + "ValidFromDateTime": "2020-01-01T00:00:00+00:00", + "ValidToDateTime": "2020-01-01T00:00:00+00:00", + "MaximumIndividualAmount": { + "Amount": "string", + "Currency": "string" + }, + "PeriodicLimits": [ + { + "PeriodType": "Day", + "PeriodAlignment": "Consent", + "Amount": "string", + "Currency": "string" + } + ], + "VRPType": [ + "string" + ], + "PSUAuthenticationMethods": [ + "string" + ], + "PSUInteractionTypes": [ + "InSession" + ], + "SupplementaryData": {} + }, + "Initiation": { + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ] + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_domesticVrpConsentsPost: String = """{ + "Data": { + "ReadRefundAccount": "Yes", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ControlParameters": { + "ValidFromDateTime": "2020-01-01T00:00:00+00:00", + "ValidToDateTime": "2020-01-01T00:00:00+00:00", + "MaximumIndividualAmount": { + "Amount": "string", + "Currency": "string" + }, + "PeriodicLimits": [ + { + "PeriodType": "Day", + "PeriodAlignment": "Consent", + "Amount": "string", + "Currency": "string" + } + ], + "VRPType": [ + "string" + ], + "PSUAuthenticationMethods": [ + "string" + ], + "PSUInteractionTypes": [ + "InSession" + ], + "SupplementaryData": {} + }, + "Initiation": { + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ] + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": {} +}""" + lazy val domesticVrpConsentsPost: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "domestic-vrp-consents" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_domesticVrpConsentsPost))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(domesticVrpConsentsPost), + "POST", + "/pisp/domestic-vrp-consents", + "Create a domestic VRP consent", + """Enables a PISP to ask an ASPSP to create a new domestic-vrp-consent resource, by sending a copy of the consent to the ASPSP.""", + parseBody(EXREQ_domesticVrpConsentsPost), + parseBody(EX_domesticVrpConsentsPost), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic VRP Consents") :: Nil, + http4sPartialFunction = Some(domesticVrpConsentsPost) + ) + + private val EX_domesticVrpConsentsGet: String = """{ + "Data": { + "ReadRefundAccount": "Yes", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ControlParameters": { + "ValidFromDateTime": "2020-01-01T00:00:00+00:00", + "ValidToDateTime": "2020-01-01T00:00:00+00:00", + "MaximumIndividualAmount": { + "Amount": "string", + "Currency": "string" + }, + "PeriodicLimits": [ + { + "PeriodType": "Day", + "PeriodAlignment": "Consent", + "Amount": "string", + "Currency": "string" + } + ], + "VRPType": [ + "string" + ], + "PSUAuthenticationMethods": [ + "string" + ], + "PSUInteractionTypes": [ + "InSession" + ], + "SupplementaryData": {} + }, + "Initiation": { + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ] + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": {} +}""" + lazy val domesticVrpConsentsGet: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-vrp-consents" / consentId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_domesticVrpConsentsGet)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(domesticVrpConsentsGet), + "GET", + "/pisp/domestic-vrp-consents/CONSENT_ID", + "Get a Domestic VRP Consent", + """Enables a PISP to retrieve the status of a Domestic VRP Consent.""", + EmptyBody, + parseBody(EX_domesticVrpConsentsGet), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic VRP Consents") :: Nil, + http4sPartialFunction = Some(domesticVrpConsentsGet) + ) + + private val EXREQ_domesticVrpConsentsPut: String = """{ + "Data": { + "ReadRefundAccount": "Yes", + "ControlParameters": { + "ValidFromDateTime": "2020-01-01T00:00:00+00:00", + "ValidToDateTime": "2020-01-01T00:00:00+00:00", + "MaximumIndividualAmount": { + "Amount": "string", + "Currency": "string" + }, + "PeriodicLimits": [ + { + "PeriodType": "Day", + "PeriodAlignment": "Consent", + "Amount": "string", + "Currency": "string" + } + ], + "VRPType": [ + "string" + ], + "PSUAuthenticationMethods": [ + "string" + ], + "PSUInteractionTypes": [ + "InSession" + ], + "SupplementaryData": {} + }, + "Initiation": { + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ] + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_domesticVrpConsentsPut: String = """{ + "Data": { + "ReadRefundAccount": "Yes", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ControlParameters": { + "ValidFromDateTime": "2020-01-01T00:00:00+00:00", + "ValidToDateTime": "2020-01-01T00:00:00+00:00", + "MaximumIndividualAmount": { + "Amount": "string", + "Currency": "string" + }, + "PeriodicLimits": [ + { + "PeriodType": "Day", + "PeriodAlignment": "Consent", + "Amount": "string", + "Currency": "string" + } + ], + "VRPType": [ + "string" + ], + "PSUAuthenticationMethods": [ + "string" + ], + "PSUInteractionTypes": [ + "InSession" + ], + "SupplementaryData": {} + }, + "Initiation": { + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ] + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": {} +}""" + lazy val domesticVrpConsentsPut: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ PUT -> `ukV401Prefix` / "pisp" / "domestic-vrp-consents" / consentId => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_domesticVrpConsentsPut))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(domesticVrpConsentsPut), + "PUT", + "/pisp/domestic-vrp-consents/CONSENT_ID", + "Replace an existing domestic VRP consent", + """Enables a PISP to replace an existing Domestic VRP Consent resource. + +This endpoint **must** only be used for the migration of Domestic VRP Consent resource data across API Standard versions where the ASPSP supports this PUT function.""", + parseBody(EXREQ_domesticVrpConsentsPut), + parseBody(EX_domesticVrpConsentsPut), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic VRP Consents") :: Nil, + http4sPartialFunction = Some(domesticVrpConsentsPut) + ) + + private val EX_domesticVrpConsentsDelete: String = """{}""" + lazy val domesticVrpConsentsDelete: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ DELETE -> `ukV401Prefix` / "pisp" / "domestic-vrp-consents" / consentId => + EndpointHelpers.executeDelete(req) { cc => Future.successful(()) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(domesticVrpConsentsDelete), + "DELETE", + "/pisp/domestic-vrp-consents/CONSENT_ID", + "Delete a Domestic VRP Consent", + """Enables a PISP to ask an ASPSP to delete a previously consented Domestic VRP Consent resource.""", + EmptyBody, + parseBody(EX_domesticVrpConsentsDelete), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic VRP Consents") :: Nil, + http4sPartialFunction = Some(domesticVrpConsentsDelete) + ) + + private val EX_domesticVrpConsentsPatch: String = """{ + "Data": { + "ReadRefundAccount": "Yes", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "AWAU", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ControlParameters": { + "ValidFromDateTime": "2020-01-01T00:00:00+00:00", + "ValidToDateTime": "2020-01-01T00:00:00+00:00", + "MaximumIndividualAmount": { + "Amount": "string", + "Currency": "string" + }, + "PeriodicLimits": [ + { + "PeriodType": "Day", + "PeriodAlignment": "Consent", + "Amount": "string", + "Currency": "string" + } + ], + "VRPType": [ + "string" + ], + "PSUAuthenticationMethods": [ + "string" + ], + "PSUInteractionTypes": [ + "InSession" + ], + "SupplementaryData": {} + }, + "Initiation": { + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ] + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": {} +}""" + lazy val domesticVrpConsentsPatch: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ PATCH -> `ukV401Prefix` / "pisp" / "domestic-vrp-consents" / consentId => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_domesticVrpConsentsPatch))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(domesticVrpConsentsPatch), + "PATCH", + "/pisp/domestic-vrp-consents/CONSENT_ID", + "Update an existing domestic VRP consent", + """Enables a PISP to update an existing Domestic VRP Consent resource by submitting a JSON Patch payload. + +This endpoint **must** only be used for the migration of Domestic VRP Consent resource data across API Standard versions where the ASPSP supports this PATCH function.""", + EmptyBody, + parseBody(EX_domesticVrpConsentsPatch), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic VRP Consents") :: Nil, + http4sPartialFunction = Some(domesticVrpConsentsPatch) + ) + + private val EXREQ_domesticVrpConsentsFundsConfirmation: String = """{ + "Data": { + "ConsentId": "string", + "Reference": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + } + } +}""" + private val EX_domesticVrpConsentsFundsConfirmation: String = """{ + "Data": { + "FundsConfirmationId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Reference": "string", + "FundsAvailableResult": { + "FundsAvailableDateTime": "2020-01-01T00:00:00+00:00", + "FundsAvailable": "Available" + }, + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + } + } +}""" + lazy val domesticVrpConsentsFundsConfirmation: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "domestic-vrp-consents" / consentId / "funds-confirmation" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_domesticVrpConsentsFundsConfirmation))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(domesticVrpConsentsFundsConfirmation), + "POST", + "/pisp/domestic-vrp-consents/CONSENT_ID/funds-confirmation", + "Confirm Funds Availability for a Domestic VRP", + """Enables a PISP to check whether a PSU has sufficient available funds for a Domestic VRP Payment.""", + parseBody(EXREQ_domesticVrpConsentsFundsConfirmation), + parseBody(EX_domesticVrpConsentsFundsConfirmation), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic VRP Consents") :: Nil, + http4sPartialFunction = Some(domesticVrpConsentsFundsConfirmation) + ) + + private val EXREQ_domesticVrpPost: String = """{ + "Data": { + "ConsentId": "string", + "PSUAuthenticationMethod": {}, + "PSUInteractionType": {}, + "VRPType": "string", + "Initiation": { + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ] + }, + "Instruction": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "LocalInstrument": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "SupplementaryData": {} + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + } +}""" + private val EX_domesticVrpPost: String = """{ + "Data": { + "DomesticVRPId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "RCVD", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "UK.OBIE.CHAPSOut", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ] + }, + "Instruction": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "LocalInstrument": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "SupplementaryData": {} + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": {} +}""" + lazy val domesticVrpPost: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV401Prefix` / "pisp" / "domestic-vrps" => + EndpointHelpers.executeFutureCreated(req)(Future.successful(parseBody(EX_domesticVrpPost))) + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(domesticVrpPost), + "POST", + "/pisp/domestic-vrps", + "Initiate a Domestic VRP", + """Enables a PISP to initiate a Domestic VRP transaction under an already PSU-approved Domestic VRP Consent.""", + parseBody(EXREQ_domesticVrpPost), + parseBody(EX_domesticVrpPost), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic VRPs") :: Nil, + http4sPartialFunction = Some(domesticVrpPost) + ) + + private val EX_domesticVrpGet: String = """{ + "Data": { + "DomesticVRPId": "string", + "ConsentId": "string", + "CreationDateTime": "2020-01-01T00:00:00+00:00", + "Status": "RCVD", + "StatusReason": [ + { + "StatusReasonCode": "ERIN", + "StatusReasonDescription": "string", + "Path": "string" + } + ], + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedExecutionDateTime": "2020-01-01T00:00:00+00:00", + "ExpectedSettlementDateTime": "2020-01-01T00:00:00+00:00", + "Refund": { + "Account": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string" + } + }, + "Charges": [ + { + "ChargeBearer": "BorneByCreditor", + "Type": "UK.OBIE.CHAPSOut", + "Amount": { + "Amount": "string", + "Currency": "string" + } + } + ], + "Initiation": { + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "UltimateDebtor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "RegulatoryReporting": [ + { + "DebitCreditReportingIndicator": "CRED", + "Authority": { + "Name": "string", + "CountryCode": "string" + }, + "Details": [ + { + "Type": "string", + "Date": {}, + "Country": {}, + "Amount": {}, + "Information": [] + } + ] + } + ] + }, + "Instruction": { + "InstructionIdentification": "string", + "EndToEndIdentification": "string", + "RemittanceInformation": { + "Structured": [ + { + "ReferredDocumentInformation": [ + {} + ], + "ReferredDocumentAmount": "string", + "CreditorReferenceInformation": { + "Code": {}, + "Issuer": "string", + "Reference": "string" + }, + "Invoicer": "string", + "Invoicee": "string", + "TaxRemittance": "string", + "AdditionalRemittanceInformation": [ + "string" + ] + } + ], + "Unstructured": [ + "string" + ] + }, + "LocalInstrument": "string", + "InstructedAmount": { + "Amount": "string", + "Currency": "string" + }, + "CreditorPostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + }, + "CreditorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + }, + "UltimateCreditor": { + "Name": "string", + "Identification": "string", + "LEI": "IZ9Q00LZEVUKWCQY6X15", + "SchemeName": "string", + "PostalAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "SupplementaryData": {} + }, + "DebtorAccount": { + "SchemeName": "string", + "Identification": "string", + "Name": "string", + "SecondaryIdentification": "string", + "Proxy": { + "Identification": "string", + "Code": "TELE", + "Type": "string" + } + } + }, + "Risk": { + "PaymentContextCode": "BillingGoodsAndServicesInAdvance", + "MerchantCategoryCode": "string", + "MerchantCustomerIdentification": "string", + "ContractPresentIndicator": true, + "BeneficiaryPrepopulatedIndicator": true, + "PaymentPurposeCode": "BKDF", + "CategoryPurposeCode": "BONU", + "BeneficiaryAccountType": "Business", + "DeliveryAddress": { + "AddressType": "BIZZ", + "Department": "string", + "SubDepartment": "string", + "StreetName": "string", + "BuildingNumber": "string", + "BuildingName": "string", + "Floor": "string", + "UnitNumber": "string", + "Room": "string", + "PostBox": "string", + "TownLocationName": "string", + "DistrictName": "string", + "CareOf": "string", + "PostCode": "string", + "TownName": "string", + "CountrySubDivision": "string", + "Country": "string", + "AddressLine": [ + "string" + ] + } + }, + "Links": { + "Self": "string", + "First": "string", + "Prev": "string", + "Next": "string", + "Last": "string" + }, + "Meta": {} +}""" + lazy val domesticVrpGet: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-vrps" / domesticVRPId => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_domesticVrpGet)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(domesticVrpGet), + "GET", + "/pisp/domestic-vrps/DOMESTIC_V_R_P_ID", + "Get a Domestic VRP", + """Enables a PISP to retrieve the status of a Domestic VRP transaction.""", + EmptyBody, + parseBody(EX_domesticVrpGet), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic VRPs") :: Nil, + http4sPartialFunction = Some(domesticVrpGet) + ) + + private val EX_domesticVrpPaymentDetailsGet: String = """{ + "Data": { + "PaymentStatus": [ + { + "PaymentTransactionId": "string", + "Status": "CANC", + "StatusUpdateDateTime": "2020-01-01T00:00:00+00:00", + "StatusDetail": { + "LocalInstrument": "string", + "Status": "CANC", + "StatusReason": "string", + "StatusReasonDescription": "string" + } + } + ] + } +}""" + lazy val domesticVrpPaymentDetailsGet: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV401Prefix` / "pisp" / "domestic-vrps" / domesticVRPId / "payment-details" => + EndpointHelpers.withUser(req) { (u, cc) => Future.successful(parseBody(EX_domesticVrpPaymentDetailsGet)) } + } + resourceDocs += ResourceDoc( + implementedInApiVersion, + nameOf(domesticVrpPaymentDetailsGet), + "GET", + "/pisp/domestic-vrps/DOMESTIC_V_R_P_ID/payment-details", + "Get details of a Domestic VRP Payment", + """Enables a PISP to retrieve detailed information on the status of a Domestic VRP transaction.""", + EmptyBody, + parseBody(EX_domesticVrpPaymentDetailsGet), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Domestic VRPs") :: Nil, + http4sPartialFunction = Some(domesticVrpPaymentDetailsGet) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + domesticVrpConsentsPost(req) + .orElse(domesticVrpConsentsGet(req) + .orElse(domesticVrpConsentsPut(req) + .orElse(domesticVrpConsentsDelete(req) + .orElse(domesticVrpConsentsPatch(req) + .orElse(domesticVrpConsentsFundsConfirmation(req) + .orElse(domesticVrpPost(req) + .orElse(domesticVrpGet(req) + .orElse(domesticVrpPaymentDetailsGet(req))))))))) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/OBP_UKOpenBanking_401.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/OBP_UKOpenBanking_401.scala new file mode 100644 index 0000000000..7334dfd096 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v4_0_1/OBP_UKOpenBanking_401.scala @@ -0,0 +1,23 @@ +package code.api.UKOpenBanking.v4_0_1 + +import code.api.OBPRestHelper +import code.api.util.APIUtil.ResourceDoc +import code.api.util.ScannedApis +import code.util.Helper.MdcLoggable +import com.openbankproject.commons.util.{ApiVersion, ApiVersionStatus, ScannedApiVersion} + +import scala.collection.mutable.ArrayBuffer + +/** + * UK Open Banking Read/Write v4.0.1 — ScannedApis discovery marker. + * + * Mirrors OBP_UKOpenBanking_310: the routes are served natively by http4s + * (Http4sUKOBv401.wrappedRoutes, wired in Http4sApp.baseServices); this object + * only exposes apiVersion + allResourceDocs so classpath scanning auto-registers + * the version and its resource docs / swagger. It carries no Lift routes. + */ +object OBP_UKOpenBanking_401 extends OBPRestHelper with MdcLoggable with ScannedApis { + override val apiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV401 + val versionStatus: String = ApiVersionStatus.DRAFT.toString + override val allResourceDocs: ArrayBuffer[ResourceDoc] = Http4sUKOBv401.resourceDocs +} diff --git a/obp-api/src/main/scala/code/api/util/APIUtil.scala b/obp-api/src/main/scala/code/api/util/APIUtil.scala index b64e43559d..9d029af973 100644 --- a/obp-api/src/main/scala/code/api/util/APIUtil.scala +++ b/obp-api/src/main/scala/code/api/util/APIUtil.scala @@ -34,6 +34,7 @@ import code.accountholders.AccountHolders import code.api.Constant._ import code.api.UKOpenBanking.v2_0_0.OBP_UKOpenBanking_200 import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310 +import code.api.UKOpenBanking.v4_0_1.OBP_UKOpenBanking_401 import code.api._ import code.api.berlin.group.ConstantsBG import code.api.berlin.group.v1_3.JSONFactory_BERLIN_GROUP_1_3.{ErrorMessageBG, ErrorMessagesBG} @@ -4736,6 +4737,7 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{ lazy val allStaticResourceDocs = (code.api.util.http4s.Http4sResourceDocAggregation.v600 ++ OBP_UKOpenBanking_200.allResourceDocs ++ OBP_UKOpenBanking_310.allResourceDocs + ++ OBP_UKOpenBanking_401.allResourceDocs // Commented out: Lift endpoints migrated off / removed (Polish, STET, AUOpenBanking, MxOF/CNBV9, BahrainOBF) // ++ code.api.Polish.v2_1_1_1.OBP_PAPI_2_1_1_1.allResourceDocs // ++ code.api.STET.v1_4.OBP_STET_1_4.allResourceDocs diff --git a/obp-api/src/main/scala/code/api/util/http4s/Http4sApp.scala b/obp-api/src/main/scala/code/api/util/http4s/Http4sApp.scala index 2f14f5ed73..72ca127695 100644 --- a/obp-api/src/main/scala/code/api/util/http4s/Http4sApp.scala +++ b/obp-api/src/main/scala/code/api/util/http4s/Http4sApp.scala @@ -77,6 +77,7 @@ object Http4sApp extends MdcLoggable { // are migrated to http4s. private val ukV20Routes: HttpRoutes[IO] = gate(ApiVersion.ukOpenBankingV20, code.api.UKOpenBanking.v2_0_0.Http4sUKOBv200.wrappedRoutes) private val ukV31Routes: HttpRoutes[IO] = gate(ApiVersion.ukOpenBankingV31, code.api.UKOpenBanking.v3_1_0.Http4sUKOBv310.wrappedRoutes) + private val ukV401Routes: HttpRoutes[IO] = gate(ApiVersion.ukOpenBankingV401, code.api.UKOpenBanking.v4_0_1.Http4sUKOBv401.wrappedRoutes) // JSON 404 for all unmatched paths — terminal entry in baseServices. private val notFoundCatchAll: HttpRoutes[IO] = HttpRoutes[IO] { req => @@ -130,6 +131,7 @@ object Http4sApp extends MdcLoggable { .orElse(code.api.berlin.group.v2.Http4sBGv2.wrappedRoutes.run(req)) .orElse(ukV20Routes.run(req)) .orElse(ukV31Routes.run(req)) + .orElse(ukV401Routes.run(req)) .orElse(code.api.berlin.group.v1_3.Http4sBGv13.wrappedRoutes.run(req)) .orElse(code.api.berlin.group.v1_3.Http4sBGv13Alias.wrappedRoutes.run(req)) .orElse(v400Routes.run(req)) diff --git a/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401AccountInfoTests.scala b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401AccountInfoTests.scala new file mode 100644 index 0000000000..ebc20e1009 --- /dev/null +++ b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401AccountInfoTests.scala @@ -0,0 +1,246 @@ +package code.api.UKOpenBanking.v4_0_1 + +import org.scalatest.Tag + +// AUTO-GENERATED test suite for UK Open Banking Read/Write v4.0.1 (AccountInfo). +// Mirrors UKOpenBankingV310AisTests: one feature per endpoint, two scenarios +// (authenticated -> deterministic success code; unauthenticated -> 401). +// Endpoints are static spec-faithful scaffolds, so success codes are exact. +class UKOpenBankingV401AccountInfoTests extends UKOpenBankingV401ServerSetup { + + object UKOpenBankingV401AccountInfo extends Tag("UKOpenBankingV401AccountInfo") + val emptyBody = "{}" + + feature("UKOB v4.0.1 POST /aisp/account-access-consents") { + scenario("authenticated -> 201", UKOpenBankingV401AccountInfo) { + postAuthed(emptyBody, "aisp", "account-access-consents").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + postUnauthed(emptyBody, "aisp", "account-access-consents").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/account-access-consents/CONSENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "account-access-consents", "fake-consentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "account-access-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 DELETE /aisp/account-access-consents/CONSENT_ID") { + scenario("authenticated -> 204", UKOpenBankingV401AccountInfo) { + deleteAuthed("aisp", "account-access-consents", "fake-consentid").code should equal(204) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + deleteUnauthed("aisp", "account-access-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/balances") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "balances").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "balances").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/beneficiaries") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "beneficiaries").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "beneficiaries").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/direct-debits") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "direct-debits").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "direct-debits").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/offers") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "offers").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "offers").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/parties") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "parties").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "parties").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/party") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "party").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "party").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/product") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "product").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "product").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/scheduled-payments") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "scheduled-payments").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "scheduled-payments").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/standing-orders") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "standing-orders").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "standing-orders").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/statements") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "statements").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "statements").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/statements/STATEMENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "statements", "fake-statementid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "statements", "fake-statementid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/statements/STATEMENT_ID/file") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "statements", "fake-statementid", "file").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "statements", "fake-statementid", "file").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/statements/STATEMENT_ID/transactions") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "statements", "fake-statementid", "transactions").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "statements", "fake-statementid", "transactions").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/accounts/ACCOUNT_ID/transactions") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "accounts", "fake-accountid", "transactions").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "accounts", "fake-accountid", "transactions").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/balances") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "balances").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "balances").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/beneficiaries") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "beneficiaries").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "beneficiaries").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/direct-debits") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "direct-debits").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "direct-debits").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/offers") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "offers").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "offers").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/party") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "party").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "party").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/products") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "products").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "products").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/scheduled-payments") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "scheduled-payments").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "scheduled-payments").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/standing-orders") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "standing-orders").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "standing-orders").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/statements") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "statements").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "statements").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /aisp/transactions") { + scenario("authenticated -> 200", UKOpenBankingV401AccountInfo) { + getAuthed("aisp", "transactions").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401AccountInfo) { + getUnauthed("aisp", "transactions").code should equal(401) + } + } +} diff --git a/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401ConfirmationFundsTests.scala b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401ConfirmationFundsTests.scala new file mode 100644 index 0000000000..f37f6b9d66 --- /dev/null +++ b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401ConfirmationFundsTests.scala @@ -0,0 +1,46 @@ +package code.api.UKOpenBanking.v4_0_1 + +import org.scalatest.Tag + +// AUTO-GENERATED test suite for UK Open Banking Read/Write v4.0.1 (ConfirmationFunds). +// Mirrors UKOpenBankingV310AisTests: one feature per endpoint, two scenarios +// (authenticated -> deterministic success code; unauthenticated -> 401). +// Endpoints are static spec-faithful scaffolds, so success codes are exact. +class UKOpenBankingV401ConfirmationFundsTests extends UKOpenBankingV401ServerSetup { + + object UKOpenBankingV401ConfirmationFunds extends Tag("UKOpenBankingV401ConfirmationFunds") + val emptyBody = "{}" + + feature("UKOB v4.0.1 POST /cbpii/funds-confirmation-consents") { + scenario("authenticated -> 201", UKOpenBankingV401ConfirmationFunds) { + postAuthed(emptyBody, "cbpii", "funds-confirmation-consents").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401ConfirmationFunds) { + postUnauthed(emptyBody, "cbpii", "funds-confirmation-consents").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /cbpii/funds-confirmation-consents/CONSENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401ConfirmationFunds) { + getAuthed("cbpii", "funds-confirmation-consents", "fake-consentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401ConfirmationFunds) { + getUnauthed("cbpii", "funds-confirmation-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 DELETE /cbpii/funds-confirmation-consents/CONSENT_ID") { + scenario("authenticated -> 204", UKOpenBankingV401ConfirmationFunds) { + deleteAuthed("cbpii", "funds-confirmation-consents", "fake-consentid").code should equal(204) + } + scenario("unauthenticated -> 401", UKOpenBankingV401ConfirmationFunds) { + deleteUnauthed("cbpii", "funds-confirmation-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /cbpii/funds-confirmations") { + scenario("authenticated -> 201", UKOpenBankingV401ConfirmationFunds) { + postAuthed(emptyBody, "cbpii", "funds-confirmations").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401ConfirmationFunds) { + postUnauthed(emptyBody, "cbpii", "funds-confirmations").code should equal(401) + } + } +} diff --git a/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401EventNotificationsTests.scala b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401EventNotificationsTests.scala new file mode 100644 index 0000000000..e2f37cdaa8 --- /dev/null +++ b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401EventNotificationsTests.scala @@ -0,0 +1,22 @@ +package code.api.UKOpenBanking.v4_0_1 + +import org.scalatest.Tag + +// AUTO-GENERATED test suite for UK Open Banking Read/Write v4.0.1 (EventNotifications). +// Mirrors UKOpenBankingV310AisTests: one feature per endpoint, two scenarios +// (authenticated -> deterministic success code; unauthenticated -> 401). +// Endpoints are static spec-faithful scaffolds, so success codes are exact. +class UKOpenBankingV401EventNotificationsTests extends UKOpenBankingV401ServerSetup { + + object UKOpenBankingV401EventNotifications extends Tag("UKOpenBankingV401EventNotifications") + val emptyBody = "{}" + + feature("UKOB v4.0.1 POST /event-notifications") { + scenario("authenticated -> 201", UKOpenBankingV401EventNotifications) { + postAuthed(emptyBody, "event-notifications").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401EventNotifications) { + postUnauthed(emptyBody, "event-notifications").code should equal(401) + } + } +} diff --git a/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401EventsTests.scala b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401EventsTests.scala new file mode 100644 index 0000000000..e9828bb664 --- /dev/null +++ b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401EventsTests.scala @@ -0,0 +1,54 @@ +package code.api.UKOpenBanking.v4_0_1 + +import org.scalatest.Tag + +// AUTO-GENERATED test suite for UK Open Banking Read/Write v4.0.1 (Events). +// Mirrors UKOpenBankingV310AisTests: one feature per endpoint, two scenarios +// (authenticated -> deterministic success code; unauthenticated -> 401). +// Endpoints are static spec-faithful scaffolds, so success codes are exact. +class UKOpenBankingV401EventsTests extends UKOpenBankingV401ServerSetup { + + object UKOpenBankingV401Events extends Tag("UKOpenBankingV401Events") + val emptyBody = "{}" + + feature("UKOB v4.0.1 GET /event-subscriptions") { + scenario("authenticated -> 200", UKOpenBankingV401Events) { + getAuthed("event-subscriptions").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Events) { + getUnauthed("event-subscriptions").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /event-subscriptions") { + scenario("authenticated -> 201", UKOpenBankingV401Events) { + postAuthed(emptyBody, "event-subscriptions").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Events) { + postUnauthed(emptyBody, "event-subscriptions").code should equal(401) + } + } + feature("UKOB v4.0.1 PUT /event-subscriptions/EVENT_SUBSCRIPTION_ID") { + scenario("authenticated -> 201", UKOpenBankingV401Events) { + putAuthed(emptyBody, "event-subscriptions", "fake-eventsubscriptionid").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Events) { + putUnauthed(emptyBody, "event-subscriptions", "fake-eventsubscriptionid").code should equal(401) + } + } + feature("UKOB v4.0.1 DELETE /event-subscriptions/EVENT_SUBSCRIPTION_ID") { + scenario("authenticated -> 204", UKOpenBankingV401Events) { + deleteAuthed("event-subscriptions", "fake-eventsubscriptionid").code should equal(204) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Events) { + deleteUnauthed("event-subscriptions", "fake-eventsubscriptionid").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /events") { + scenario("authenticated -> 201", UKOpenBankingV401Events) { + postAuthed(emptyBody, "events").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Events) { + postUnauthed(emptyBody, "events").code should equal(401) + } + } +} diff --git a/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401PaymentInitiationTests.scala b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401PaymentInitiationTests.scala new file mode 100644 index 0000000000..ce0dc97e5e --- /dev/null +++ b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401PaymentInitiationTests.scala @@ -0,0 +1,342 @@ +package code.api.UKOpenBanking.v4_0_1 + +import org.scalatest.Tag + +// AUTO-GENERATED test suite for UK Open Banking Read/Write v4.0.1 (PaymentInitiation). +// Mirrors UKOpenBankingV310AisTests: one feature per endpoint, two scenarios +// (authenticated -> deterministic success code; unauthenticated -> 401). +// Endpoints are static spec-faithful scaffolds, so success codes are exact. +class UKOpenBankingV401PaymentInitiationTests extends UKOpenBankingV401ServerSetup { + + object UKOpenBankingV401PaymentInitiation extends Tag("UKOpenBankingV401PaymentInitiation") + val emptyBody = "{}" + + feature("UKOB v4.0.1 POST /pisp/domestic-payment-consents") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "domestic-payment-consents").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "domestic-payment-consents").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-payment-consents/CONSENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "domestic-payment-consents", "fake-consentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "domestic-payment-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-payment-consents/CONSENT_ID/funds-confirmation") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "domestic-payment-consents", "fake-consentid", "funds-confirmation").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "domestic-payment-consents", "fake-consentid", "funds-confirmation").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/domestic-payments") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "domestic-payments").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "domestic-payments").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-payments/DOMESTIC_PAYMENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "domestic-payments", "fake-domesticpaymentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "domestic-payments", "fake-domesticpaymentid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-payments/DOMESTIC_PAYMENT_ID/payment-details") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "domestic-payments", "fake-domesticpaymentid", "payment-details").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "domestic-payments", "fake-domesticpaymentid", "payment-details").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/domestic-scheduled-payment-consents") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "domestic-scheduled-payment-consents").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "domestic-scheduled-payment-consents").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-scheduled-payment-consents/CONSENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "domestic-scheduled-payment-consents", "fake-consentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "domestic-scheduled-payment-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/domestic-scheduled-payments") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "domestic-scheduled-payments").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "domestic-scheduled-payments").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-scheduled-payments/DOMESTIC_SCHEDULED_PAYMENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "domestic-scheduled-payments", "fake-domesticscheduledpaymentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "domestic-scheduled-payments", "fake-domesticscheduledpaymentid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-scheduled-payments/DOMESTIC_SCHEDULED_PAYMENT_ID/payment-details") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "domestic-scheduled-payments", "fake-domesticscheduledpaymentid", "payment-details").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "domestic-scheduled-payments", "fake-domesticscheduledpaymentid", "payment-details").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/domestic-standing-order-consents") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "domestic-standing-order-consents").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "domestic-standing-order-consents").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-standing-order-consents/CONSENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "domestic-standing-order-consents", "fake-consentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "domestic-standing-order-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/domestic-standing-orders") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "domestic-standing-orders").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "domestic-standing-orders").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-standing-orders/DOMESTIC_STANDING_ORDER_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "domestic-standing-orders", "fake-domesticstandingorderid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "domestic-standing-orders", "fake-domesticstandingorderid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-standing-orders/DOMESTIC_STANDING_ORDER_ID/payment-details") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "domestic-standing-orders", "fake-domesticstandingorderid", "payment-details").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "domestic-standing-orders", "fake-domesticstandingorderid", "payment-details").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/file-payment-consents") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "file-payment-consents").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "file-payment-consents").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/file-payment-consents/CONSENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "file-payment-consents", "fake-consentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "file-payment-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/file-payment-consents/CONSENT_ID/file") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "file-payment-consents", "fake-consentid", "file").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "file-payment-consents", "fake-consentid", "file").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/file-payment-consents/CONSENT_ID/file") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "file-payment-consents", "fake-consentid", "file").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "file-payment-consents", "fake-consentid", "file").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/file-payments") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "file-payments").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "file-payments").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/file-payments/FILE_PAYMENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "file-payments", "fake-filepaymentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "file-payments", "fake-filepaymentid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/file-payments/FILE_PAYMENT_ID/payment-details") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "file-payments", "fake-filepaymentid", "payment-details").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "file-payments", "fake-filepaymentid", "payment-details").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/file-payments/FILE_PAYMENT_ID/report-file") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "file-payments", "fake-filepaymentid", "report-file").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "file-payments", "fake-filepaymentid", "report-file").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/international-payment-consents") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "international-payment-consents").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "international-payment-consents").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/international-payment-consents/CONSENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "international-payment-consents", "fake-consentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "international-payment-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/international-payment-consents/CONSENT_ID/funds-confirmation") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "international-payment-consents", "fake-consentid", "funds-confirmation").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "international-payment-consents", "fake-consentid", "funds-confirmation").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/international-payments") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "international-payments").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "international-payments").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/international-payments/INTERNATIONAL_PAYMENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "international-payments", "fake-internationalpaymentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "international-payments", "fake-internationalpaymentid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/international-payments/INTERNATIONAL_PAYMENT_ID/payment-details") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "international-payments", "fake-internationalpaymentid", "payment-details").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "international-payments", "fake-internationalpaymentid", "payment-details").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/international-scheduled-payment-consents") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "international-scheduled-payment-consents").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "international-scheduled-payment-consents").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/international-scheduled-payment-consents/CONSENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "international-scheduled-payment-consents", "fake-consentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "international-scheduled-payment-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/international-scheduled-payment-consents/CONSENT_ID/funds-confirmation") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "international-scheduled-payment-consents", "fake-consentid", "funds-confirmation").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "international-scheduled-payment-consents", "fake-consentid", "funds-confirmation").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/international-scheduled-payments") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "international-scheduled-payments").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "international-scheduled-payments").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/international-scheduled-payments/INTERNATIONAL_SCHEDULED_PAYMENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "international-scheduled-payments", "fake-internationalscheduledpaymentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "international-scheduled-payments", "fake-internationalscheduledpaymentid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/international-scheduled-payments/INTERNATIONAL_SCHEDULED_PAYMENT_ID/payment-details") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "international-scheduled-payments", "fake-internationalscheduledpaymentid", "payment-details").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "international-scheduled-payments", "fake-internationalscheduledpaymentid", "payment-details").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/international-standing-order-consents") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "international-standing-order-consents").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "international-standing-order-consents").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/international-standing-order-consents/CONSENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "international-standing-order-consents", "fake-consentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "international-standing-order-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/international-standing-orders") { + scenario("authenticated -> 201", UKOpenBankingV401PaymentInitiation) { + postAuthed(emptyBody, "pisp", "international-standing-orders").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + postUnauthed(emptyBody, "pisp", "international-standing-orders").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/international-standing-orders/INTERNATIONAL_STANDING_ORDER_PAYMENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "international-standing-orders", "fake-internationalstandingorderpaymentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "international-standing-orders", "fake-internationalstandingorderpaymentid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/international-standing-orders/INTERNATIONAL_STANDING_ORDER_PAYMENT_ID/payment-details") { + scenario("authenticated -> 200", UKOpenBankingV401PaymentInitiation) { + getAuthed("pisp", "international-standing-orders", "fake-internationalstandingorderpaymentid", "payment-details").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401PaymentInitiation) { + getUnauthed("pisp", "international-standing-orders", "fake-internationalstandingorderpaymentid", "payment-details").code should equal(401) + } + } +} diff --git a/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401ServerSetup.scala b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401ServerSetup.scala new file mode 100644 index 0000000000..5f8dcae965 --- /dev/null +++ b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401ServerSetup.scala @@ -0,0 +1,40 @@ +package code.api.UKOpenBanking.v4_0_1 + +import code.api.util.APIUtil.OAuth._ +import code.setup.{APIResponse, DefaultUsers, ServerSetupWithTestData} +import code.setup.OBPReq + +/** + * Shared setup + request helpers for the UK Open Banking v4.0.1 test suites. + * + * Mirrors UKOpenBankingV310ServerSetup. Base path is `/open-banking/v4.0.1` + * (derived from ScannedApiVersion("open-banking","UK","v4.0.1")). The `*Authed` + * helpers attach the DirectLogin credentials of `user1`; the `*Unauthed` helpers + * send none so the endpoint's ResourceDocMiddleware auth check (every UK v4.0.1 + * endpoint declares AuthenticatedUserIsRequired) fires with a 401. + * + * Adds put/patch helpers on top of v3.1's get/post/delete because v4.0.1 has + * PUT + PATCH endpoints (VRP/payment updates). + */ +trait UKOpenBankingV401ServerSetup extends ServerSetupWithTestData with DefaultUsers { + + def v401Request: OBPReq = baseRequest / "open-banking" / "v4.0.1" + + // Build a request from path segments, e.g. v401("aisp", "accounts", accountId, "balances"). + def v401(segments: String*): OBPReq = segments.foldLeft(v401Request)((req, s) => req / s) + + def getAuthed(segments: String*): APIResponse = makeGetRequest(v401(segments: _*).GET <@ (user1)) + def getUnauthed(segments: String*): APIResponse = makeGetRequest(v401(segments: _*).GET) + + def postAuthed(body: String, segments: String*): APIResponse = makePostRequest(v401(segments: _*).POST <@ (user1), body) + def postUnauthed(body: String, segments: String*): APIResponse = makePostRequest(v401(segments: _*).POST, body) + + def putAuthed(body: String, segments: String*): APIResponse = makePutRequest(v401(segments: _*).PUT <@ (user1), body) + def putUnauthed(body: String, segments: String*): APIResponse = makePutRequest(v401(segments: _*).PUT, body) + + def patchAuthed(body: String, segments: String*): APIResponse = makePatchRequest(v401(segments: _*).PATCH <@ (user1), body) + def patchUnauthed(body: String, segments: String*): APIResponse = makePatchRequest(v401(segments: _*).PATCH, body) + + def deleteAuthed(segments: String*): APIResponse = makeDeleteRequest(v401(segments: _*).DELETE <@ (user1)) + def deleteUnauthed(segments: String*): APIResponse = makeDeleteRequest(v401(segments: _*).DELETE) +} diff --git a/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401VrpTests.scala b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401VrpTests.scala new file mode 100644 index 0000000000..54581431a3 --- /dev/null +++ b/obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401VrpTests.scala @@ -0,0 +1,86 @@ +package code.api.UKOpenBanking.v4_0_1 + +import org.scalatest.Tag + +// AUTO-GENERATED test suite for UK Open Banking Read/Write v4.0.1 (Vrp). +// Mirrors UKOpenBankingV310AisTests: one feature per endpoint, two scenarios +// (authenticated -> deterministic success code; unauthenticated -> 401). +// Endpoints are static spec-faithful scaffolds, so success codes are exact. +class UKOpenBankingV401VrpTests extends UKOpenBankingV401ServerSetup { + + object UKOpenBankingV401Vrp extends Tag("UKOpenBankingV401Vrp") + val emptyBody = "{}" + + feature("UKOB v4.0.1 POST /pisp/domestic-vrp-consents") { + scenario("authenticated -> 201", UKOpenBankingV401Vrp) { + postAuthed(emptyBody, "pisp", "domestic-vrp-consents").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Vrp) { + postUnauthed(emptyBody, "pisp", "domestic-vrp-consents").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-vrp-consents/CONSENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV401Vrp) { + getAuthed("pisp", "domestic-vrp-consents", "fake-consentid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Vrp) { + getUnauthed("pisp", "domestic-vrp-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 PUT /pisp/domestic-vrp-consents/CONSENT_ID") { + scenario("authenticated -> 201", UKOpenBankingV401Vrp) { + putAuthed(emptyBody, "pisp", "domestic-vrp-consents", "fake-consentid").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Vrp) { + putUnauthed(emptyBody, "pisp", "domestic-vrp-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 DELETE /pisp/domestic-vrp-consents/CONSENT_ID") { + scenario("authenticated -> 204", UKOpenBankingV401Vrp) { + deleteAuthed("pisp", "domestic-vrp-consents", "fake-consentid").code should equal(204) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Vrp) { + deleteUnauthed("pisp", "domestic-vrp-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 PATCH /pisp/domestic-vrp-consents/CONSENT_ID") { + scenario("authenticated -> 201", UKOpenBankingV401Vrp) { + patchAuthed(emptyBody, "pisp", "domestic-vrp-consents", "fake-consentid").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Vrp) { + patchUnauthed(emptyBody, "pisp", "domestic-vrp-consents", "fake-consentid").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/domestic-vrp-consents/CONSENT_ID/funds-confirmation") { + scenario("authenticated -> 201", UKOpenBankingV401Vrp) { + postAuthed(emptyBody, "pisp", "domestic-vrp-consents", "fake-consentid", "funds-confirmation").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Vrp) { + postUnauthed(emptyBody, "pisp", "domestic-vrp-consents", "fake-consentid", "funds-confirmation").code should equal(401) + } + } + feature("UKOB v4.0.1 POST /pisp/domestic-vrps") { + scenario("authenticated -> 201", UKOpenBankingV401Vrp) { + postAuthed(emptyBody, "pisp", "domestic-vrps").code should equal(201) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Vrp) { + postUnauthed(emptyBody, "pisp", "domestic-vrps").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-vrps/DOMESTIC_V_R_P_ID") { + scenario("authenticated -> 200", UKOpenBankingV401Vrp) { + getAuthed("pisp", "domestic-vrps", "fake-domesticvrpid").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Vrp) { + getUnauthed("pisp", "domestic-vrps", "fake-domesticvrpid").code should equal(401) + } + } + feature("UKOB v4.0.1 GET /pisp/domestic-vrps/DOMESTIC_V_R_P_ID/payment-details") { + scenario("authenticated -> 200", UKOpenBankingV401Vrp) { + getAuthed("pisp", "domestic-vrps", "fake-domesticvrpid", "payment-details").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV401Vrp) { + getUnauthed("pisp", "domestic-vrps", "fake-domesticvrpid", "payment-details").code should equal(401) + } + } +} diff --git a/obp-api/src/test/scala/code/util/ApiVersionUtilsTest.scala b/obp-api/src/test/scala/code/util/ApiVersionUtilsTest.scala index 06dde3a94c..f53ac80171 100644 --- a/obp-api/src/test/scala/code/util/ApiVersionUtilsTest.scala +++ b/obp-api/src/test/scala/code/util/ApiVersionUtilsTest.scala @@ -22,6 +22,7 @@ class ApiVersionUtilsTest extends V400ServerSetup { //NOTE, when we added the new version, better fix this number manually. and also check the versions // 26 -> 20: removed Lift standards STET v1.4, Polish v2.1.1.1, AUOpenBanking v1.0.0, // BahrainOBF v1.0.0, MxOF v1.0.0 and CNBV9 v1.0.0 (6 scanned versions). - versions.length shouldBe(20) + // 20 -> 21: added UK Open Banking Read/Write v4.0.1 (OBP_UKOpenBanking_401). + versions.length shouldBe(21) }} } \ No newline at end of file diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/util/ApiVersion.scala b/obp-commons/src/main/scala/com/openbankproject/commons/util/ApiVersion.scala index 013b310d8f..75a0a3b3f0 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/util/ApiVersion.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/util/ApiVersion.scala @@ -148,6 +148,7 @@ object ApiVersion { val auOpenBankingV100 = ScannedApiVersion("cds-au", "AU", "v1.0.0") val ukOpenBankingV20 = ScannedApiVersion("open-banking", "UK", "v2.0") val ukOpenBankingV31 = ScannedApiVersion("open-banking", "UK", "v3.1") + val ukOpenBankingV401 = ScannedApiVersion("open-banking", "UK", "v4.0.1") val stetV14 = ScannedApiVersion("stet", "STET", "v1.4") val cdsAuV100 = ScannedApiVersion("cds-au", "AU", "v1.0.0") val polishApiV2111 = ScannedApiVersion("polish-api", "PAPI", "v2.1.1.1") diff --git a/pom.xml b/pom.xml index abc6ac71a2..c460355604 100644 --- a/pom.xml +++ b/pom.xml @@ -2,6 +2,7 @@ + 4.0.0 com.tesobe obp-parent