From 4163fe4613b7901b1085f88dcab4cd445c48925a Mon Sep 17 00:00:00 2001 From: Hongwei Date: Wed, 18 Mar 2026 14:24:05 +0100 Subject: [PATCH 1/7] refactor/tweaked the default request and response queue names --- src/main/scala/com/tesobe/obp/adapter/config/Config.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/tesobe/obp/adapter/config/Config.scala b/src/main/scala/com/tesobe/obp/adapter/config/Config.scala index ceaf1b6..ef5f3e9 100644 --- a/src/main/scala/com/tesobe/obp/adapter/config/Config.scala +++ b/src/main/scala/com/tesobe/obp/adapter/config/Config.scala @@ -105,9 +105,9 @@ object Config { ) val queueConfig = QueueConfig( - requestQueue = env("RABBITMQ_REQUEST_QUEUE", "obp.request"), + requestQueue = env("RABBITMQ_REQUEST_QUEUE", "obp_rpc_queue"), responseQueue = - env("RABBITMQ_RESPONSE_QUEUE", "obp.response"), + env("RABBITMQ_RESPONSE_QUEUE", "obp_reply_queue"), prefetchCount = env("RABBITMQ_PREFETCH_COUNT", "10").toInt, durable = env("RABBITMQ_QUEUE_DURABLE", "true").toBoolean, autoDelete = From 246ce7109a7d6f63da145b40fd8969c4fa8c8ea9 Mon Sep 17 00:00:00 2001 From: Hongwei Date: Wed, 18 Mar 2026 21:06:29 +0100 Subject: [PATCH 2/7] refactor/mocked more method in adatper side --- .env.example | 4 +- pom.xml | 6 + .../implementations/MockLocalAdapter.scala | 384 ++++++++++++++++-- .../MockLocalAdapterSpec.scala | 276 +++++++++++++ 4 files changed, 633 insertions(+), 37 deletions(-) create mode 100644 src/test/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapterSpec.scala diff --git a/.env.example b/.env.example index 1cfb670..d0b9846 100644 --- a/.env.example +++ b/.env.example @@ -17,8 +17,8 @@ RABBITMQ_USERNAME=guest RABBITMQ_PASSWORD=guest # Queue names (must match OBP-API configuration) -RABBITMQ_REQUEST_QUEUE=obp.request -RABBITMQ_RESPONSE_QUEUE=obp.response +RABBITMQ_REQUEST_QUEUE=obp_rpc_queue +RABBITMQ_RESPONSE_QUEUE=obp_reply_queue # Performance tuning RABBITMQ_PREFETCH_COUNT=10 diff --git a/pom.xml b/pom.xml index 7b28cc5..d4617b5 100644 --- a/pom.xml +++ b/pom.xml @@ -192,6 +192,12 @@ ${scalatest.version} test + + org.scalatestplus + scalacheck-1-17_${scala.version} + 3.2.18.0 + test + org.typelevel cats-effect-testing-scalatest_${scala.version} diff --git a/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala b/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala index 0766b04..2c56c12 100644 --- a/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala +++ b/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala @@ -46,13 +46,18 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { ): IO[LocalAdapterResult] = { process match { - case "obp.getAdapterInfo" => getAdapterInfo(callContext) - case "obp.getBank" => getBank(data, callContext) - case "obp.getBankAccount" => getBankAccount(data, callContext) - case "obp.getTransaction" => getTransaction(data, callContext) - case "obp.getTransactions" => getTransactions(data, callContext) - case "obp.checkFundsAvailable" => checkFundsAvailable(data, callContext) - case "obp.makePayment" => makePayment(data, callContext) + case "obp.getAdapterInfo" | "obp_get_adapter_info" => getAdapterInfo(callContext) + case "obp.getBank" | "obp_get_bank" => getBank(data, callContext) + case "obp.getBanks" | "obp_get_banks" => getBanks(data, callContext) + case "obp.getBankAccount" | "obp_get_bank_account" => getBankAccount(data, callContext) + case "obp.getAccounts" | "obp_get_core_bank_accounts" => getCoreBankAccounts(data, callContext) + case "obp.getBankAccounts" | "obp_get_bank_accounts" => getBankAccounts(data, callContext) + case "obp.getBankAccountsForUser" | "obp_get_bank_accounts_for_user" => getBankAccountsForUser(data, callContext) + case "obp.getTransaction" | "obp_get_transaction" => getTransaction(data, callContext) + case "obp.getTransactions" | "obp_get_transactions" => getTransactions(data, callContext) + case "obp.checkFundsAvailable" | "obp_check_funds_available" => checkFundsAvailable(data, callContext) + case "obp.makePayment" | "obp_make_payment" => makePayment(data, callContext) + case "obp.makePaymentv210" | "obp_make_paymentv210" => makePaymentv210(data, callContext) case _ => handleUnsupported(process, callContext) } } @@ -92,19 +97,170 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { // ==================== EXAMPLE IMPLEMENTATIONS ==================== + private def getBanks(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { + telemetry.debug(s"Getting banks list", Some(callContext.correlationId)) *> + IO.pure( + LocalAdapterResult.success( + Json.arr( + Json.obj( + "bankId" -> Json.obj("value" -> Json.fromString("workshop-bank-001")), + "shortName" -> Json.fromString("Workshop Bank"), + "fullName" -> Json.fromString("Workshop Bank for OBP Demo"), + "logoUrl" -> Json.fromString("https://static.openbankproject.com/images/sandbox/bank_x.png"), + "websiteUrl" -> Json.fromString("https://workshop.openbankproject.com"), + "bankRoutingScheme" -> Json.fromString("BIC"), + "bankRoutingAddress" -> Json.fromString("WKSHBIC0"), + "swiftBic" -> Json.fromString("WKSHBIC0"), + "nationalIdentifier" -> Json.fromString("WORKSHOP001") + ), + Json.obj( + "bankId" -> Json.obj("value" -> Json.fromString("test-bank-002")), + "shortName" -> Json.fromString("Test Bank"), + "fullName" -> Json.fromString("Test Bank for Integration"), + "logoUrl" -> Json.fromString("https://static.openbankproject.com/images/sandbox/bank_y.png"), + "websiteUrl" -> Json.fromString("https://testbank.example.com"), + "bankRoutingScheme" -> Json.fromString("BIC"), + "bankRoutingAddress" -> Json.fromString("TSTBBIC0"), + "swiftBic" -> Json.fromString("TSTBBIC0"), + "nationalIdentifier" -> Json.fromString("TESTBANK002") + ) + ), + Nil + ) + ) + } + + private def getCoreBankAccounts(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { + val bankId = data("bankId").flatMap(_.asString).getOrElse("workshop-bank-001") + + telemetry.debug(s"Getting core bank accounts for bank: $bankId", Some(callContext.correlationId)) *> + IO.pure( + LocalAdapterResult.success( + Json.arr( + Json.obj( + "id" -> Json.fromString("acc-001"), + "label" -> Json.fromString("Alice Workshop Account"), + "bankId" -> Json.fromString(bankId), + "accountType" -> Json.fromString("CURRENT"), + "accountRoutings" -> Json.arr( + Json.obj( + "scheme" -> Json.fromString("IBAN"), + "address" -> Json.fromString("DE89370400440532013000") + ) + ) + ), + Json.obj( + "id" -> Json.fromString("acc-002"), + "label" -> Json.fromString("Bob Workshop Account"), + "bankId" -> Json.fromString(bankId), + "accountType" -> Json.fromString("CURRENT"), + "accountRoutings" -> Json.arr( + Json.obj( + "scheme" -> Json.fromString("IBAN"), + "address" -> Json.fromString("DE89370400440532013001") + ) + ) + ) + ), + Nil + ) + ) + } + + private def getBankAccountsForUser(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { + val username = data("username").flatMap(_.asString).getOrElse("workshop.user") + + telemetry.debug(s"Getting bank accounts for user: $username", Some(callContext.correlationId)) *> + IO.pure( + LocalAdapterResult.success( + Json.arr( + Json.obj( + "bankId" -> Json.fromString("workshop-bank-001"), + "branchId" -> Json.fromString("branch-001"), + "accountId" -> Json.fromString("acc-001"), + "accountNumber" -> Json.fromString("acc-001"), + "accountType" -> Json.fromString("CURRENT"), + "balanceAmount" -> Json.fromString("5000.00"), + "balanceCurrency" -> Json.fromString("EUR"), + "owners" -> Json.arr(Json.fromString(username)), + "viewsToGenerate" -> Json.arr(Json.fromString("owner")), + "bankRoutingScheme" -> Json.fromString("IBAN"), + "bankRoutingAddress" -> Json.fromString("DE89370400440532013000"), + "branchRoutingScheme" -> Json.fromString("BRANCH_CODE"), + "branchRoutingAddress" -> Json.fromString("001"), + "accountRoutingScheme" -> Json.fromString("IBAN"), + "accountRoutingAddress" -> Json.fromString("DE89370400440532013000"), + "accountRouting" -> Json.obj( + "scheme" -> Json.fromString("IBAN"), + "address" -> Json.fromString("DE89370400440532013000") + ), + "accountRules" -> Json.arr() + ), + Json.obj( + "bankId" -> Json.fromString("workshop-bank-001"), + "branchId" -> Json.fromString("branch-001"), + "accountId" -> Json.fromString("acc-002"), + "accountNumber" -> Json.fromString("acc-002"), + "accountType" -> Json.fromString("CURRENT"), + "balanceAmount" -> Json.fromString("3000.00"), + "balanceCurrency" -> Json.fromString("EUR"), + "owners" -> Json.arr(Json.fromString(username)), + "viewsToGenerate" -> Json.arr(Json.fromString("owner")), + "bankRoutingScheme" -> Json.fromString("IBAN"), + "bankRoutingAddress" -> Json.fromString("DE89370400440532013001"), + "branchRoutingScheme" -> Json.fromString("BRANCH_CODE"), + "branchRoutingAddress" -> Json.fromString("001"), + "accountRoutingScheme" -> Json.fromString("IBAN"), + "accountRoutingAddress" -> Json.fromString("DE89370400440532013001"), + "accountRouting" -> Json.obj( + "scheme" -> Json.fromString("IBAN"), + "address" -> Json.fromString("DE89370400440532013001") + ), + "accountRules" -> Json.arr() + ) + ), + Nil + ) + ) + } + + private def makePaymentv210(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { + val amount = data("amount").flatMap(_.asString).getOrElse("0.00") + val currency = data("currency").flatMap(_.asString).getOrElse("EUR") + + telemetry.recordPaymentSuccess( + bankId = "workshop-bank-001", + amount = BigDecimal(amount), + currency = currency, + correlationId = callContext.correlationId + ) *> + telemetry.debug(s"Processing payment: $amount $currency", Some(callContext.correlationId)) *> + IO.pure( + LocalAdapterResult.success( + JsonObject( + "value" -> Json.fromString(s"tx-workshop-${System.currentTimeMillis()}") + ) + ) + ) + } + private def getBank(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { - // Extract bankId from the data payload - val bankId = data("bankId").flatMap(_.asString).getOrElse("unknown") + val bankId = data("bankId") + .flatMap(_.asObject).flatMap(_("value")).flatMap(_.asString) + .orElse(data("bankId").flatMap(_.asString)) + .getOrElse("unknown") telemetry.debug(s"Getting bank: $bankId", Some(callContext.correlationId)) *> IO.pure( LocalAdapterResult.success( JsonObject( - "bankId" -> Json.fromString(bankId), - "shortName" -> Json.fromString("Mock Bank"), - "fullName" -> Json.fromString("Mock Bank for Testing"), - "logoUrl" -> Json.fromString("https://static.openbankproject.com/images/sandbox/bank_x.png"), - "websiteUrl" -> Json.fromString("https://www.example.com") + "bankId" -> Json.obj("value" -> Json.fromString(bankId)), + "shortName" -> Json.fromString("Mock Bank"), + "fullName" -> Json.fromString("Mock Bank for Testing"), + "logoUrl" -> Json.fromString("https://static.openbankproject.com/images/sandbox/bank_x.png"), + "websiteUrl" -> Json.fromString("https://www.example.com"), + "bankRoutingScheme" -> Json.fromString("BIC"), + "bankRoutingAddress" -> Json.fromString("MOCKBIC0") ) ) ) @@ -139,6 +295,43 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { ) } + private def getBankAccounts(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { + val bankIdAccountIds = data("bankIdAccountIds").flatMap(_.asArray).getOrElse(Vector.empty) + + telemetry.debug(s"Getting ${bankIdAccountIds.size} bank accounts", Some(callContext.correlationId)) *> + IO.pure( + LocalAdapterResult.success( + Json.arr( + bankIdAccountIds.map { item => + val bankId = item.asObject.flatMap(_("bankId")).flatMap(_.asObject).flatMap(_("value")).flatMap(_.asString).getOrElse("workshop-bank-001") + val accountId = item.asObject.flatMap(_("accountId")).flatMap(_.asObject).flatMap(_("value")).flatMap(_.asString).getOrElse("acc-001") + + Json.obj( + "bankId" -> Json.obj("value" -> Json.fromString(bankId)), + "accountId" -> Json.obj("value" -> Json.fromString(accountId)), + "accountType" -> Json.fromString("CURRENT"), + "accountRoutings" -> Json.arr( + Json.obj( + "scheme" -> Json.fromString("IBAN"), + "address" -> Json.fromString(if (accountId == "acc-001") "DE89370400440532013000" else "DE89370400440532013001") + ) + ), + "branchId" -> Json.fromString("branch-001"), + "label" -> Json.fromString(if (accountId == "acc-001") "Alice Workshop Account" else "Bob Workshop Account"), + "currency" -> Json.fromString("EUR"), + "balance" -> Json.fromString(if (accountId == "acc-001") "5000.00" else "3000.00"), + "name" -> Json.fromString(if (accountId == "acc-001") "Alice Workshop Account" else "Bob Workshop Account"), + "number" -> Json.fromString(accountId), + "lastUpdate" -> Json.fromString("2024-03-18T00:00:00Z"), + "attributes" -> Json.arr() + ) + }: _* + ), + Nil + ) + ) + } + private def getTransaction(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { val transactionId = data("transactionId").flatMap(_.asString).getOrElse("unknown") @@ -161,33 +354,154 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { } private def getTransactions(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { - val accountId = data("accountId").flatMap(_.asString).getOrElse("unknown") + val accountId = data("bankIdAccountId").flatMap(_.asString) + .orElse(data("accountId").flatMap(_.asString)) + .getOrElse("acc-001") telemetry.debug(s"Getting transactions for account: $accountId", Some(callContext.correlationId)) *> IO.pure( LocalAdapterResult.success( - JsonObject( - "transactions" -> Json.arr( - Json.obj( - "transactionId" -> Json.fromString("tx-001"), - "accountId" -> Json.fromString(accountId), - "amount" -> Json.fromString("50.00"), - "currency" -> Json.fromString("EUR"), - "description" -> Json.fromString("Payment to merchant"), - "posted" -> Json.fromString("2025-01-14T10:30:00Z"), - "type" -> Json.fromString("DEBIT") + Json.arr( + Json.obj( + "uuid" -> Json.fromString("uuid-tx-001"), + "id" -> Json.obj("value" -> Json.fromString("tx-001")), + "thisAccount" -> Json.obj( + "accountId" -> Json.obj("value" -> Json.fromString(accountId)), + "accountType" -> Json.fromString("CURRENT"), + "balance" -> Json.fromDouble(4950.00).getOrElse(Json.fromString("4950.00")), + "currency" -> Json.fromString("EUR"), + "name" -> Json.fromString("Alice Workshop Account"), + "label" -> Json.fromString("Alice Workshop Account"), + "number" -> Json.fromString(accountId), + "bankId" -> Json.obj("value" -> Json.fromString("workshop-bank-001")), + "lastUpdate" -> Json.fromString("2025-01-14T00:00:00Z"), + "branchId" -> Json.fromString("branch-001"), + "accountRoutings" -> Json.arr( + Json.obj( + "scheme" -> Json.fromString("IBAN"), + "address" -> Json.fromString("DE89370400440532013000") + ) + ), + "accountRules" -> Json.arr(), + "accountHolder" -> Json.fromString("Alice") ), - Json.obj( - "transactionId" -> Json.fromString("tx-002"), - "accountId" -> Json.fromString(accountId), - "amount" -> Json.fromString("100.00"), - "currency" -> Json.fromString("EUR"), - "description" -> Json.fromString("Salary payment"), - "posted" -> Json.fromString("2025-01-13T09:00:00Z"), - "type" -> Json.fromString("CREDIT") - ) + "otherAccount" -> Json.obj( + "nationalIdentifier" -> Json.fromString("MERCHANT001"), + "kind" -> Json.fromString("DEBIT"), + "counterpartyId" -> Json.fromString("cp-merchant-001"), + "counterpartyName" -> Json.fromString("Online Shop GmbH"), + "thisBankId" -> Json.obj("value" -> Json.fromString("workshop-bank-001")), + "thisAccountId" -> Json.obj("value" -> Json.fromString(accountId)), + "otherBankRoutingScheme" -> Json.fromString("BIC"), + "otherBankRoutingAddress" -> Json.fromString("SHOPBIC0"), + "otherAccountRoutingScheme" -> Json.fromString("IBAN"), + "otherAccountRoutingAddress" -> Json.fromString("DE12345678901234567890"), + "otherAccountProvider" -> Json.fromString("OBP"), + "isBeneficiary" -> Json.fromBoolean(true) + ), + "transactionType" -> Json.fromString("DEBIT"), + "amount" -> Json.fromDouble(-50.00).getOrElse(Json.fromString("-50.00")), + "currency" -> Json.fromString("EUR"), + "description" -> Json.fromString("Online purchase - Online Shop GmbH"), + "startDate" -> Json.fromString("2025-01-14T10:30:00Z"), + "finishDate" -> Json.fromString("2025-01-14T10:30:05Z"), + "balance" -> Json.fromDouble(4950.00).getOrElse(Json.fromString("4950.00")), + "status" -> Json.fromString("COMPLETED") + ), + Json.obj( + "uuid" -> Json.fromString("uuid-tx-002"), + "id" -> Json.obj("value" -> Json.fromString("tx-002")), + "thisAccount" -> Json.obj( + "accountId" -> Json.obj("value" -> Json.fromString(accountId)), + "accountType" -> Json.fromString("CURRENT"), + "balance" -> Json.fromDouble(5000.00).getOrElse(Json.fromString("5000.00")), + "currency" -> Json.fromString("EUR"), + "name" -> Json.fromString("Alice Workshop Account"), + "label" -> Json.fromString("Alice Workshop Account"), + "number" -> Json.fromString(accountId), + "bankId" -> Json.obj("value" -> Json.fromString("workshop-bank-001")), + "lastUpdate" -> Json.fromString("2025-01-14T00:00:00Z"), + "branchId" -> Json.fromString("branch-001"), + "accountRoutings" -> Json.arr( + Json.obj( + "scheme" -> Json.fromString("IBAN"), + "address" -> Json.fromString("DE89370400440532013000") + ) + ), + "accountRules" -> Json.arr(), + "accountHolder" -> Json.fromString("Alice") + ), + "otherAccount" -> Json.obj( + "nationalIdentifier" -> Json.fromString("EMPLOYER001"), + "kind" -> Json.fromString("CREDIT"), + "counterpartyId" -> Json.fromString("cp-employer-001"), + "counterpartyName" -> Json.fromString("Employer Corp AG"), + "thisBankId" -> Json.obj("value" -> Json.fromString("workshop-bank-001")), + "thisAccountId" -> Json.obj("value" -> Json.fromString(accountId)), + "otherBankRoutingScheme" -> Json.fromString("BIC"), + "otherBankRoutingAddress" -> Json.fromString("EMPLBIC0"), + "otherAccountRoutingScheme" -> Json.fromString("IBAN"), + "otherAccountRoutingAddress" -> Json.fromString("DE98765432109876543210"), + "otherAccountProvider" -> Json.fromString("OBP"), + "isBeneficiary" -> Json.fromBoolean(false) + ), + "transactionType" -> Json.fromString("CREDIT"), + "amount" -> Json.fromDouble(3000.00).getOrElse(Json.fromString("3000.00")), + "currency" -> Json.fromString("EUR"), + "description" -> Json.fromString("Monthly salary - Employer Corp AG"), + "startDate" -> Json.fromString("2025-01-13T09:00:00Z"), + "finishDate" -> Json.fromString("2025-01-13T09:00:01Z"), + "balance" -> Json.fromDouble(5000.00).getOrElse(Json.fromString("5000.00")), + "status" -> Json.fromString("COMPLETED") + ), + Json.obj( + "uuid" -> Json.fromString("uuid-tx-003"), + "id" -> Json.obj("value" -> Json.fromString("tx-003")), + "thisAccount" -> Json.obj( + "accountId" -> Json.obj("value" -> Json.fromString(accountId)), + "accountType" -> Json.fromString("CURRENT"), + "balance" -> Json.fromDouble(2000.00).getOrElse(Json.fromString("2000.00")), + "currency" -> Json.fromString("EUR"), + "name" -> Json.fromString("Alice Workshop Account"), + "label" -> Json.fromString("Alice Workshop Account"), + "number" -> Json.fromString(accountId), + "bankId" -> Json.obj("value" -> Json.fromString("workshop-bank-001")), + "lastUpdate" -> Json.fromString("2025-01-14T00:00:00Z"), + "branchId" -> Json.fromString("branch-001"), + "accountRoutings" -> Json.arr( + Json.obj( + "scheme" -> Json.fromString("IBAN"), + "address" -> Json.fromString("DE89370400440532013000") + ) + ), + "accountRules" -> Json.arr(), + "accountHolder" -> Json.fromString("Alice") + ), + "otherAccount" -> Json.obj( + "nationalIdentifier" -> Json.fromString("COFFEE001"), + "kind" -> Json.fromString("DEBIT"), + "counterpartyId" -> Json.fromString("cp-coffee-001"), + "counterpartyName" -> Json.fromString("Brew & Co"), + "thisBankId" -> Json.obj("value" -> Json.fromString("workshop-bank-001")), + "thisAccountId" -> Json.obj("value" -> Json.fromString(accountId)), + "otherBankRoutingScheme" -> Json.fromString("BIC"), + "otherBankRoutingAddress" -> Json.fromString("BREWBIC0"), + "otherAccountRoutingScheme" -> Json.fromString("IBAN"), + "otherAccountRoutingAddress" -> Json.fromString("DE11223344556677889900"), + "otherAccountProvider" -> Json.fromString("OBP"), + "isBeneficiary" -> Json.fromBoolean(true) + ), + "transactionType" -> Json.fromString("DEBIT"), + "amount" -> Json.fromDouble(-25.50).getOrElse(Json.fromString("-25.50")), + "currency" -> Json.fromString("EUR"), + "description" -> Json.fromString("Coffee subscription - Brew & Co"), + "startDate" -> Json.fromString("2025-01-12T08:15:00Z"), + "finishDate" -> Json.fromString("2025-01-12T08:15:02Z"), + "balance" -> Json.fromDouble(2000.00).getOrElse(Json.fromString("2000.00")), + "status" -> Json.fromString("COMPLETED") ) - ) + ), + Nil ) ) } diff --git a/src/test/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapterSpec.scala b/src/test/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapterSpec.scala new file mode 100644 index 0000000..5d58e3b --- /dev/null +++ b/src/test/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapterSpec.scala @@ -0,0 +1,276 @@ +package com.tesobe.obp.adapter.cbs.implementations + +import cats.effect.IO +import cats.effect.unsafe.implicits.global +import com.tesobe.obp.adapter.interfaces.LocalAdapterResult +import com.tesobe.obp.adapter.models.CallContext +import com.tesobe.obp.adapter.telemetry.Telemetry +import io.circe.{Json, JsonObject} +import org.scalatest.matchers.should.Matchers +import org.scalatest.propspec.AnyPropSpec +import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks + +class MockLocalAdapterSpec extends AnyPropSpec with Matchers with ScalaCheckPropertyChecks { + + implicit override val generatorDrivenConfig: PropertyCheckConfiguration = + PropertyCheckConfiguration(minSuccessful = 100) + + val telemetry: Telemetry = new Telemetry { + override def debug(message: String, correlationId: Option[String]): IO[Unit] = IO.unit + override def info(message: String, correlationId: Option[String]): IO[Unit] = IO.unit + override def warn(message: String, correlationId: Option[String]): IO[Unit] = IO.unit + override def error(message: String, throwable: Option[Throwable], correlationId: Option[String]): IO[Unit] = IO.unit + override def recordPaymentSuccess(bankId: String, amount: BigDecimal, currency: String, correlationId: String): IO[Unit] = IO.unit + override def recordMessageReceived(process: String, correlationId: String, queueName: String): IO[Unit] = IO.unit + override def recordMessageProcessed(process: String, correlationId: String, duration: scala.concurrent.duration.FiniteDuration): IO[Unit] = IO.unit + override def recordMessageFailed(process: String, correlationId: String, errorCode: String, errorMessage: String, duration: scala.concurrent.duration.FiniteDuration): IO[Unit] = IO.unit + override def recordResponseSent(process: String, correlationId: String, success: Boolean): IO[Unit] = IO.unit + override def recordCBSOperationStart(operation: String, correlationId: String): IO[Unit] = IO.unit + override def recordCBSOperationSuccess(operation: String, correlationId: String, duration: scala.concurrent.duration.FiniteDuration): IO[Unit] = IO.unit + override def recordCBSOperationFailure(operation: String, correlationId: String, errorCode: String, errorMessage: String, duration: scala.concurrent.duration.FiniteDuration): IO[Unit] = IO.unit + override def recordCBSOperationRetry(operation: String, correlationId: String, attemptNumber: Int, reason: String): IO[Unit] = IO.unit + override def recordRabbitMQConnected(host: String, port: Int): IO[Unit] = IO.unit + override def recordRabbitMQDisconnected(reason: String): IO[Unit] = IO.unit + override def recordRabbitMQConnectionError(errorMessage: String): IO[Unit] = IO.unit + override def recordQueueConsumptionStarted(queueName: String): IO[Unit] = IO.unit + override def recordQueueConsumptionStopped(queueName: String, reason: String): IO[Unit] = IO.unit + override def recordQueueDepth(queueName: String, depth: Long): IO[Unit] = IO.unit + override def recordProcessingRate(messagesPerSecond: Double): IO[Unit] = IO.unit + override def recordMemoryUsage(usedMB: Long, totalMB: Long): IO[Unit] = IO.unit + override def recordPaymentFailure(bankId: String, amount: BigDecimal, currency: String, errorCode: String, correlationId: String): IO[Unit] = IO.unit + override def recordAccountCreated(bankId: String, accountType: String, correlationId: String): IO[Unit] = IO.unit + override def recordCustomerCreated(bankId: String, correlationId: String): IO[Unit] = IO.unit + override def recordError(category: String, errorCode: String, errorMessage: String, correlationId: Option[String], additionalContext: Map[String, String]): IO[Unit] = IO.unit + override def recordWarning(category: String, message: String, correlationId: Option[String]): IO[Unit] = IO.unit + override def startSpan(operationName: String, correlationId: String, attributes: Map[String, String]): IO[String] = IO.pure("test-span") + override def endSpan(spanId: String, success: Boolean): IO[Unit] = IO.unit + override def addSpanEvent(spanId: String, eventName: String, attributes: Map[String, String]): IO[Unit] = IO.unit + override def recordHealthCheck(component: String, healthy: Boolean, message: String): IO[Unit] = IO.unit + } + + val adapter = new MockLocalAdapter(telemetry) + + def createCallContext(correlationId: String): CallContext = CallContext( + correlationId = correlationId, + sessionId = Some("test-session"), + userId = Some("test-user"), + username = Some("testuser"), + consumerId = Some("test-consumer"), + generalContext = Map.empty + ) + + // Feature: workshop-adapter-mock-data, Property 1: getBanks always returns non-empty list with required fields + property("Property 1: getBanks always returns a non-empty list with required fields") { + forAll { (correlationId: String) => + val callContext = createCallContext(correlationId) + val data = JsonObject.empty + + val result = adapter.handleMessage("obp.getBanks", data, callContext).unsafeRunSync() + + result shouldBe a[LocalAdapterResult.Success] + val success = result.asInstanceOf[LocalAdapterResult.Success] + + success.data.asArray should not be empty + val banks = success.data.asArray.get + banks.size should be >= 2 + + banks.foreach { bank => + val bankObj = bank.asObject.get + bankObj("bankId").flatMap(_.asObject).flatMap(_("value")).flatMap(_.asString) should not be empty + bankObj("shortName").flatMap(_.asString) should not be empty + bankObj("fullName").flatMap(_.asString) should not be empty + bankObj("logoUrl").flatMap(_.asString) should not be empty + bankObj("websiteUrl").flatMap(_.asString) should not be empty + bankObj("bankRoutingScheme").flatMap(_.asString) should not be empty + bankObj("bankRoutingAddress").flatMap(_.asString) should not be empty + } + } + } + + // Feature: workshop-adapter-mock-data, Property 2: Workshop bank is always the first entry + property("Property 2: Workshop bank is always the first entry") { + forAll { (correlationId: String) => + val callContext = createCallContext(correlationId) + val data = JsonObject.empty + + val result = adapter.handleMessage("obp.getBanks", data, callContext).unsafeRunSync() + + result shouldBe a[LocalAdapterResult.Success] + val success = result.asInstanceOf[LocalAdapterResult.Success] + + val banks = success.data.asArray.get + val firstBank = banks.head.asObject.get + val bankId = firstBank("bankId").flatMap(_.asObject).flatMap(_("value")).flatMap(_.asString) + + bankId shouldBe Some("workshop-bank-001") + } + } + + // Feature: workshop-adapter-mock-data, Property 3: getCoreBankAccounts returns accounts with required fields + property("Property 3: getCoreBankAccounts returns accounts with required fields") { + forAll { (correlationId: String, bankId: String) => + val callContext = createCallContext(correlationId) + val data = JsonObject("bankId" -> Json.fromString(bankId)) + + val result = adapter.handleMessage("obp.getAccounts", data, callContext).unsafeRunSync() + + result shouldBe a[LocalAdapterResult.Success] + val success = result.asInstanceOf[LocalAdapterResult.Success] + + success.data.asArray should not be empty + val accounts = success.data.asArray.get + accounts.size should be >= 2 + + accounts.foreach { account => + val accountObj = account.asObject.get + accountObj("id").flatMap(_.asString) should not be empty + accountObj("label").flatMap(_.asString) should not be empty + accountObj("bankId").flatMap(_.asString) should not be empty + accountObj("accountType").flatMap(_.asString) should not be empty + accountObj("accountRoutings").flatMap(_.asArray) should not be empty + } + } + } + + // Feature: workshop-adapter-mock-data, Property 4: makePaymentv210 always returns a unique TransactionId + property("Property 4: makePaymentv210 always returns a unique TransactionId") { + forAll { (correlationId: String) => + val callContext = createCallContext(correlationId) + val data = JsonObject("amount" -> Json.fromString("10.00"), "currency" -> Json.fromString("EUR")) + + val result1 = adapter.handleMessage("obp.makePaymentv210", data, callContext).unsafeRunSync() + Thread.sleep(2) + val result2 = adapter.handleMessage("obp.makePaymentv210", data, callContext).unsafeRunSync() + + result1 shouldBe a[LocalAdapterResult.Success] + result2 shouldBe a[LocalAdapterResult.Success] + + val success1 = result1.asInstanceOf[LocalAdapterResult.Success] + val success2 = result2.asInstanceOf[LocalAdapterResult.Success] + + val txId1 = success1.data.asObject.flatMap(_("value")).flatMap(_.asString) + val txId2 = success2.data.asObject.flatMap(_("value")).flatMap(_.asString) + + txId1 should not be empty + txId2 should not be empty + txId1 should not equal txId2 + } + } + + // Feature: workshop-adapter-mock-data, Property 5: makePaymentv210 response contains all required fields + property("Property 5: makePaymentv210 response contains all required fields") { + forAll { (correlationId: String) => + val callContext = createCallContext(correlationId) + val data = JsonObject("amount" -> Json.fromString("10.00"), "currency" -> Json.fromString("EUR")) + + val result = adapter.handleMessage("obp.makePaymentv210", data, callContext).unsafeRunSync() + + result shouldBe a[LocalAdapterResult.Success] + val success = result.asInstanceOf[LocalAdapterResult.Success] + + val txId = success.data.asObject.flatMap(_("value")).flatMap(_.asString) + txId should not be empty + txId.get should startWith("tx-workshop-") + } + } + + // Feature: workshop-adapter-mock-data, Property 6: getTransactions returns >= 3 transactions with both CREDIT and DEBIT + property("Property 6: getTransactions returns at least three transactions with both CREDIT and DEBIT types") { + forAll { (correlationId: String, accountId: String) => + val callContext = createCallContext(correlationId) + val data = JsonObject("accountId" -> Json.fromString(accountId)) + + val result = adapter.handleMessage("obp.getTransactions", data, callContext).unsafeRunSync() + + result shouldBe a[LocalAdapterResult.Success] + val success = result.asInstanceOf[LocalAdapterResult.Success] + + val transactions = success.data.asArray.get + transactions.size should be >= 3 + + val transactionTypes = transactions.flatMap { tx => + tx.asObject.flatMap(_("transactionType")).flatMap(_.asString) + }.toSet + + transactionTypes should contain("CREDIT") + transactionTypes should contain("DEBIT") + } + } + + // Feature: workshop-adapter-mock-data, Property 7: getTransactions echoes accountId into each transaction + property("Property 7: getTransactions echoes accountId into each transaction") { + forAll { (correlationId: String, accountId: String) => + val callContext = createCallContext(correlationId) + val data = JsonObject("accountId" -> Json.fromString(accountId)) + + val result = adapter.handleMessage("obp.getTransactions", data, callContext).unsafeRunSync() + + result shouldBe a[LocalAdapterResult.Success] + val success = result.asInstanceOf[LocalAdapterResult.Success] + + val transactions = success.data.asArray.get + transactions.foreach { tx => + val txObj = tx.asObject.get + val thisAccountId = txObj("thisAccount") + .flatMap(_.asObject) + .flatMap(_("accountId")) + .flatMap(_.asObject) + .flatMap(_("value")) + .flatMap(_.asString) + + val otherAccountId = txObj("otherAccount") + .flatMap(_.asObject) + .flatMap(_("thisAccountId")) + .flatMap(_.asObject) + .flatMap(_("value")) + .flatMap(_.asString) + + thisAccountId shouldBe Some(accountId) + otherAccountId shouldBe Some(accountId) + } + } + } + + // Feature: workshop-adapter-mock-data, Property 8: Both process name variants dispatch to the same handler + property("Property 8: Both process name variants dispatch to the same handler") { + val methods = List( + ("obp.getBanks", "obp_get_banks"), + ("obp.getAccounts", "obp_get_core_bank_accounts"), + ("obp.getTransactions", "obp_get_transactions") + ) + + forAll { (correlationId: String) => + val callContext = createCallContext(correlationId) + val data = JsonObject.empty + + methods.foreach { case (dotNotation, underscoreNotation) => + val result1 = adapter.handleMessage(dotNotation, data, callContext).unsafeRunSync() + val result2 = adapter.handleMessage(underscoreNotation, data, callContext).unsafeRunSync() + + result1 shouldBe a[LocalAdapterResult.Success] + result2 shouldBe a[LocalAdapterResult.Success] + + val success1 = result1.asInstanceOf[LocalAdapterResult.Success] + val success2 = result2.asInstanceOf[LocalAdapterResult.Success] + + success1.data shouldBe success2.data + } + } + } + + // Feature: workshop-adapter-mock-data, Property 9: Unknown process names return OBP-50000 + property("Property 9: Unknown process names return OBP-50000") { + forAll { (correlationId: String, unknownProcess: String) => + whenever(!unknownProcess.startsWith("obp.get") && !unknownProcess.startsWith("obp.make") && !unknownProcess.startsWith("obp.check")) { + val callContext = createCallContext(correlationId) + val data = JsonObject.empty + + val result = adapter.handleMessage(unknownProcess, data, callContext).unsafeRunSync() + + result shouldBe a[LocalAdapterResult.Error] + val error = result.asInstanceOf[LocalAdapterResult.Error] + error.errorCode shouldBe "OBP-50000" + } + } + } +} From 7c4c7dcaddff9943e9b18c44b438264365542c6a Mon Sep 17 00:00:00 2001 From: Hongwei Date: Wed, 18 Mar 2026 21:08:05 +0100 Subject: [PATCH 3/7] docfix/added Postman script --- workshop-postman-collection.json | 171 +++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 workshop-postman-collection.json diff --git a/workshop-postman-collection.json b/workshop-postman-collection.json new file mode 100644 index 0000000..b7572e1 --- /dev/null +++ b/workshop-postman-collection.json @@ -0,0 +1,171 @@ +{ + "info": { + "name": "OBP Workshop", + "description": "Workshop collection for testing OBP-API with RabbitMQ adapter", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "if (!pm.environment.get('token')) {", + " const baseUrl = pm.environment.get('base_url') || 'http://127.0.0.1:8080';", + " const username = pm.environment.get('username');", + " const password = pm.environment.get('password');", + " const consumerKey = pm.environment.get('consumer_key');", + " ", + " if (username && password && consumerKey) {", + " pm.sendRequest({", + " url: baseUrl + '/my/logins/direct',", + " method: 'POST',", + " header: {", + " 'Content-Type': 'application/json',", + " 'DirectLogin': 'username=' + username + ',password=' + password + ',consumer_key=' + consumerKey", + " }", + " }, function (err, response) {", + " if (!err && response.json().token) {", + " pm.environment.set('token', response.json().token);", + " }", + " });", + " }", + "}" + ] + } + } + ], + "item": [ + { + "name": "Get Token", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "DirectLogin", + "value": "username={{username}},password={{password}},consumer_key={{consumer_key}}" + } + ], + "url": { + "raw": "{{base_url}}/my/logins/direct", + "host": ["{{base_url}}"], + "path": ["my", "logins", "direct"] + } + }, + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "if (pm.response.code === 200 || pm.response.code === 201) {", + " const jsonData = pm.response.json();", + " if (jsonData.token) {", + " pm.environment.set('token', jsonData.token);", + " console.log('Token saved:', jsonData.token);", + " }", + "}" + ] + } + } + ] + }, + { + "name": "Get Banks", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks", + "host": ["{{base_url}}"], + "path": ["obp", "v5.0.0", "banks"] + } + } + }, + { + "name": "Get Account", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks/{{bank_id}}/accounts/{{account_id}}/account", + "host": ["{{base_url}}"], + "path": ["obp", "v5.0.0", "banks", "{{bank_id}}", "accounts", "{{account_id}}", "account"] + } + } + }, + { + "name": "Make Payment", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"to\": {\n \"bank_id\": \"workshop-bank-001\",\n \"account_id\": \"acc-002\"\n },\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"10.00\"\n },\n \"description\": \"Workshop test payment\",\n \"charge_policy\": \"SHARED\"\n}" + }, + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks/{{bank_id}}/transaction-request-types/SANDBOX_TAN/transaction-requests", + "host": ["{{base_url}}"], + "path": ["obp", "v5.0.0", "banks", "{{bank_id}}", "transaction-request-types", "SANDBOX_TAN", "transaction-requests"] + } + } + }, + { + "name": "Get Transactions", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks/{{bank_id}}/accounts/{{account_id}}/transactions", + "host": ["{{base_url}}"], + "path": ["obp", "v5.0.0", "banks", "{{bank_id}}", "accounts", "{{account_id}}", "transactions"] + } + } + } + ], + "variable": [ + { + "key": "base_url", + "value": "http://127.0.0.1:8080", + "type": "string" + }, + { + "key": "bank_id", + "value": "workshop-bank-001", + "type": "string" + }, + { + "key": "account_id", + "value": "acc-001", + "type": "string" + } + ] +} From bcd18732795a914446c7df3743f6f08e8e529449 Mon Sep 17 00:00:00 2001 From: Hongwei Date: Wed, 18 Mar 2026 23:39:04 +0100 Subject: [PATCH 4/7] feature/added checkBankAccountExists method --- .../implementations/MockLocalAdapter.scala | 67 +++++++++++++++---- 1 file changed, 55 insertions(+), 12 deletions(-) diff --git a/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala b/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala index 2c56c12..af240f7 100644 --- a/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala +++ b/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala @@ -53,6 +53,7 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { case "obp.getAccounts" | "obp_get_core_bank_accounts" => getCoreBankAccounts(data, callContext) case "obp.getBankAccounts" | "obp_get_bank_accounts" => getBankAccounts(data, callContext) case "obp.getBankAccountsForUser" | "obp_get_bank_accounts_for_user" => getBankAccountsForUser(data, callContext) + case "obp.checkBankAccountExists" | "obp_check_bank_account_exists" => checkBankAccountExists(data, callContext) case "obp.getTransaction" | "obp_get_transaction" => getTransaction(data, callContext) case "obp.getTransactions" | "obp_get_transactions" => getTransactions(data, callContext) case "obp.checkFundsAvailable" | "obp_check_funds_available" => checkFundsAvailable(data, callContext) @@ -224,6 +225,45 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { ) } + private def checkBankAccountExists(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { + val bankId = data("bankId").flatMap(_.asObject).flatMap(_("value")).flatMap(_.asString).getOrElse("workshop-bank-001") + val accountId = data("accountId").flatMap(_.asObject).flatMap(_("value")).flatMap(_.asString).getOrElse("acc-001") + + val validAccounts = Set("acc-001", "acc-002") + val validBanks = Set("workshop-bank-001", "test-bank-002") + + val exists = validBanks.contains(bankId) && validAccounts.contains(accountId) + + telemetry.debug(s"Checking if account exists: bankId=$bankId, accountId=$accountId, exists=$exists", Some(callContext.correlationId)) *> + IO.pure( + if (exists) { + LocalAdapterResult.success( + Json.obj( + "accountId" -> Json.obj("value" -> Json.fromString(accountId)), + "accountType" -> Json.fromString("CURRENT"), + "balance" -> Json.fromString(if (accountId == "acc-001") "5000.00" else "3000.00"), + "currency" -> Json.fromString("EUR"), + "name" -> Json.fromString(if (accountId == "acc-001") "Alice Workshop Account" else "Bob Workshop Account"), + "number" -> Json.fromString(accountId), + "bankId" -> Json.obj("value" -> Json.fromString(bankId)), + "lastUpdate" -> Json.fromString("2024-03-18T00:00:00Z"), + "branchId" -> Json.fromString("branch-001"), + "accountRoutings" -> Json.arr( + Json.obj( + "scheme" -> Json.fromString("IBAN"), + "address" -> Json.fromString(if (accountId == "acc-001") "DE89370400440532013000" else "DE89370400440532013001") + ) + ), + "attributes" -> Json.arr() + ), + Nil + ) + } else { + LocalAdapterResult.error("OBP-30018", s"Account not found: bankId=$bankId, accountId=$accountId") + } + ) + } + private def makePaymentv210(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { val amount = data("amount").flatMap(_.asString).getOrElse("0.00") val currency = data("currency").flatMap(_.asString).getOrElse("EUR") @@ -368,7 +408,7 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { "thisAccount" -> Json.obj( "accountId" -> Json.obj("value" -> Json.fromString(accountId)), "accountType" -> Json.fromString("CURRENT"), - "balance" -> Json.fromDouble(4950.00).getOrElse(Json.fromString("4950.00")), + "balance" -> Json.fromString("4950.00"), "currency" -> Json.fromString("EUR"), "name" -> Json.fromString("Alice Workshop Account"), "label" -> Json.fromString("Alice Workshop Account"), @@ -383,7 +423,8 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { ) ), "accountRules" -> Json.arr(), - "accountHolder" -> Json.fromString("Alice") + "accountHolder" -> Json.fromString("Alice"), + "attributes" -> Json.arr() ), "otherAccount" -> Json.obj( "nationalIdentifier" -> Json.fromString("MERCHANT001"), @@ -400,12 +441,12 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { "isBeneficiary" -> Json.fromBoolean(true) ), "transactionType" -> Json.fromString("DEBIT"), - "amount" -> Json.fromDouble(-50.00).getOrElse(Json.fromString("-50.00")), + "amount" -> Json.fromString("50.00"), "currency" -> Json.fromString("EUR"), "description" -> Json.fromString("Online purchase - Online Shop GmbH"), "startDate" -> Json.fromString("2025-01-14T10:30:00Z"), "finishDate" -> Json.fromString("2025-01-14T10:30:05Z"), - "balance" -> Json.fromDouble(4950.00).getOrElse(Json.fromString("4950.00")), + "balance" -> Json.fromString("4950.00"), "status" -> Json.fromString("COMPLETED") ), Json.obj( @@ -414,7 +455,7 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { "thisAccount" -> Json.obj( "accountId" -> Json.obj("value" -> Json.fromString(accountId)), "accountType" -> Json.fromString("CURRENT"), - "balance" -> Json.fromDouble(5000.00).getOrElse(Json.fromString("5000.00")), + "balance" -> Json.fromString("5000.00"), "currency" -> Json.fromString("EUR"), "name" -> Json.fromString("Alice Workshop Account"), "label" -> Json.fromString("Alice Workshop Account"), @@ -429,7 +470,8 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { ) ), "accountRules" -> Json.arr(), - "accountHolder" -> Json.fromString("Alice") + "accountHolder" -> Json.fromString("Alice"), + "attributes" -> Json.arr() ), "otherAccount" -> Json.obj( "nationalIdentifier" -> Json.fromString("EMPLOYER001"), @@ -446,12 +488,12 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { "isBeneficiary" -> Json.fromBoolean(false) ), "transactionType" -> Json.fromString("CREDIT"), - "amount" -> Json.fromDouble(3000.00).getOrElse(Json.fromString("3000.00")), + "amount" -> Json.fromString("3000.00"), "currency" -> Json.fromString("EUR"), "description" -> Json.fromString("Monthly salary - Employer Corp AG"), "startDate" -> Json.fromString("2025-01-13T09:00:00Z"), "finishDate" -> Json.fromString("2025-01-13T09:00:01Z"), - "balance" -> Json.fromDouble(5000.00).getOrElse(Json.fromString("5000.00")), + "balance" -> Json.fromString("5000.00"), "status" -> Json.fromString("COMPLETED") ), Json.obj( @@ -460,7 +502,7 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { "thisAccount" -> Json.obj( "accountId" -> Json.obj("value" -> Json.fromString(accountId)), "accountType" -> Json.fromString("CURRENT"), - "balance" -> Json.fromDouble(2000.00).getOrElse(Json.fromString("2000.00")), + "balance" -> Json.fromString("2000.00"), "currency" -> Json.fromString("EUR"), "name" -> Json.fromString("Alice Workshop Account"), "label" -> Json.fromString("Alice Workshop Account"), @@ -475,7 +517,8 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { ) ), "accountRules" -> Json.arr(), - "accountHolder" -> Json.fromString("Alice") + "accountHolder" -> Json.fromString("Alice"), + "attributes" -> Json.arr() ), "otherAccount" -> Json.obj( "nationalIdentifier" -> Json.fromString("COFFEE001"), @@ -492,12 +535,12 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { "isBeneficiary" -> Json.fromBoolean(true) ), "transactionType" -> Json.fromString("DEBIT"), - "amount" -> Json.fromDouble(-25.50).getOrElse(Json.fromString("-25.50")), + "amount" -> Json.fromString("25.50"), "currency" -> Json.fromString("EUR"), "description" -> Json.fromString("Coffee subscription - Brew & Co"), "startDate" -> Json.fromString("2025-01-12T08:15:00Z"), "finishDate" -> Json.fromString("2025-01-12T08:15:02Z"), - "balance" -> Json.fromDouble(2000.00).getOrElse(Json.fromString("2000.00")), + "balance" -> Json.fromString("2000.00"), "status" -> Json.fromString("COMPLETED") ) ), From 103203909d29ed368fb6626fe493b7da0667ad83 Mon Sep 17 00:00:00 2001 From: Hongwei Date: Wed, 18 Mar 2026 23:57:12 +0100 Subject: [PATCH 5/7] docfix/tweaked postman --- postman/OBP Workshop.postman_collection.json | 1946 ++++++++++++++++++ 1 file changed, 1946 insertions(+) create mode 100644 postman/OBP Workshop.postman_collection.json diff --git a/postman/OBP Workshop.postman_collection.json b/postman/OBP Workshop.postman_collection.json new file mode 100644 index 0000000..f99e005 --- /dev/null +++ b/postman/OBP Workshop.postman_collection.json @@ -0,0 +1,1946 @@ +{ + "info": { + "_postman_id": "dc89e6f0-5bd0-45f0-8611-a0ac25d2e66c", + "name": "OBP Workshop", + "description": "Workshop collection for testing OBP-API with RabbitMQ adapter", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "1279788", + "_collection_link": "https://go.postman.co/collection/1279788-dc89e6f0-5bd0-45f0-8611-a0ac25d2e66c?source=collection_link" + }, + "item": [ + { + "name": "connectorMethods", + "item": [ + { + "name": "getBanks", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/getBanks", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "getBanks" + ] + }, + "description": "\"getBranches\",\n\"GET\",\n\"/banks/BANK_ID/branches\",\n\"Get Bank Branches\",\ns\"\"\"Returns information about branches for a single bank specified by BANK_ID including:\n |\n |* Name\n |* Address\n |* Geo Location\n |* License the data under this endpoint is released under\n |" + }, + "response": [ + { + "name": "getBanks", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/getBanks", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "getBanks" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 19:59:21 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "873" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "ETag", + "value": "e89c74bb77cfe2ea3905a03b62b721c4dc2f6243eb068a2ce253f553ec1b52d7" + }, + { + "key": "Correlation-Id", + "value": "fc15cdc7-9337-4e9b-8bdc-962bd6936ae7" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 19:59:21 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"inboundAdapterCallContext\": {\n \"correlationId\": \"6ab63692-d3ba-4ce8-bed0-0c33a394b816\"\n },\n \"status\": {\n \"errorCode\": \"\",\n \"backendMessages\": [\n {\n \"source\": \"\",\n \"status\": \"\",\n \"errorCode\": \"\",\n \"text\": \"\"\n }\n ]\n },\n \"data\": [\n {\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"shortName\": \"Workshop Bank\",\n \"fullName\": \"Workshop Bank for OBP Demo\",\n \"logoUrl\": \"https://static.openbankproject.com/images/sandbox/bank_x.png\",\n \"websiteUrl\": \"https://workshop.openbankproject.com\",\n \"bankRoutingScheme\": \"BIC\",\n \"bankRoutingAddress\": \"WKSHBIC0\",\n \"swiftBic\": \"WKSHBIC0\",\n \"nationalIdentifier\": \"WORKSHOP001\"\n },\n {\n \"bankId\": {\n \"value\": \"test-bank-002\"\n },\n \"shortName\": \"Test Bank\",\n \"fullName\": \"Test Bank for Integration\",\n \"logoUrl\": \"https://static.openbankproject.com/images/sandbox/bank_y.png\",\n \"websiteUrl\": \"https://testbank.example.com\",\n \"bankRoutingScheme\": \"BIC\",\n \"bankRoutingAddress\": \"TSTBBIC0\",\n \"swiftBic\": \"TSTBBIC0\",\n \"nationalIdentifier\": \"TESTBANK002\"\n }\n ]\n}" + } + ] + }, + { + "name": "getBank", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"bankId\": {\n \"value\": \"gh.29.uk\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/getBank", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "getBank" + ] + }, + "description": "\"getBranches\",\n\"GET\",\n\"/banks/BANK_ID/branches\",\n\"Get Bank Branches\",\ns\"\"\"Returns information about branches for a single bank specified by BANK_ID including:\n |\n |* Name\n |* Address\n |* Geo Location\n |* License the data under this endpoint is released under\n |" + }, + "response": [ + { + "name": "getBank", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"bankId\": {\n \"value\": \"gh.29.uk\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/getBank", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "getBank" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 22:45:10 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "493" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "ETag", + "value": "c96417c6f1f437b530735ff637cacd943ef45bb8b388480db26f7199bdb36391" + }, + { + "key": "Correlation-Id", + "value": "068c4e2c-2e9c-4d8d-ac6f-793522fe0ad3" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 22:45:10 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"inboundAdapterCallContext\": {\n \"correlationId\": \"5885d443-6419-40cb-914c-d9aa518b1156\"\n },\n \"status\": {\n \"errorCode\": \"\",\n \"backendMessages\": [\n {\n \"source\": \"\",\n \"status\": \"\",\n \"errorCode\": \"\",\n \"text\": \"\"\n }\n ]\n },\n \"data\": {\n \"bankId\": {\n \"value\": \"gh.29.uk\"\n },\n \"shortName\": \"Mock Bank\",\n \"fullName\": \"Mock Bank for Testing\",\n \"logoUrl\": \"https://static.openbankproject.com/images/sandbox/bank_x.png\",\n \"websiteUrl\": \"https://www.example.com\",\n \"bankRoutingScheme\": \"BIC\",\n \"bankRoutingAddress\": \"MOCKBIC0\",\n \"swiftBic\": null,\n \"nationalIdentifier\": null\n }\n}" + } + ] + }, + { + "name": "getBankAccountsForUser", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"provider\": \"ETHEREUM\",\n \"username\": \"felixsmith\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/getBankAccountsForUser", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "getBankAccountsForUser" + ] + }, + "description": "\"getBranches\",\n\"GET\",\n\"/banks/BANK_ID/branches\",\n\"Get Bank Branches\",\ns\"\"\"Returns information about branches for a single bank specified by BANK_ID including:\n |\n |* Name\n |* Address\n |* Geo Location\n |* License the data under this endpoint is released under\n |" + }, + "response": [ + { + "name": "getBankAccountsForUser", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"provider\": \"ETHEREUM\",\n \"username\": \"felixsmith\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/getBankAccountsForUser", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "getBankAccountsForUser" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 19:52:39 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "1084" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "ETag", + "value": "f134e36e5d3fb2c206b49a151fd2db293548cb70963e79471aa42445aa9c68f8" + }, + { + "key": "Correlation-Id", + "value": "85a4e2c2-32da-4337-95d7-e85a7ca951e3" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 19:52:39 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"inboundAdapterCallContext\": {\n \"correlationId\": \"50d94935-a969-4ccd-aac3-79efa7dd37a8\"\n },\n \"status\": {\n \"errorCode\": \"\",\n \"backendMessages\": [\n {\n \"source\": \"\",\n \"status\": \"\",\n \"errorCode\": \"\",\n \"text\": \"\"\n }\n ]\n },\n \"data\": [\n {\n \"bankId\": \"workshop-bank-001\",\n \"branchId\": \"branch-001\",\n \"accountId\": \"acc-001\",\n \"accountNumber\": \"acc-001\",\n \"accountType\": \"CURRENT\",\n \"balanceAmount\": \"5000.00\",\n \"balanceCurrency\": \"EUR\",\n \"owners\": [\n \"felixsmith\"\n ],\n \"viewsToGenerate\": [\n \"owner\"\n ],\n \"bankRoutingScheme\": \"IBAN\",\n \"bankRoutingAddress\": \"DE89370400440532013000\",\n \"branchRoutingScheme\": \"BRANCH_CODE\",\n \"branchRoutingAddress\": \"001\",\n \"accountRoutingScheme\": \"IBAN\",\n \"accountRoutingAddress\": \"DE89370400440532013000\"\n },\n {\n \"bankId\": \"workshop-bank-001\",\n \"branchId\": \"branch-001\",\n \"accountId\": \"acc-002\",\n \"accountNumber\": \"acc-002\",\n \"accountType\": \"CURRENT\",\n \"balanceAmount\": \"3000.00\",\n \"balanceCurrency\": \"EUR\",\n \"owners\": [\n \"felixsmith\"\n ],\n \"viewsToGenerate\": [\n \"owner\"\n ],\n \"bankRoutingScheme\": \"IBAN\",\n \"bankRoutingAddress\": \"DE89370400440532013001\",\n \"branchRoutingScheme\": \"BRANCH_CODE\",\n \"branchRoutingAddress\": \"001\",\n \"accountRoutingScheme\": \"IBAN\",\n \"accountRoutingAddress\": \"DE89370400440532013001\"\n }\n ]\n}" + } + ] + }, + { + "name": "getBankAccounts", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"bankIdAccountIds\": [\n {\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"accountId\": {\n \"value\": \"acc-001\"\n }\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/getBankAccounts", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "getBankAccounts" + ] + }, + "description": "\"getBranches\",\n\"GET\",\n\"/banks/BANK_ID/branches\",\n\"Get Bank Branches\",\ns\"\"\"Returns information about branches for a single bank specified by BANK_ID including:\n |\n |* Name\n |* Address\n |* Geo Location\n |* License the data under this endpoint is released under\n |" + }, + "response": [ + { + "name": "getBankAccounts", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"bankIdAccountIds\": [\n {\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"accountId\": {\n \"value\": \"acc-001\"\n }\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/getBankAccounts", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "getBankAccounts" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 19:57:50 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "598" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "ETag", + "value": "d5c877f0b580964aed67e94152f68771e47d632cbaeb32fe16f58b82d979fad9" + }, + { + "key": "Correlation-Id", + "value": "392373a8-f8e2-4e7c-8ec3-412cf05f3cfd" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 19:57:50 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"inboundAdapterCallContext\": {\n \"correlationId\": \"2a939e5b-6f66-4017-9206-146c75bf1daf\"\n },\n \"status\": {\n \"errorCode\": \"\",\n \"backendMessages\": [\n {\n \"source\": \"\",\n \"status\": \"\",\n \"errorCode\": \"\",\n \"text\": \"\"\n }\n ]\n },\n \"data\": [\n {\n \"accountId\": {\n \"value\": \"acc-001\"\n },\n \"accountType\": \"CURRENT\",\n \"balance\": \"5000.00\",\n \"currency\": \"EUR\",\n \"name\": \"Alice Workshop Account\",\n \"label\": \"Alice Workshop Account\",\n \"number\": \"acc-001\",\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"lastUpdate\": \"2024-03-18T00:00:00Z\",\n \"branchId\": \"branch-001\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"accountRules\": [],\n \"accountHolder\": null,\n \"attributes\": []\n }\n ]\n}" + } + ] + }, + { + "name": "checkBankAccountExists", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"accountId\": {\n \"value\": \"acc-001\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/checkBankAccountExists", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "checkBankAccountExists" + ] + }, + "description": "\"getBranches\",\n\"GET\",\n\"/banks/BANK_ID/branches\",\n\"Get Bank Branches\",\ns\"\"\"Returns information about branches for a single bank specified by BANK_ID including:\n |\n |* Name\n |* Address\n |* Geo Location\n |* License the data under this endpoint is released under\n |" + }, + "response": [ + { + "name": "checkBankAccountExists", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"accountId\": {\n \"value\": \"acc-001\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/checkBankAccountExists", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "checkBankAccountExists" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 22:27:30 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "576" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "ETag", + "value": "431b13b626be2bac81a82485c80f96d56d6e4aadb485d0f3d0ca5bd633d6d0b9" + }, + { + "key": "Correlation-Id", + "value": "78d473f4-7ba5-4fcc-b201-ecc27f42ed37" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 22:27:30 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"inboundAdapterCallContext\": {\n \"correlationId\": \"6373ff06-ff48-4967-94ee-f6295d8a24c0\"\n },\n \"status\": {\n \"errorCode\": \"\",\n \"backendMessages\": [\n {\n \"source\": \"\",\n \"status\": \"\",\n \"errorCode\": \"\",\n \"text\": \"\"\n }\n ]\n },\n \"data\": {\n \"accountId\": {\n \"value\": \"acc-001\"\n },\n \"accountType\": \"CURRENT\",\n \"balance\": \"5000.00\",\n \"currency\": \"EUR\",\n \"name\": \"Alice Workshop Account\",\n \"label\": null,\n \"number\": \"acc-001\",\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"lastUpdate\": \"2024-03-18T00:00:00Z\",\n \"branchId\": \"branch-001\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"accountRules\": [],\n \"accountHolder\": null,\n \"attributes\": []\n }\n}" + } + ] + }, + { + "name": "makePaymentv210", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"fromAccount\": {\n \"accountId\": {\n \"value\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\"\n },\n \"accountType\": \"AC\",\n \"balance\": \"10\",\n \"currency\": \"EUR\",\n \"name\": \"bankAccount name string\",\n \"label\": \"My Account\",\n \"number\": \"bankAccount number string\",\n \"bankId\": {\n \"value\": \"gh.29.uk\"\n },\n \"lastUpdate\": \"2018-03-09T00:00:00Z\",\n \"branchId\": \"DERBY6\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"accountRules\": [\n {\n \"scheme\": \"AccountRule scheme string\",\n \"value\": \"AccountRule value string\"\n }\n ],\n \"accountHolder\": \"bankAccount accountHolder string\",\n \"attributes\": [\n {\n \"name\": \"STATUS\",\n \"type\": \"STRING\",\n \"value\": \"closed\"\n }\n ]\n },\n \"toAccount\": {\n \"accountId\": {\n \"value\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\"\n },\n \"accountType\": \"AC\",\n \"balance\": \"10\",\n \"currency\": \"EUR\",\n \"name\": \"bankAccount name string\",\n \"label\": \"My Account\",\n \"number\": \"bankAccount number string\",\n \"bankId\": {\n \"value\": \"gh.29.uk\"\n },\n \"lastUpdate\": \"2018-03-09T00:00:00Z\",\n \"branchId\": \"DERBY6\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"accountRules\": [\n {\n \"scheme\": \"AccountRule scheme string\",\n \"value\": \"AccountRule value string\"\n }\n ],\n \"accountHolder\": \"bankAccount accountHolder string\",\n \"attributes\": [\n {\n \"name\": \"STATUS\",\n \"type\": \"STRING\",\n \"value\": \"closed\"\n }\n ]\n },\n \"transactionRequestId\": {\n \"value\": \"8138a7e4-6d02-40e3-a129-0b2bf89de9f1\"\n },\n \"transactionRequestCommonBody\": {\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"10.12\"\n },\n \"description\": \"Description of the object. Maximum length is 2000. It can be any characters here.\"\n },\n \"amount\": \"10.12\",\n \"description\": \"Description of the object. Maximum length is 2000. It can be any characters here.\",\n \"transactionRequestType\": {\n \"value\": \"SEPA\"\n },\n \"chargePolicy\": \"SHARED\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/makePaymentv210", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "makePaymentv210" + ] + }, + "description": "\"getBranches\",\n\"GET\",\n\"/banks/BANK_ID/branches\",\n\"Get Bank Branches\",\ns\"\"\"Returns information about branches for a single bank specified by BANK_ID including:\n |\n |* Name\n |* Address\n |* Geo Location\n |* License the data under this endpoint is released under\n |" + }, + "response": [ + { + "name": "makePaymentv210", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"fromAccount\": {\n \"accountId\": {\n \"value\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\"\n },\n \"accountType\": \"AC\",\n \"balance\": \"10\",\n \"currency\": \"EUR\",\n \"name\": \"bankAccount name string\",\n \"label\": \"My Account\",\n \"number\": \"bankAccount number string\",\n \"bankId\": {\n \"value\": \"gh.29.uk\"\n },\n \"lastUpdate\": \"2018-03-09T00:00:00Z\",\n \"branchId\": \"DERBY6\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"accountRules\": [\n {\n \"scheme\": \"AccountRule scheme string\",\n \"value\": \"AccountRule value string\"\n }\n ],\n \"accountHolder\": \"bankAccount accountHolder string\",\n \"attributes\": [\n {\n \"name\": \"STATUS\",\n \"type\": \"STRING\",\n \"value\": \"closed\"\n }\n ]\n },\n \"toAccount\": {\n \"accountId\": {\n \"value\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\"\n },\n \"accountType\": \"AC\",\n \"balance\": \"10\",\n \"currency\": \"EUR\",\n \"name\": \"bankAccount name string\",\n \"label\": \"My Account\",\n \"number\": \"bankAccount number string\",\n \"bankId\": {\n \"value\": \"gh.29.uk\"\n },\n \"lastUpdate\": \"2018-03-09T00:00:00Z\",\n \"branchId\": \"DERBY6\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"accountRules\": [\n {\n \"scheme\": \"AccountRule scheme string\",\n \"value\": \"AccountRule value string\"\n }\n ],\n \"accountHolder\": \"bankAccount accountHolder string\",\n \"attributes\": [\n {\n \"name\": \"STATUS\",\n \"type\": \"STRING\",\n \"value\": \"closed\"\n }\n ]\n },\n \"transactionRequestId\": {\n \"value\": \"8138a7e4-6d02-40e3-a129-0b2bf89de9f1\"\n },\n \"transactionRequestCommonBody\": {\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"10.12\"\n },\n \"description\": \"Description of the object. Maximum length is 2000. It can be any characters here.\"\n },\n \"amount\": \"10.12\",\n \"description\": \"Description of the object. Maximum length is 2000. It can be any characters here.\",\n \"transactionRequestType\": {\n \"value\": \"SEPA\"\n },\n \"chargePolicy\": \"SHARED\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/makePaymentv210", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "makePaymentv210" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 22:54:46 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "228" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "ETag", + "value": "9d0642009cf8e3fc35531a30073cf426411db8620ac5e2b924bbaf81a3c78eb2" + }, + { + "key": "Correlation-Id", + "value": "0707db34-0e97-466b-9b4f-a906af9e7a7f" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 22:54:46 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"inboundAdapterCallContext\": {\n \"correlationId\": \"5a124a8a-e340-42bc-a1b8-b0849382aa96\"\n },\n \"status\": {\n \"errorCode\": \"\",\n \"backendMessages\": [\n {\n \"source\": \"\",\n \"status\": \"\",\n \"errorCode\": \"\",\n \"text\": \"\"\n }\n ]\n },\n \"data\": {\n \"value\": \"tx-workshop-1773874486412\"\n }\n}" + } + ] + }, + { + "name": "getTransactions", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"accountId\": {\n \"value\": \"acc-001\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/getTransactions", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "getTransactions" + ] + }, + "description": "\"getBranches\",\n\"GET\",\n\"/banks/BANK_ID/branches\",\n\"Get Bank Branches\",\ns\"\"\"Returns information about branches for a single bank specified by BANK_ID including:\n |\n |* Name\n |* Address\n |* Geo Location\n |* License the data under this endpoint is released under\n |" + }, + "response": [ + { + "name": "getTransactions", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "DirectLogin token={{token}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"outboundAdapterCallContext\": {\n \"correlationId\": \"1flssoftxq0cr1nssr68u0mioj\",\n \"sessionId\": \"b4e0352a-9a0f-4bfa-b30b-9003aa467f50\",\n \"consumerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"generalContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"outboundAdapterAuthInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n },\n \"outboundAdapterConsenterInfo\": {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"username\": \"felixsmith\",\n \"linkedCustomers\": [\n {\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\"\n }\n ],\n \"userAuthContext\": [\n {\n \"key\": \"CustomerNumber\",\n \"value\": \"5987953\"\n }\n ],\n \"authViews\": [\n {\n \"view\": {\n \"id\": \"owner\",\n \"name\": \"owner\",\n \"description\": \"This view is for the owner for the account.\"\n },\n \"account\": {\n \"id\": \"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE91 1000 0000 0123 4567 89\"\n }\n ],\n \"customerOwners\": [\n {\n \"bankId\": \"gh.29.uk\",\n \"customerId\": \"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh\",\n \"customerNumber\": \"5987953\",\n \"legalName\": \"Eveline Tripman\",\n \"dateOfBirth\": \"2018-03-09T00:00:00Z\"\n }\n ],\n \"userOwners\": [\n {\n \"userId\": \"9ca9a7e4-6d02-40e3-a129-0b2bf89de9b1\",\n \"emailAddress\": \"felixsmith@example.com\",\n \"name\": \"felixsmith\"\n }\n ]\n }\n }\n ]\n }\n },\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"accountId\": {\n \"value\": \"acc-001\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/connector/getTransactions", + "host": [ + "{{base_url}}" + ], + "path": [ + "connector", + "getTransactions" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 22:54:55 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "3539" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "ETag", + "value": "d6d5a53c64dc3430783143b51f0546fbd564e95180b485e70ca80c5ea4fefaac" + }, + { + "key": "Correlation-Id", + "value": "e95215b2-2c96-4b31-8420-5455eee3c0c5" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 22:54:55 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"inboundAdapterCallContext\": {\n \"correlationId\": \"7e33c805-8657-4163-afce-7cfefbc4d89a\"\n },\n \"status\": {\n \"errorCode\": \"\",\n \"backendMessages\": [\n {\n \"source\": \"\",\n \"status\": \"\",\n \"errorCode\": \"\",\n \"text\": \"\"\n }\n ]\n },\n \"data\": [\n {\n \"uuid\": \"uuid-tx-001\",\n \"id\": {\n \"value\": \"tx-001\"\n },\n \"thisAccount\": {\n \"accountId\": {\n \"value\": \"acc-001\"\n },\n \"accountType\": \"CURRENT\",\n \"balance\": \"4950.00\",\n \"currency\": \"EUR\",\n \"name\": \"Alice Workshop Account\",\n \"label\": \"Alice Workshop Account\",\n \"number\": \"acc-001\",\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"lastUpdate\": \"2025-01-14T00:00:00Z\",\n \"branchId\": \"branch-001\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"accountRules\": [],\n \"accountHolder\": \"Alice\",\n \"attributes\": []\n },\n \"otherAccount\": {\n \"nationalIdentifier\": \"MERCHANT001\",\n \"kind\": \"DEBIT\",\n \"counterpartyId\": \"cp-merchant-001\",\n \"counterpartyName\": \"Online Shop GmbH\",\n \"thisBankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"thisAccountId\": {\n \"value\": \"acc-001\"\n },\n \"otherBankRoutingScheme\": \"BIC\",\n \"otherBankRoutingAddress\": \"SHOPBIC0\",\n \"otherAccountRoutingScheme\": \"IBAN\",\n \"otherAccountRoutingAddress\": \"DE12345678901234567890\",\n \"otherAccountProvider\": \"OBP\",\n \"isBeneficiary\": true\n },\n \"transactionType\": \"DEBIT\",\n \"amount\": \"50.00\",\n \"currency\": \"EUR\",\n \"description\": \"Online purchase - Online Shop GmbH\",\n \"startDate\": \"2025-01-14T10:30:00Z\",\n \"finishDate\": \"2025-01-14T10:30:05Z\",\n \"balance\": \"4950.00\",\n \"status\": \"COMPLETED\"\n },\n {\n \"uuid\": \"uuid-tx-002\",\n \"id\": {\n \"value\": \"tx-002\"\n },\n \"thisAccount\": {\n \"accountId\": {\n \"value\": \"acc-001\"\n },\n \"accountType\": \"CURRENT\",\n \"balance\": \"5000.00\",\n \"currency\": \"EUR\",\n \"name\": \"Alice Workshop Account\",\n \"label\": \"Alice Workshop Account\",\n \"number\": \"acc-001\",\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"lastUpdate\": \"2025-01-14T00:00:00Z\",\n \"branchId\": \"branch-001\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"accountRules\": [],\n \"accountHolder\": \"Alice\",\n \"attributes\": []\n },\n \"otherAccount\": {\n \"nationalIdentifier\": \"EMPLOYER001\",\n \"kind\": \"CREDIT\",\n \"counterpartyId\": \"cp-employer-001\",\n \"counterpartyName\": \"Employer Corp AG\",\n \"thisBankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"thisAccountId\": {\n \"value\": \"acc-001\"\n },\n \"otherBankRoutingScheme\": \"BIC\",\n \"otherBankRoutingAddress\": \"EMPLBIC0\",\n \"otherAccountRoutingScheme\": \"IBAN\",\n \"otherAccountRoutingAddress\": \"DE98765432109876543210\",\n \"otherAccountProvider\": \"OBP\",\n \"isBeneficiary\": false\n },\n \"transactionType\": \"CREDIT\",\n \"amount\": \"3000.00\",\n \"currency\": \"EUR\",\n \"description\": \"Monthly salary - Employer Corp AG\",\n \"startDate\": \"2025-01-13T09:00:00Z\",\n \"finishDate\": \"2025-01-13T09:00:01Z\",\n \"balance\": \"5000.00\",\n \"status\": \"COMPLETED\"\n },\n {\n \"uuid\": \"uuid-tx-003\",\n \"id\": {\n \"value\": \"tx-003\"\n },\n \"thisAccount\": {\n \"accountId\": {\n \"value\": \"acc-001\"\n },\n \"accountType\": \"CURRENT\",\n \"balance\": \"2000.00\",\n \"currency\": \"EUR\",\n \"name\": \"Alice Workshop Account\",\n \"label\": \"Alice Workshop Account\",\n \"number\": \"acc-001\",\n \"bankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"lastUpdate\": \"2025-01-14T00:00:00Z\",\n \"branchId\": \"branch-001\",\n \"accountRoutings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"accountRules\": [],\n \"accountHolder\": \"Alice\",\n \"attributes\": []\n },\n \"otherAccount\": {\n \"nationalIdentifier\": \"COFFEE001\",\n \"kind\": \"DEBIT\",\n \"counterpartyId\": \"cp-coffee-001\",\n \"counterpartyName\": \"Brew & Co\",\n \"thisBankId\": {\n \"value\": \"workshop-bank-001\"\n },\n \"thisAccountId\": {\n \"value\": \"acc-001\"\n },\n \"otherBankRoutingScheme\": \"BIC\",\n \"otherBankRoutingAddress\": \"BREWBIC0\",\n \"otherAccountRoutingScheme\": \"IBAN\",\n \"otherAccountRoutingAddress\": \"DE11223344556677889900\",\n \"otherAccountProvider\": \"OBP\",\n \"isBeneficiary\": true\n },\n \"transactionType\": \"DEBIT\",\n \"amount\": \"25.50\",\n \"currency\": \"EUR\",\n \"description\": \"Coffee subscription - Brew & Co\",\n \"startDate\": \"2025-01-12T08:15:00Z\",\n \"finishDate\": \"2025-01-12T08:15:02Z\",\n \"balance\": \"2000.00\",\n \"status\": \"COMPLETED\"\n }\n ]\n}" + } + ] + } + ] + }, + { + "name": "Get Token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "if (pm.response.code === 200 || pm.response.code === 201) {", + " const jsonData = pm.response.json();", + " if (jsonData.token) {", + " pm.environment.set('token', jsonData.token);", + " console.log('Token saved:', jsonData.token);", + " }", + "}" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "DirectLogin", + "value": "username={{username}},password={{password}},consumer_key={{consumer_key}}" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/my/logins/direct", + "host": [ + "{{base_url}}" + ], + "path": [ + "my", + "logins", + "direct" + ] + } + }, + "response": [] + }, + { + "name": "Create MethodRouting", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "{{K1}}", + "value": "{{V1}}", + "type": "text" + }, + { + "key": "{{K2}}", + "value": "{{V2}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"is_bank_id_exact_match\": false,\n \"method_name\": \"checkBankAccountExists\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"bank_id_pattern\": \".*\",\n \"parameters\": []\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url-400}}/management/method_routings", + "host": [ + "{{url-400}}" + ], + "path": [ + "management", + "method_routings" + ] + } + }, + "response": [] + }, + { + "name": "get MethodRoutings", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "{{K1}}", + "value": "{{V1}}", + "type": "text" + }, + { + "key": "{{K2}}", + "value": "{{V2}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"is_bank_id_exact_match\": false,\n \"method_name\": \"getBankAccounts\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"bank_id_pattern\": \".*\",\n \"parameters\": []\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url-400}}/management/method_routings", + "host": [ + "{{url-400}}" + ], + "path": [ + "management", + "method_routings" + ] + } + }, + "response": [ + { + "name": "get MethodRoutings", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "{{K1}}", + "value": "{{V1}}", + "type": "text" + }, + { + "key": "{{K2}}", + "value": "{{V2}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"is_bank_id_exact_match\": false,\n \"method_name\": \"getBankAccounts\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"bank_id_pattern\": \".*\",\n \"parameters\": []\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url-400}}/management/method_routings", + "host": [ + "{{url-400}}" + ], + "path": [ + "management", + "method_routings" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 22:43:36 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "1823" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "ETag", + "value": "aba83ecbb9e6570049faea123dec3798971ad81760f97b3f241bb9970a48c2e0" + }, + { + "key": "Correlation-Id", + "value": "7e4098a2-37db-4fa7-900e-6e1cc7aba577" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 22:43:36 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"method_routings\": [\n {\n \"method_name\": \"checkBankAccountExists\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"9da6e3fd-a3ee-41d7-af88-00487997d4e2\"\n },\n {\n \"method_name\": \"getAdapterInfo\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"1f0f8951-33de-4362-a8b3-2a989c625fd4\"\n },\n {\n \"method_name\": \"getBank\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"47f38753-c7fc-4a49-8502-90c32f4c5ef9\"\n },\n {\n \"method_name\": \"getBankAccounts\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"219e5708-9494-425b-8251-ac2c5dbef500\"\n },\n {\n \"method_name\": \"getBankAccountsForUser\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"37364297-39cd-41d4-9de4-d4d8c6a4a5e4\"\n },\n {\n \"method_name\": \"getBanks\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"c880625a-edc9-4e81-8f1b-289c3a286f2c\"\n },\n {\n \"method_name\": \"getCoreBankAccounts\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"62d0a449-a436-40ea-852e-19db9f136347\"\n },\n {\n \"method_name\": \"getTransactions\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"05de1907-0a96-4f3a-a07e-bbd7c561b6b5\"\n },\n {\n \"method_name\": \"makePaymentv210\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"1dc85845-fa61-4d15-a1da-ec86c401b88a\"\n }\n ]\n}" + } + ] + }, + { + "name": "Get Banks", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v5.0.0", + "banks" + ] + } + }, + "response": [] + }, + { + "name": "Get Bank", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks/workshop-bank-001", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v5.0.0", + "banks", + "workshop-bank-001" + ] + } + }, + "response": [] + }, + { + "name": "Get User (Current)", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v6.0.0/users/current", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v6.0.0", + "users", + "current" + ] + } + }, + "response": [] + }, + { + "name": "Add Entitlement", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{V2}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"bank_id\": \"\",\n \"role_name\": \"CanGetConnectorEndpoint\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{base_url}}/obp/v6.0.0/users/0d7a16d6-b6e0-4aef-b58c-b9f7556519b1/entitlements", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v6.0.0", + "users", + "0d7a16d6-b6e0-4aef-b58c-b9f7556519b1", + "entitlements" + ] + }, + "description": "\"getBranches\",\n\"GET\",\n\"/banks/BANK_ID/branches\",\n\"Get Bank Branches\",\ns\"\"\"Returns information about branches for a single bank specified by BANK_ID including:\n |\n |* Name\n |* Address\n |* Geo Location\n |* License the data under this endpoint is released under\n |" + }, + "response": [] + }, + { + "name": "Refresch User", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \n}" + }, + "url": { + "raw": "{{base_url}}/obp/v6.0.0/users/0d7a16d6-b6e0-4aef-b58c-b9f7556519b1/refresh", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v6.0.0", + "users", + "0d7a16d6-b6e0-4aef-b58c-b9f7556519b1", + "refresh" + ] + } + }, + "response": [] + }, + { + "name": "Get Accounts at Bank", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v6.0.0/banks/{{bank_id}}/accounts", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v6.0.0", + "banks", + "{{bank_id}}", + "accounts" + ] + } + }, + "response": [ + { + "name": "Get Accounts at Bank", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v6.0.0/banks/{{bank_id}}/accounts", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v6.0.0", + "banks", + "{{bank_id}}", + "accounts" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 20:05:11 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "336" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "ETag", + "value": "ec1f9781f6b335821ddf7a7bc5347374be6d95fd0b9a1068c3b4932ba741d36f" + }, + { + "key": "Correlation-Id", + "value": "9a0f84c8-e700-448e-b390-9abcbfb71300" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 20:05:11 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"accounts\": [\n {\n \"account_id\": \"acc-001\",\n \"bank_id\": \"workshop-bank-001\",\n \"label\": \"Alice Workshop Account\",\n \"views_available\": [\n {\n \"id\": \"owner\",\n \"short_name\": \"Owner\",\n \"is_public\": false\n }\n ]\n },\n {\n \"account_id\": \"acc-002\",\n \"bank_id\": \"workshop-bank-001\",\n \"label\": \"Bob Workshop Account\",\n \"views_available\": [\n {\n \"id\": \"owner\",\n \"short_name\": \"Owner\",\n \"is_public\": false\n }\n ]\n }\n ]\n}" + } + ] + }, + { + "name": "Create Transaction Request (SANDBOX_TAN)", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"to\": {\n \"bank_id\": \"workshop-bank-001\",\n \"account_id\": \"acc-002\"\n },\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"10.00\"\n },\n \"description\": \"Workshop test payment\",\n \"charge_policy\": \"SHARED\"\n}" + }, + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks/{{bank_id}}/accounts/acc-001/owner/transaction-request-types/SANDBOX_TAN/transaction-requests", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v5.0.0", + "banks", + "{{bank_id}}", + "accounts", + "acc-001", + "owner", + "transaction-request-types", + "SANDBOX_TAN", + "transaction-requests" + ] + } + }, + "response": [ + { + "name": "Create Transaction Request (SANDBOX_TAN)", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"to\": {\n \"bank_id\": \"workshop-bank-001\",\n \"account_id\": \"acc-002\"\n },\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"10.00\"\n },\n \"description\": \"Workshop test payment\",\n \"charge_policy\": \"SHARED\"\n}" + }, + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks/{{bank_id}}/accounts/acc-001/owner/transaction-request-types/SANDBOX_TAN/transaction-requests", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v5.0.0", + "banks", + "{{bank_id}}", + "accounts", + "acc-001", + "owner", + "transaction-request-types", + "SANDBOX_TAN", + "transaction-requests" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 22:55:48 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "555" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "ETag", + "value": "60cb7fb835b985e3661d404c18f51d4910d0dc2d72e2d39e1e405daadefc61ba" + }, + { + "key": "Correlation-Id", + "value": "bc115d47-ae76-4aae-befc-b9327774149f" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 22:55:48 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"id\": \"03bac2d9-e86b-4f83-9298-f224003e706e\",\n \"type\": \"SANDBOX_TAN\",\n \"from\": {\n \"bank_id\": \"workshop-bank-001\",\n \"account_id\": \"acc-001\"\n },\n \"details\": {\n \"to_sandbox_tan\": {\n \"bank_id\": \"workshop-bank-001\",\n \"account_id\": \"acc-002\"\n },\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"10.00\"\n },\n \"description\": \"Workshop test payment\"\n },\n \"transaction_ids\": [\n \"tx-workshop-1773874548036\"\n ],\n \"status\": \"COMPLETED\",\n \"start_date\": \"2026-03-18T22:55:48Z\",\n \"end_date\": \"2026-03-18T22:55:48Z\",\n \"challenge\": null,\n \"charge\": {\n \"summary\": \"Total charges for completed transaction\",\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"2.0\"\n }\n }\n}" + } + ] + }, + { + "name": "Get Transactions", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks/{{bank_id}}/accounts/{{account_id}}/owner/transactions", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v5.0.0", + "banks", + "{{bank_id}}", + "accounts", + "{{account_id}}", + "owner", + "transactions" + ] + } + }, + "response": [ + { + "name": "Get Transactions", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks/{{bank_id}}/accounts/{{account_id}}/owner/transactions", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v5.0.0", + "banks", + "{{bank_id}}", + "accounts", + "{{account_id}}", + "owner", + "transactions" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 22:56:02 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "2966" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "Range", + "value": "items=0-50" + }, + { + "key": "ETag", + "value": "f6a8a79e60406ecf9cda639834f5910a9e52e78e965fe889e2ad756516f76a03" + }, + { + "key": "Correlation-Id", + "value": "55d902ba-6b49-46a9-9d94-f42a232f6bb9" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 22:56:02 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"transactions\": [\n {\n \"id\": \"tx-001\",\n \"this_account\": {\n \"id\": \"acc-001\",\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"MOCKBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"holders\": [\n {\n \"name\": \"workshop.user\",\n \"is_alias\": false\n }\n ]\n },\n \"other_account\": {\n \"id\": \"cp-merchant-001\",\n \"holder\": {\n \"name\": \"Online Shop GmbH\",\n \"is_alias\": false\n },\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"SHOPBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE12345678901234567890\"\n }\n ],\n \"metadata\": {\n \"public_alias\": \"ALIAS_E1D77C\",\n \"private_alias\": null,\n \"more_info\": null,\n \"URL\": null,\n \"image_URL\": null,\n \"open_corporates_URL\": null,\n \"corporate_location\": null,\n \"physical_location\": null\n }\n },\n \"details\": {\n \"type\": \"DEBIT\",\n \"description\": \"Online purchase - Online Shop GmbH\",\n \"posted\": \"2025-01-14T10:30:00Z\",\n \"completed\": \"2025-01-14T10:30:05Z\",\n \"new_balance\": {\n \"currency\": \"EUR\",\n \"amount\": \"4950.00\"\n },\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"50.00\"\n }\n },\n \"metadata\": {\n \"narrative\": null,\n \"comments\": [],\n \"tags\": [],\n \"images\": [],\n \"where\": null\n },\n \"transaction_attributes\": []\n },\n {\n \"id\": \"tx-002\",\n \"this_account\": {\n \"id\": \"acc-001\",\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"MOCKBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"holders\": [\n {\n \"name\": \"workshop.user\",\n \"is_alias\": false\n }\n ]\n },\n \"other_account\": {\n \"id\": \"cp-employer-001\",\n \"holder\": {\n \"name\": \"Employer Corp AG\",\n \"is_alias\": false\n },\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"EMPLBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE98765432109876543210\"\n }\n ],\n \"metadata\": {\n \"public_alias\": \"ALIAS_B36A9A\",\n \"private_alias\": null,\n \"more_info\": null,\n \"URL\": null,\n \"image_URL\": null,\n \"open_corporates_URL\": null,\n \"corporate_location\": null,\n \"physical_location\": null\n }\n },\n \"details\": {\n \"type\": \"CREDIT\",\n \"description\": \"Monthly salary - Employer Corp AG\",\n \"posted\": \"2025-01-13T09:00:00Z\",\n \"completed\": \"2025-01-13T09:00:01Z\",\n \"new_balance\": {\n \"currency\": \"EUR\",\n \"amount\": \"5000.00\"\n },\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"3000.00\"\n }\n },\n \"metadata\": {\n \"narrative\": null,\n \"comments\": [],\n \"tags\": [],\n \"images\": [],\n \"where\": null\n },\n \"transaction_attributes\": []\n },\n {\n \"id\": \"tx-003\",\n \"this_account\": {\n \"id\": \"acc-001\",\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"MOCKBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"holders\": [\n {\n \"name\": \"workshop.user\",\n \"is_alias\": false\n }\n ]\n },\n \"other_account\": {\n \"id\": \"cp-coffee-001\",\n \"holder\": {\n \"name\": \"Brew & Co\",\n \"is_alias\": false\n },\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"BREWBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE11223344556677889900\"\n }\n ],\n \"metadata\": {\n \"public_alias\": \"ALIAS_7648D7\",\n \"private_alias\": null,\n \"more_info\": null,\n \"URL\": null,\n \"image_URL\": null,\n \"open_corporates_URL\": null,\n \"corporate_location\": null,\n \"physical_location\": null\n }\n },\n \"details\": {\n \"type\": \"DEBIT\",\n \"description\": \"Coffee subscription - Brew & Co\",\n \"posted\": \"2025-01-12T08:15:00Z\",\n \"completed\": \"2025-01-12T08:15:02Z\",\n \"new_balance\": {\n \"currency\": \"EUR\",\n \"amount\": \"2000.00\"\n },\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"25.50\"\n }\n },\n \"metadata\": {\n \"narrative\": null,\n \"comments\": [],\n \"tags\": [],\n \"images\": [],\n \"where\": null\n },\n \"transaction_attributes\": []\n }\n ]\n}" + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "if (!pm.environment.get('token')) {", + " const baseUrl = pm.environment.get('base_url') || 'http://127.0.0.1:8080';", + " const username = pm.environment.get('username');", + " const password = pm.environment.get('password');", + " const consumerKey = pm.environment.get('consumer_key');", + " ", + " if (username && password && consumerKey) {", + " pm.sendRequest({", + " url: baseUrl + '/my/logins/direct',", + " method: 'POST',", + " header: {", + " 'Content-Type': 'application/json',", + " 'DirectLogin': 'username=' + username + ',password=' + password + ',consumer_key=' + consumerKey", + " }", + " }, function (err, response) {", + " if (!err && response.json().token) {", + " pm.environment.set('token', response.json().token);", + " }", + " });", + " }", + "}" + ] + } + } + ], + "variable": [ + { + "key": "base_url", + "value": "http://127.0.0.1:8080", + "type": "string" + }, + { + "key": "bank_id", + "value": "workshop-bank-001", + "type": "string" + }, + { + "key": "account_id", + "value": "acc-001", + "type": "string" + } + ] +} \ No newline at end of file From dac7d1d55ddc09e8a5cb135dec77cfa3c95db700 Mon Sep 17 00:00:00 2001 From: Hongwei Date: Thu, 19 Mar 2026 00:13:48 +0100 Subject: [PATCH 6/7] bugfix/fix timestamp format in getTransactions to remove milliseconds for OBP-API compatibility --- .../implementations/MockLocalAdapter.scala | 96 +++++++++++++++++-- 1 file changed, 89 insertions(+), 7 deletions(-) diff --git a/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala b/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala index af240f7..6569150 100644 --- a/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala +++ b/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala @@ -22,6 +22,7 @@ import com.tesobe.obp.adapter.interfaces._ import com.tesobe.obp.adapter.models._ import com.tesobe.obp.adapter.telemetry.Telemetry import io.circe._ +import scala.collection.mutable /** * Mock Local Adapter for testing and development. @@ -39,6 +40,8 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { override def name: String = "Mock-Local-Adapter" override def version: String = "1.0.0" + private val transactionStorage: mutable.Map[String, mutable.ListBuffer[Json]] = mutable.Map.empty + override def handleMessage( process: String, data: JsonObject, @@ -267,6 +270,77 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { private def makePaymentv210(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { val amount = data("amount").flatMap(_.asString).getOrElse("0.00") val currency = data("currency").flatMap(_.asString).getOrElse("EUR") + val description = data("description").flatMap(_.asString).getOrElse("Payment via makePaymentv210") + val fromAccountId = data("fromAccountId").flatMap(_.asString) + .orElse(data("from_account_id").flatMap(_.asString)) + .getOrElse("acc-001") + val toAccountId = data("toAccountId").flatMap(_.asString) + .orElse(data("to_account_id").flatMap(_.asString)) + .orElse(data("to").flatMap(_.asObject).flatMap(_("account_id")).flatMap(_.asString)) + .getOrElse("acc-002") + val toBankId = data("toBankId").flatMap(_.asString) + .orElse(data("to_bank_id").flatMap(_.asString)) + .orElse(data("to").flatMap(_.asObject).flatMap(_("bank_id")).flatMap(_.asString)) + .getOrElse("workshop-bank-001") + + val transactionId = s"tx-workshop-${System.currentTimeMillis()}" + val timestamp = { + val instant = java.time.Instant.now() + val truncated = instant.truncatedTo(java.time.temporal.ChronoUnit.SECONDS) + truncated.toString + } + + val transaction = Json.obj( + "uuid" -> Json.fromString(s"uuid-$transactionId"), + "id" -> Json.obj("value" -> Json.fromString(transactionId)), + "thisAccount" -> Json.obj( + "accountId" -> Json.obj("value" -> Json.fromString(fromAccountId)), + "accountType" -> Json.fromString("CURRENT"), + "balance" -> Json.fromString("4950.00"), + "currency" -> Json.fromString(currency), + "name" -> Json.fromString("Workshop Account"), + "label" -> Json.fromString("Workshop Account"), + "number" -> Json.fromString(fromAccountId), + "bankId" -> Json.obj("value" -> Json.fromString("workshop-bank-001")), + "lastUpdate" -> Json.fromString(timestamp), + "branchId" -> Json.fromString("branch-001"), + "accountRoutings" -> Json.arr( + Json.obj( + "scheme" -> Json.fromString("IBAN"), + "address" -> Json.fromString("DE89370400440532013000") + ) + ), + "accountRules" -> Json.arr(), + "accountHolder" -> Json.fromString("Workshop User"), + "attributes" -> Json.arr() + ), + "otherAccount" -> Json.obj( + "kind" -> Json.fromString("DEBIT"), + "counterpartyId" -> Json.fromString(s"cp-$toAccountId"), + "counterpartyName" -> Json.fromString("Payment Recipient"), + "thisBankId" -> Json.obj("value" -> Json.fromString("workshop-bank-001")), + "thisAccountId" -> Json.obj("value" -> Json.fromString(fromAccountId)), + "otherBankRoutingScheme" -> Json.fromString("BIC"), + "otherBankRoutingAddress" -> Json.fromString("RECIPBIC0"), + "otherAccountRoutingScheme" -> Json.fromString("IBAN"), + "otherAccountRoutingAddress" -> Json.fromString("DE98765432109876543210"), + "otherAccountProvider" -> Json.fromString("OBP"), + "isBeneficiary" -> Json.fromBoolean(true) + ), + "transactionType" -> Json.fromString("DEBIT"), + "amount" -> Json.fromString(amount), + "currency" -> Json.fromString(currency), + "description" -> Json.fromString(description), + "startDate" -> Json.fromString(timestamp), + "finishDate" -> Json.fromString(timestamp), + "balance" -> Json.fromString("4950.00"), + "status" -> Json.fromString("COMPLETED") + ) + + transactionStorage.synchronized { + val accountTransactions = transactionStorage.getOrElseUpdate(fromAccountId, mutable.ListBuffer.empty) + accountTransactions.prepend(transaction) + } telemetry.recordPaymentSuccess( bankId = "workshop-bank-001", @@ -274,11 +348,11 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { currency = currency, correlationId = callContext.correlationId ) *> - telemetry.debug(s"Processing payment: $amount $currency", Some(callContext.correlationId)) *> + telemetry.debug(s"Processing payment: $amount $currency, stored transaction: $transactionId", Some(callContext.correlationId)) *> IO.pure( LocalAdapterResult.success( JsonObject( - "value" -> Json.fromString(s"tx-workshop-${System.currentTimeMillis()}") + "value" -> Json.fromString(transactionId) ) ) ) @@ -398,10 +472,11 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { .orElse(data("accountId").flatMap(_.asString)) .getOrElse("acc-001") - telemetry.debug(s"Getting transactions for account: $accountId", Some(callContext.correlationId)) *> - IO.pure( - LocalAdapterResult.success( - Json.arr( + val storedTransactions = transactionStorage.synchronized { + transactionStorage.getOrElse(accountId, mutable.ListBuffer.empty).toList + } + + val staticTransactions = List( Json.obj( "uuid" -> Json.fromString("uuid-tx-001"), "id" -> Json.obj("value" -> Json.fromString("tx-001")), @@ -543,7 +618,14 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { "balance" -> Json.fromString("2000.00"), "status" -> Json.fromString("COMPLETED") ) - ), + ) + + val allTransactions = storedTransactions ++ staticTransactions + + telemetry.debug(s"Getting transactions for account: $accountId, stored: ${storedTransactions.size}, static: ${staticTransactions.size}, total: ${allTransactions.size}", Some(callContext.correlationId)) *> + IO.pure( + LocalAdapterResult.success( + Json.arr(allTransactions: _*), Nil ) ) From b74dfa2669cddb85aecff0c7c35b3122e72c7b9d Mon Sep 17 00:00:00 2001 From: Hongwei Date: Thu, 19 Mar 2026 00:31:55 +0100 Subject: [PATCH 7/7] feature/added getTransaction --- postman/OBP Workshop.postman_collection.json | 139 +++++++++++++++++- .../implementations/MockLocalAdapter.scala | 98 ++++++++++-- 2 files changed, 215 insertions(+), 22 deletions(-) diff --git a/postman/OBP Workshop.postman_collection.json b/postman/OBP Workshop.postman_collection.json index f99e005..9ed211b 100644 --- a/postman/OBP Workshop.postman_collection.json +++ b/postman/OBP Workshop.postman_collection.json @@ -1173,7 +1173,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"is_bank_id_exact_match\": false,\n \"method_name\": \"checkBankAccountExists\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"bank_id_pattern\": \".*\",\n \"parameters\": []\n}", + "raw": "{\n \"is_bank_id_exact_match\": false,\n \"method_name\": \"getTransaction\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"bank_id_pattern\": \".*\",\n \"parameters\": []\n}", "options": { "raw": { "language": "json" @@ -1290,7 +1290,7 @@ "header": [ { "key": "Date", - "value": "Wed, 18 Mar 2026 22:43:36 GMT" + "value": "Wed, 18 Mar 2026 23:31:07 GMT" }, { "key": "Connection", @@ -1298,7 +1298,7 @@ }, { "key": "Content-Length", - "value": "1823" + "value": "2022" }, { "key": "Content-Type", @@ -1322,11 +1322,11 @@ }, { "key": "ETag", - "value": "aba83ecbb9e6570049faea123dec3798971ad81760f97b3f241bb9970a48c2e0" + "value": "6648d84a6cbefcee49a15ab49e4cd7b8093f30a7fd7eeff4a6744cba33bbd4b9" }, { "key": "Correlation-Id", - "value": "7e4098a2-37db-4fa7-900e-6e1cc7aba577" + "value": "e685d875-c62c-42f9-a311-a456ed810ec9" }, { "key": "Cache-Control", @@ -1338,7 +1338,7 @@ }, { "key": "Expires", - "value": "Wed, 18 Mar 2026 22:43:36 GMT" + "value": "Wed, 18 Mar 2026 23:31:07 GMT" }, { "key": "X-Frame-Options", @@ -1346,7 +1346,7 @@ } ], "cookie": [], - "body": "{\n \"method_routings\": [\n {\n \"method_name\": \"checkBankAccountExists\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"9da6e3fd-a3ee-41d7-af88-00487997d4e2\"\n },\n {\n \"method_name\": \"getAdapterInfo\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"1f0f8951-33de-4362-a8b3-2a989c625fd4\"\n },\n {\n \"method_name\": \"getBank\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"47f38753-c7fc-4a49-8502-90c32f4c5ef9\"\n },\n {\n \"method_name\": \"getBankAccounts\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"219e5708-9494-425b-8251-ac2c5dbef500\"\n },\n {\n \"method_name\": \"getBankAccountsForUser\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"37364297-39cd-41d4-9de4-d4d8c6a4a5e4\"\n },\n {\n \"method_name\": \"getBanks\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"c880625a-edc9-4e81-8f1b-289c3a286f2c\"\n },\n {\n \"method_name\": \"getCoreBankAccounts\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"62d0a449-a436-40ea-852e-19db9f136347\"\n },\n {\n \"method_name\": \"getTransactions\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"05de1907-0a96-4f3a-a07e-bbd7c561b6b5\"\n },\n {\n \"method_name\": \"makePaymentv210\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"1dc85845-fa61-4d15-a1da-ec86c401b88a\"\n }\n ]\n}" + "body": "{\n \"method_routings\": [\n {\n \"method_name\": \"checkBankAccountExists\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"9da6e3fd-a3ee-41d7-af88-00487997d4e2\"\n },\n {\n \"method_name\": \"getAdapterInfo\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"1f0f8951-33de-4362-a8b3-2a989c625fd4\"\n },\n {\n \"method_name\": \"getBank\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"47f38753-c7fc-4a49-8502-90c32f4c5ef9\"\n },\n {\n \"method_name\": \"getBankAccounts\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"219e5708-9494-425b-8251-ac2c5dbef500\"\n },\n {\n \"method_name\": \"getBankAccountsForUser\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"37364297-39cd-41d4-9de4-d4d8c6a4a5e4\"\n },\n {\n \"method_name\": \"getBanks\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"c880625a-edc9-4e81-8f1b-289c3a286f2c\"\n },\n {\n \"method_name\": \"getCoreBankAccounts\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"62d0a449-a436-40ea-852e-19db9f136347\"\n },\n {\n \"method_name\": \"getTransaction\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"7b8ba565-9a75-4e57-a42d-0b7fef4215bc\"\n },\n {\n \"method_name\": \"getTransactions\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"05de1907-0a96-4f3a-a07e-bbd7c561b6b5\"\n },\n {\n \"method_name\": \"makePaymentv210\",\n \"connector_name\": \"rabbitmq_vOct2024\",\n \"is_bank_id_exact_match\": false,\n \"bank_id_pattern\": \".*\",\n \"parameters\": [],\n \"method_routing_id\": \"1dc85845-fa61-4d15-a1da-ec86c401b88a\"\n }\n ]\n}" } ] }, @@ -1893,6 +1893,131 @@ "body": "{\n \"transactions\": [\n {\n \"id\": \"tx-001\",\n \"this_account\": {\n \"id\": \"acc-001\",\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"MOCKBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"holders\": [\n {\n \"name\": \"workshop.user\",\n \"is_alias\": false\n }\n ]\n },\n \"other_account\": {\n \"id\": \"cp-merchant-001\",\n \"holder\": {\n \"name\": \"Online Shop GmbH\",\n \"is_alias\": false\n },\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"SHOPBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE12345678901234567890\"\n }\n ],\n \"metadata\": {\n \"public_alias\": \"ALIAS_E1D77C\",\n \"private_alias\": null,\n \"more_info\": null,\n \"URL\": null,\n \"image_URL\": null,\n \"open_corporates_URL\": null,\n \"corporate_location\": null,\n \"physical_location\": null\n }\n },\n \"details\": {\n \"type\": \"DEBIT\",\n \"description\": \"Online purchase - Online Shop GmbH\",\n \"posted\": \"2025-01-14T10:30:00Z\",\n \"completed\": \"2025-01-14T10:30:05Z\",\n \"new_balance\": {\n \"currency\": \"EUR\",\n \"amount\": \"4950.00\"\n },\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"50.00\"\n }\n },\n \"metadata\": {\n \"narrative\": null,\n \"comments\": [],\n \"tags\": [],\n \"images\": [],\n \"where\": null\n },\n \"transaction_attributes\": []\n },\n {\n \"id\": \"tx-002\",\n \"this_account\": {\n \"id\": \"acc-001\",\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"MOCKBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"holders\": [\n {\n \"name\": \"workshop.user\",\n \"is_alias\": false\n }\n ]\n },\n \"other_account\": {\n \"id\": \"cp-employer-001\",\n \"holder\": {\n \"name\": \"Employer Corp AG\",\n \"is_alias\": false\n },\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"EMPLBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE98765432109876543210\"\n }\n ],\n \"metadata\": {\n \"public_alias\": \"ALIAS_B36A9A\",\n \"private_alias\": null,\n \"more_info\": null,\n \"URL\": null,\n \"image_URL\": null,\n \"open_corporates_URL\": null,\n \"corporate_location\": null,\n \"physical_location\": null\n }\n },\n \"details\": {\n \"type\": \"CREDIT\",\n \"description\": \"Monthly salary - Employer Corp AG\",\n \"posted\": \"2025-01-13T09:00:00Z\",\n \"completed\": \"2025-01-13T09:00:01Z\",\n \"new_balance\": {\n \"currency\": \"EUR\",\n \"amount\": \"5000.00\"\n },\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"3000.00\"\n }\n },\n \"metadata\": {\n \"narrative\": null,\n \"comments\": [],\n \"tags\": [],\n \"images\": [],\n \"where\": null\n },\n \"transaction_attributes\": []\n },\n {\n \"id\": \"tx-003\",\n \"this_account\": {\n \"id\": \"acc-001\",\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"MOCKBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"holders\": [\n {\n \"name\": \"workshop.user\",\n \"is_alias\": false\n }\n ]\n },\n \"other_account\": {\n \"id\": \"cp-coffee-001\",\n \"holder\": {\n \"name\": \"Brew & Co\",\n \"is_alias\": false\n },\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"BREWBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE11223344556677889900\"\n }\n ],\n \"metadata\": {\n \"public_alias\": \"ALIAS_7648D7\",\n \"private_alias\": null,\n \"more_info\": null,\n \"URL\": null,\n \"image_URL\": null,\n \"open_corporates_URL\": null,\n \"corporate_location\": null,\n \"physical_location\": null\n }\n },\n \"details\": {\n \"type\": \"DEBIT\",\n \"description\": \"Coffee subscription - Brew & Co\",\n \"posted\": \"2025-01-12T08:15:00Z\",\n \"completed\": \"2025-01-12T08:15:02Z\",\n \"new_balance\": {\n \"currency\": \"EUR\",\n \"amount\": \"2000.00\"\n },\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"25.50\"\n }\n },\n \"metadata\": {\n \"narrative\": null,\n \"comments\": [],\n \"tags\": [],\n \"images\": [],\n \"where\": null\n },\n \"transaction_attributes\": []\n }\n ]\n}" } ] + }, + { + "name": "Get Transaction by Id", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks/{{bank_id}}/accounts/{{account_id}}/owner/transactions/tx-workshop-1773876558488/transaction", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v5.0.0", + "banks", + "{{bank_id}}", + "accounts", + "{{account_id}}", + "owner", + "transactions", + "tx-workshop-1773876558488", + "transaction" + ] + } + }, + "response": [ + { + "name": "Get Transaction by Id", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "DirectLogin token={{token}}" + } + ], + "url": { + "raw": "{{base_url}}/obp/v5.0.0/banks/{{bank_id}}/accounts/{{account_id}}/owner/transactions/tx-workshop-1773876558488/transaction", + "host": [ + "{{base_url}}" + ], + "path": [ + "obp", + "v5.0.0", + "banks", + "{{bank_id}}", + "accounts", + "{{account_id}}", + "owner", + "transactions", + "tx-workshop-1773876558488", + "transaction" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": null, + "header": [ + { + "key": "Date", + "value": "Wed, 18 Mar 2026 23:29:32 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Content-Length", + "value": "981" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "X-Rate-Limit-Reset", + "value": "1" + }, + { + "key": "X-Rate-Limit-Remaining", + "value": "0" + }, + { + "key": "X-Rate-Limit-Limit", + "value": "-1" + }, + { + "key": "ETag", + "value": "8e721351daad89af8d9256114a472c322448b2e7b744a41de7a26838fb3ca9a8" + }, + { + "key": "Correlation-Id", + "value": "e705240f-f247-421d-b1da-e54d06d4cb57" + }, + { + "key": "Cache-Control", + "value": "no-cache, private, no-store" + }, + { + "key": "Pragma", + "value": "no-cache" + }, + { + "key": "Expires", + "value": "Wed, 18 Mar 2026 23:29:32 GMT" + }, + { + "key": "X-Frame-Options", + "value": "DENY" + } + ], + "cookie": [], + "body": "{\n \"id\": \"tx-workshop-1773876558488\",\n \"this_account\": {\n \"id\": \"acc-001\",\n \"bank_routing\": {\n \"scheme\": null,\n \"address\": null\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE89370400440532013000\"\n }\n ],\n \"holders\": [\n {\n \"name\": \"workshop.user\",\n \"is_alias\": false\n }\n ]\n },\n \"other_account\": {\n \"id\": \"cp-acc-002\",\n \"holder\": {\n \"name\": \"Payment Recipient\",\n \"is_alias\": false\n },\n \"bank_routing\": {\n \"scheme\": \"BIC\",\n \"address\": \"RECIPBIC0\"\n },\n \"account_routings\": [\n {\n \"scheme\": \"IBAN\",\n \"address\": \"DE98765432109876543210\"\n }\n ],\n \"metadata\": {\n \"public_alias\": \"ALIAS_FA4491\",\n \"private_alias\": null,\n \"more_info\": null,\n \"URL\": null,\n \"image_URL\": null,\n \"open_corporates_URL\": null,\n \"corporate_location\": null,\n \"physical_location\": null\n }\n },\n \"details\": {\n \"type\": \"DEBIT\",\n \"description\": \"Workshop test payment\",\n \"posted\": \"2026-03-18T23:29:18Z\",\n \"completed\": \"2026-03-18T23:29:18Z\",\n \"new_balance\": {\n \"currency\": \"EUR\",\n \"amount\": \"4950.00\"\n },\n \"value\": {\n \"currency\": \"EUR\",\n \"amount\": \"10.00\"\n }\n },\n \"metadata\": {\n \"narrative\": null,\n \"comments\": [],\n \"tags\": [],\n \"images\": [],\n \"where\": null\n },\n \"transaction_attributes\": []\n}" + } + ] } ], "event": [ diff --git a/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala b/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala index 6569150..bc4dca9 100644 --- a/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala +++ b/src/main/scala/com/tesobe/obp/adapter/cbs/implementations/MockLocalAdapter.scala @@ -447,23 +447,91 @@ class MockLocalAdapter(telemetry: Telemetry) extends LocalAdapter { } private def getTransaction(data: JsonObject, callContext: CallContext): IO[LocalAdapterResult] = { - val transactionId = data("transactionId").flatMap(_.asString).getOrElse("unknown") + val transactionId = data("transactionId") + .flatMap(_.asObject).flatMap(_("value")).flatMap(_.asString) + .orElse(data("transactionId").flatMap(_.asString)) + .getOrElse("tx-001") + + val bankId = data("bankId") + .flatMap(_.asObject).flatMap(_("value")).flatMap(_.asString) + .orElse(data("bankId").flatMap(_.asString)) + .getOrElse("workshop-bank-001") + + val accountId = data("accountId") + .flatMap(_.asObject).flatMap(_("value")).flatMap(_.asString) + .orElse(data("accountId").flatMap(_.asString)) + .getOrElse("acc-001") + + val allTransactions = transactionStorage.synchronized { + transactionStorage.values.flatten.toList + } + + val foundTransaction = allTransactions.find { txn => + txn.asObject.flatMap(_("id")).flatMap(_.asObject).flatMap(_("value")).flatMap(_.asString).contains(transactionId) + } - telemetry.debug(s"Getting transaction: $transactionId", Some(callContext.correlationId)) *> + telemetry.debug(s"Getting transaction: $transactionId for account: $accountId, found in storage: ${foundTransaction.isDefined}", Some(callContext.correlationId)) *> IO.pure( - LocalAdapterResult.success( - JsonObject( - "transactionId" -> Json.fromString(transactionId), - "accountId" -> data("accountId").getOrElse(Json.fromString("account-123")), - "amount" -> Json.fromString("50.00"), - "currency" -> Json.fromString("EUR"), - "description" -> Json.fromString("Mock transaction"), - "posted" -> Json.fromString("2025-01-14T10:30:00Z"), - "completed" -> Json.fromString("2025-01-14T10:30:00Z"), - "newBalance" -> Json.fromString("1000.50"), - "type" -> Json.fromString("DEBIT") - ) - ) + foundTransaction match { + case Some(txn) => + LocalAdapterResult.success(txn.asObject.getOrElse(JsonObject.empty)) + case None => + LocalAdapterResult.success( + JsonObject( + "id" -> Json.obj("value" -> Json.fromString(transactionId)), + "thisAccount" -> Json.obj( + "accountId" -> Json.obj("value" -> Json.fromString(accountId)), + "accountType" -> Json.fromString("AC"), + "balance" -> Json.fromString("5000.00"), + "currency" -> Json.fromString("EUR"), + "name" -> Json.fromString("Workshop Account"), + "label" -> Json.fromString("My Workshop Account"), + "number" -> Json.fromString(accountId), + "bankId" -> Json.obj("value" -> Json.fromString(bankId)), + "lastUpdate" -> Json.fromString("2024-03-18T00:00:00Z"), + "branchId" -> Json.fromString("branch-001"), + "accountRoutings" -> Json.arr( + Json.obj( + "scheme" -> Json.fromString("IBAN"), + "address" -> Json.fromString("DE89370400440532013000") + ) + ), + "accountRules" -> Json.arr( + Json.obj( + "scheme" -> Json.fromString("AccountRule scheme"), + "value" -> Json.fromString("AccountRule value") + ) + ), + "accountHolder" -> Json.fromString("Workshop User"), + "attributes" -> Json.arr( + Json.obj( + "name" -> Json.fromString("STATUS"), + "type" -> Json.fromString("STRING"), + "value" -> Json.fromString("active") + ) + ) + ), + "otherAccount" -> Json.obj( + "kind" -> Json.fromString("Counterparty"), + "counterpartyId" -> Json.fromString("cp-merchant-001"), + "counterpartyName" -> Json.fromString("Online Shop GmbH"), + "thisBankId" -> Json.obj("value" -> Json.fromString("")), + "thisAccountId" -> Json.obj("value" -> Json.fromString("")), + "otherAccountRoutingScheme" -> Json.fromString("IBAN"), + "otherAccountRoutingAddress" -> Json.fromString("DE98765432109876543210"), + "isBeneficiary" -> Json.fromBoolean(false) + ), + "transactionType" -> Json.fromString("DEBIT"), + "amount" -> Json.fromString("50.00"), + "currency" -> Json.fromString("EUR"), + "description" -> Json.fromString("Online purchase - Workshop transaction"), + "startDate" -> Json.fromString("2024-01-14T10:30:00Z"), + "finishDate" -> Json.fromString("2024-01-14T10:30:00Z"), + "balance" -> Json.fromString("4950.00"), + "status" -> Json.fromString("COMPLETED") + ) + ) + } ) }