diff --git a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/ResourceDocsAPIMethods.scala b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/ResourceDocsAPIMethods.scala index 1815eba815..30cce89f82 100644 --- a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/ResourceDocsAPIMethods.scala +++ b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/ResourceDocsAPIMethods.scala @@ -189,6 +189,8 @@ trait ResourceDocsAPIMethods extends MdcLoggable with APIMethods220 with APIMeth case ApiVersion.v1_4_0 => resourceDocs // fully on http4s — no Lift route filter case ApiVersion.v1_3_0 => resourceDocs // fully on http4s — no Lift route filter case ApiVersion.`dynamic-entity` => resourceDocs // runtime CRUD now on Http4sDynamicEntity; routes are Nil, skip Lift-route filter + case ApiVersion.ukOpenBankingV20 => resourceDocs // fully on http4s — no Lift route filter + case ApiVersion.ukOpenBankingV31 => resourceDocs // fully on http4s — no Lift route filter case _ => resourceDocs.filter(rd => versionRoutesClasses.contains(rd.partialFunction.getClass)) } diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/APIMethods_UKOpenBanking_200.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/APIMethods_UKOpenBanking_200.scala index f18c3185c2..520520577b 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/APIMethods_UKOpenBanking_200.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/APIMethods_UKOpenBanking_200.scala @@ -1,235 +1,236 @@ -package code.api.UKOpenBanking.v2_0_0 - -import code.api.APIFailureNewStyle -import code.api.ResourceDocs1_4_0.SwaggerDefinitionsJSON -import code.api.util.APIUtil._ -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages.{InvalidConnectorResponseForGetTransactionRequests210, UnknownError, AuthenticatedUserIsRequired, _} -import code.api.util.newstyle.ViewNewStyle -import code.api.util.{ErrorMessages, NewStyle} -import code.bankconnectors.Connector -import code.model._ -import code.views.Views -import com.openbankproject.commons.ExecutionContext.Implicits.global -import com.openbankproject.commons.model.{AccountId, BankId, BankIdAccountId} -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper - -import scala.collection.mutable.ArrayBuffer -import scala.concurrent.Future - -object APIMethods_UKOpenBanking_200 extends RestHelper{ - - val implementedInApiVersion = OBP_UKOpenBanking_200.apiVersion - - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - val codeContext = CodeContext(resourceDocs, apiRelations) - - resourceDocs += ResourceDoc( - getAccountList, - implementedInApiVersion, - "getAccountList", - "GET", - "/accounts", - "UK Open Banking: Get Account List", - s""" - |Reads a list of bank accounts, with balances where required. - |It is assumed that a consent of the PSU to this access is already given and stored on the ASPSP system. - | - |${userAuthenticationMessage(true)} - | - |This call is work in progress - Experimental! - |""", - EmptyBody, - SwaggerDefinitionsJSON.accountsJsonUKOpenBanking_v200, - List(ErrorMessages.AuthenticatedUserIsRequired,ErrorMessages.UnknownError), - List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData)) - - apiRelations += ApiRelation(getAccountList, getAccountList, "self") - - lazy val getAccountList : OBPEndpoint = { - //get private accounts for all banks - case "accounts" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) - (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) - } yield { - (JSONFactory_UKOpenBanking_200.createAccountsListJSON(accounts), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getAccountTransactions, - implementedInApiVersion, - "getAccountTransactions", - "GET", - "/accounts/ACCOUNT_ID/transactions", - "UK Open Banking: Get Account Transactions", - s""" - |Reads account data from a given account addressed by “account-id”. - |${userAuthenticationMessage(true)} - | - |This call is work in progress - Experimental! - |""", - EmptyBody, - SwaggerDefinitionsJSON.transactionsJsonUKV200, - List(AuthenticatedUserIsRequired,UnknownError), - List(apiTagUKOpenBanking, apiTagTransaction, apiTagPrivateData, apiTagPsd2)) - - lazy val getAccountTransactions : OBPEndpoint = { - //get private accounts for all banks - case "accounts" :: AccountId(accountId) :: "transactions" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - (bank, callContext) <- NewStyle.function.getBank(BankId(defaultBankId), callContext) - (bankAccount, callContext) <- Future { BankAccountX(BankId(defaultBankId), accountId, callContext) } map { - x => fullBoxOrException(x ~> APIFailureNewStyle(DefaultBankIdNotSet, 400, callContext.map(_.toLight))) - } map { unboxFull(_) } - view <- ViewNewStyle.checkOwnerViewAccessAndReturnOwnerView(u, BankIdAccountId(bankAccount.bankId, bankAccount.accountId), callContext) - params <- Future { createQueriesByHttpParams(callContext.get.requestHeaders)} map { - x => fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, callContext.map(_.toLight))) - } map { unboxFull(_) } - - (transactionRequests, callContext) <- Future { Connector.connector.vend.getTransactionRequests210(u, bankAccount, callContext)} map { - x => fullBoxOrException(x ~> APIFailureNewStyle(InvalidConnectorResponseForGetTransactionRequests210, 400, callContext.map(_.toLight))) - } map { unboxFull(_) } - - (transactions, callContext) <- Future { bankAccount.getModeratedTransactions(bank, Full(u), view, BankIdAccountId(BankId(defaultBankId), accountId), callContext, params)} map { - x => fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, callContext.map(_.toLight))) - } map { unboxFull(_) } - - } yield { - (JSONFactory_UKOpenBanking_200.createTransactionsJson(transactions, transactionRequests), callContext) - } - } - } - - - resourceDocs += ResourceDoc( - getAccount, - implementedInApiVersion, - "getAccount", - "GET", - "/accounts/ACCOUNT_ID", - "UK Open Banking: Get Account", - s""" - |Reads a bank account, with balances where required. - |It is assumed that a consent of the PSU to this access is already given and stored on the ASPSP system. - | - |${userAuthenticationMessage(true)} - | - |This call is work in progress - Experimental! - |""", - EmptyBody, - SwaggerDefinitionsJSON.accountsJsonUKOpenBanking_v200, - List(ErrorMessages.AuthenticatedUserIsRequired,ErrorMessages.UnknownError), - List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData)) - - apiRelations += ApiRelation(getAccount, getAccount, "self") - - lazy val getAccount : OBPEndpoint = { - //get private accounts for all banks - case "accounts" :: AccountId(accountId) :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) map { - _.filter(_.accountId.value == accountId.value) - } - (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) - } yield { - (JSONFactory_UKOpenBanking_200.createAccountJSON(accounts), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getAccountBalances, - implementedInApiVersion, - "getAccountBalances", - "GET", - "/accounts/ACCOUNT_ID/balances", - "UK Open Banking: Get Account Balances", - s""" - |An AISP may retrieve the account balance information resource for a specific AccountId - |(which is retrieved in the call to GET /accounts). - | - |${userAuthenticationMessage(true)} - | - |This call is work in progress - Experimental! - |""", - EmptyBody, - SwaggerDefinitionsJSON.accountBalancesUKV200, - List(ErrorMessages.AuthenticatedUserIsRequired,ErrorMessages.UnknownError), - List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData)) - - lazy val getAccountBalances : OBPEndpoint = { - //get private accounts for all banks - case "accounts" :: AccountId(accountId) :: "balances" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - - (account, callContext) <- Future { BankAccountX(BankId(defaultBankId), accountId, callContext) } map { - x => fullBoxOrException(x ~> APIFailureNewStyle(DefaultBankIdNotSet, 400, callContext.map(_.toLight))) - } map { unboxFull(_) } - - view <- ViewNewStyle.checkOwnerViewAccessAndReturnOwnerView(u, BankIdAccountId(account.bankId, account.accountId), callContext) - - moderatedAccount <- Future {account.moderatedBankAccount(view, BankIdAccountId(account.bankId, account.accountId), Full(u), callContext)} map { - x => fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, callContext.map(_.toLight))) - } map { unboxFull(_) } - - } yield { - (JSONFactory_UKOpenBanking_200.createAccountBalanceJSON(moderatedAccount), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getBalances, - implementedInApiVersion, - "getBalances", - "GET", - "/balances", - "UK Open Banking: Get Balances", - s""" - | - |If an ASPSP has implemented the bulk retrieval endpoints - - |an AISP may optionally retrieve the account information resources in bulk. - |This will retrieve the resources for all authorised accounts linked to the account-request. - | - |${userAuthenticationMessage(true)} - | - |This call is work in progress - Experimental! - |""", - EmptyBody, - SwaggerDefinitionsJSON.accountBalancesUKV200, - List(ErrorMessages.AuthenticatedUserIsRequired,ErrorMessages.UnknownError), - List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData)) - - lazy val getBalances : OBPEndpoint = { - //get private accounts for all banks - case "balances" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - - availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) - - (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) - - } yield { - (JSONFactory_UKOpenBanking_200.createBalancesJSON(accounts), callContext) - } - } - } -} - - - +//package code.api.UKOpenBanking.v2_0_0 +// +//import code.api.APIFailureNewStyle +//import code.api.ResourceDocs1_4_0.SwaggerDefinitionsJSON +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages.{InvalidConnectorResponseForGetTransactionRequests210, UnknownError, AuthenticatedUserIsRequired, _} +//import code.api.util.newstyle.ViewNewStyle +//import code.api.util.{ErrorMessages, NewStyle} +//import code.bankconnectors.Connector +//import code.model._ +//import code.views.Views +//import com.openbankproject.commons.ExecutionContext.Implicits.global +//import com.openbankproject.commons.model.{AccountId, BankId, BankIdAccountId} +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +// +//import scala.collection.mutable.ArrayBuffer +//import scala.concurrent.Future +// +//object APIMethods_UKOpenBanking_200 extends RestHelper{ +// +// val implementedInApiVersion = OBP_UKOpenBanking_200.apiVersion +// +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// val codeContext = CodeContext(resourceDocs, apiRelations) +// +// resourceDocs += ResourceDoc( +// getAccountList, +// implementedInApiVersion, +// "getAccountList", +// "GET", +// "/accounts", +// "UK Open Banking: Get Account List", +// s""" +// |Reads a list of bank accounts, with balances where required. +// |It is assumed that a consent of the PSU to this access is already given and stored on the ASPSP system. +// | +// |${userAuthenticationMessage(true)} +// | +// |This call is work in progress - Experimental! +// |""", +// EmptyBody, +// SwaggerDefinitionsJSON.accountsJsonUKOpenBanking_v200, +// List(ErrorMessages.AuthenticatedUserIsRequired,ErrorMessages.UnknownError), +// List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData)) +// +// apiRelations += ApiRelation(getAccountList, getAccountList, "self") +// +// lazy val getAccountList : OBPEndpoint = { +// //get private accounts for all banks +// case "accounts" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) +// (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) +// } yield { +// (JSONFactory_UKOpenBanking_200.createAccountsListJSON(accounts), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getAccountTransactions, +// implementedInApiVersion, +// "getAccountTransactions", +// "GET", +// "/accounts/ACCOUNT_ID/transactions", +// "UK Open Banking: Get Account Transactions", +// s""" +// |Reads account data from a given account addressed by “account-id”. +// |${userAuthenticationMessage(true)} +// | +// |This call is work in progress - Experimental! +// |""", +// EmptyBody, +// SwaggerDefinitionsJSON.transactionsJsonUKV200, +// List(AuthenticatedUserIsRequired,UnknownError), +// List(apiTagUKOpenBanking, apiTagTransaction, apiTagPrivateData, apiTagPsd2)) +// +// lazy val getAccountTransactions : OBPEndpoint = { +// //get private accounts for all banks +// case "accounts" :: AccountId(accountId) :: "transactions" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// (bank, callContext) <- NewStyle.function.getBank(BankId(defaultBankId), callContext) +// (bankAccount, callContext) <- Future { BankAccountX(BankId(defaultBankId), accountId, callContext) } map { +// x => fullBoxOrException(x ~> APIFailureNewStyle(DefaultBankIdNotSet, 400, callContext.map(_.toLight))) +// } map { unboxFull(_) } +// view <- ViewNewStyle.checkOwnerViewAccessAndReturnOwnerView(u, BankIdAccountId(bankAccount.bankId, bankAccount.accountId), callContext) +// params <- Future { createQueriesByHttpParams(callContext.get.requestHeaders)} map { +// x => fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, callContext.map(_.toLight))) +// } map { unboxFull(_) } +// +// (transactionRequests, callContext) <- Future { Connector.connector.vend.getTransactionRequests210(u, bankAccount, callContext)} map { +// x => fullBoxOrException(x ~> APIFailureNewStyle(InvalidConnectorResponseForGetTransactionRequests210, 400, callContext.map(_.toLight))) +// } map { unboxFull(_) } +// +// (transactions, callContext) <- Future { bankAccount.getModeratedTransactions(bank, Full(u), view, BankIdAccountId(BankId(defaultBankId), accountId), callContext, params)} map { +// x => fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, callContext.map(_.toLight))) +// } map { unboxFull(_) } +// +// } yield { +// (JSONFactory_UKOpenBanking_200.createTransactionsJson(transactions, transactionRequests), callContext) +// } +// } +// } +// +// +// resourceDocs += ResourceDoc( +// getAccount, +// implementedInApiVersion, +// "getAccount", +// "GET", +// "/accounts/ACCOUNT_ID", +// "UK Open Banking: Get Account", +// s""" +// |Reads a bank account, with balances where required. +// |It is assumed that a consent of the PSU to this access is already given and stored on the ASPSP system. +// | +// |${userAuthenticationMessage(true)} +// | +// |This call is work in progress - Experimental! +// |""", +// EmptyBody, +// SwaggerDefinitionsJSON.accountsJsonUKOpenBanking_v200, +// List(ErrorMessages.AuthenticatedUserIsRequired,ErrorMessages.UnknownError), +// List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData)) +// +// apiRelations += ApiRelation(getAccount, getAccount, "self") +// +// lazy val getAccount : OBPEndpoint = { +// //get private accounts for all banks +// case "accounts" :: AccountId(accountId) :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) map { +// _.filter(_.accountId.value == accountId.value) +// } +// (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) +// } yield { +// (JSONFactory_UKOpenBanking_200.createAccountJSON(accounts), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getAccountBalances, +// implementedInApiVersion, +// "getAccountBalances", +// "GET", +// "/accounts/ACCOUNT_ID/balances", +// "UK Open Banking: Get Account Balances", +// s""" +// |An AISP may retrieve the account balance information resource for a specific AccountId +// |(which is retrieved in the call to GET /accounts). +// | +// |${userAuthenticationMessage(true)} +// | +// |This call is work in progress - Experimental! +// |""", +// EmptyBody, +// SwaggerDefinitionsJSON.accountBalancesUKV200, +// List(ErrorMessages.AuthenticatedUserIsRequired,ErrorMessages.UnknownError), +// List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData)) +// +// lazy val getAccountBalances : OBPEndpoint = { +// //get private accounts for all banks +// case "accounts" :: AccountId(accountId) :: "balances" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// +// (account, callContext) <- Future { BankAccountX(BankId(defaultBankId), accountId, callContext) } map { +// x => fullBoxOrException(x ~> APIFailureNewStyle(DefaultBankIdNotSet, 400, callContext.map(_.toLight))) +// } map { unboxFull(_) } +// +// view <- ViewNewStyle.checkOwnerViewAccessAndReturnOwnerView(u, BankIdAccountId(account.bankId, account.accountId), callContext) +// +// moderatedAccount <- Future {account.moderatedBankAccount(view, BankIdAccountId(account.bankId, account.accountId), Full(u), callContext)} map { +// x => fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, callContext.map(_.toLight))) +// } map { unboxFull(_) } +// +// } yield { +// (JSONFactory_UKOpenBanking_200.createAccountBalanceJSON(moderatedAccount), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getBalances, +// implementedInApiVersion, +// "getBalances", +// "GET", +// "/balances", +// "UK Open Banking: Get Balances", +// s""" +// | +// |If an ASPSP has implemented the bulk retrieval endpoints - +// |an AISP may optionally retrieve the account information resources in bulk. +// |This will retrieve the resources for all authorised accounts linked to the account-request. +// | +// |${userAuthenticationMessage(true)} +// | +// |This call is work in progress - Experimental! +// |""", +// EmptyBody, +// SwaggerDefinitionsJSON.accountBalancesUKV200, +// List(ErrorMessages.AuthenticatedUserIsRequired,ErrorMessages.UnknownError), +// List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData)) +// +// lazy val getBalances : OBPEndpoint = { +// //get private accounts for all banks +// case "balances" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// +// availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) +// +// (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) +// +// } yield { +// (JSONFactory_UKOpenBanking_200.createBalancesJSON(accounts), callContext) +// } +// } +// } +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/Http4sUKOBv200.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/Http4sUKOBv200.scala new file mode 100644 index 0000000000..f7a58e2c74 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/Http4sUKOBv200.scala @@ -0,0 +1,37 @@ +package code.api.UKOpenBanking.v2_0_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect._ +import code.api.util.APIUtil.ResourceDoc +import code.api.util.http4s.ResourceDocMiddleware +import code.util.Helper.MdcLoggable +import com.openbankproject.commons.util.ApiVersion +import org.http4s._ + +import scala.collection.mutable.ArrayBuffer + +/** + * UK Open Banking v2.0 — http4s aggregator (mirror of Berlin Group's Http4sBGv2). + * + * Wraps the migrated account-information routes with ResourceDocMiddleware and + * exposes `wrappedRoutes` for Http4sApp. All 5 v2.0 endpoints — including the two + * account-scoped ones (/accounts/ID/balances, /accounts/ID/transactions) — are + * migrated in Http4sUKOBv200AIS. The Lift ScannedApis aggregator + * (OBP_UKOpenBanking_200) registers `routes = Nil`, so no UK v2.0 path is served + * by Lift — nothing falls through to the Lift bridge. + */ +object Http4sUKOBv200 extends MdcLoggable { + + type HttpF[A] = OptionT[IO, A] + + val implementedInApiVersion: ApiVersion = ApiVersion.ukOpenBankingV20 + + val resourceDocs: ArrayBuffer[ResourceDoc] = + Http4sUKOBv200AIS.resourceDocs + + val allRoutes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + Http4sUKOBv200AIS.routes(req) + } + + val wrappedRoutes: HttpRoutes[IO] = ResourceDocMiddleware.apply(resourceDocs)(allRoutes) +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/Http4sUKOBv200AIS.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/Http4sUKOBv200AIS.scala new file mode 100644 index 0000000000..fba4040ecf --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/Http4sUKOBv200AIS.scala @@ -0,0 +1,194 @@ +package code.api.UKOpenBanking.v2_0_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.APIFailureNewStyle +import code.api.ResourceDocs1_4_0.SwaggerDefinitionsJSON +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, createQueriesByHttpParams, fullBoxOrException, unboxFull} +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.NewStyle +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.api.util.newstyle.ViewNewStyle +import code.model.BankAccountExtended +import code.util.Helper.MdcLoggable +import code.views.Views +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.model.{AccountId, BankIdAccountId} +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.common.Full +import net.liftweb.http.provider.HTTPParam +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** + * UK Open Banking v2.0 — account-information endpoints migrated from Lift to http4s. + * + * Faithful migration of all 5 endpoints: + * - getAccountList (/accounts), getAccount (/accounts/ID), getBalances (/balances) + * — list/aggregate endpoints using getBankAccounts + a JSON factory. + * - getAccountBalances (/accounts/ID/balances), getAccountTransactions + * (/accounts/ID/transactions) — account-scoped endpoints; their 3-segment + * patterns are distinct from the 2-segment ones, so http4s route matching + * picks the correct handler. + * No v2.0 endpoint is left on Lift. + */ +object Http4sUKOBv200AIS extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV20 + val resourceDocs = ArrayBuffer[ResourceDoc]() + val ukV20Prefix = Root / ApiVersion.ukOpenBankingV20.urlPrefix / ApiVersion.ukOpenBankingV20.apiShortVersion + + // GET /accounts — list all private accounts of the logged-in user + lazy val getAccountList: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV20Prefix` / "accounts" => + EndpointHelpers.withUser(req) { (u, cc) => + val callContext = Some(cc) + for { + availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) + (accounts, _) <- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) + } yield JSONFactory_UKOpenBanking_200.createAccountsListJSON(accounts) + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountList), + "GET", + "/accounts", + "UK Open Banking: Get Account List", + """Reads a list of bank accounts, with balances where required.""", + EmptyBody, + SwaggerDefinitionsJSON.accountsJsonUKOpenBanking_v200, + List(AuthenticatedUserIsRequired, UnknownError), + List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData), + http4sPartialFunction = Some(getAccountList) + ) + + // GET /accounts/{accountId} — single account + lazy val getAccount: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV20Prefix` / "accounts" / accountId => + EndpointHelpers.withUser(req) { (u, cc) => + val callContext = Some(cc) + for { + availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u).map(_.filter(_.accountId.value == accountId)) + (accounts, _) <- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) + } yield JSONFactory_UKOpenBanking_200.createAccountJSON(accounts) + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccount), + "GET", + "/accounts/ACCOUNT_ID", + "UK Open Banking: Get Account", + """Reads a bank account, with balances where required.""", + EmptyBody, + SwaggerDefinitionsJSON.accountsJsonUKOpenBanking_v200, + List(AuthenticatedUserIsRequired, UnknownError), + List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData), + http4sPartialFunction = Some(getAccount) + ) + + // GET /balances — bulk balances for all private accounts + lazy val getBalances: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV20Prefix` / "balances" => + EndpointHelpers.withUser(req) { (u, cc) => + val callContext = Some(cc) + for { + availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) + (accounts, _) <- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) + } yield JSONFactory_UKOpenBanking_200.createBalancesJSON(accounts) + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getBalances), + "GET", + "/balances", + "UK Open Banking: Get Balances", + """Bulk retrieval of balances for all authorised accounts.""", + EmptyBody, + SwaggerDefinitionsJSON.accountBalancesUKV200, + List(AuthenticatedUserIsRequired, UnknownError), + List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData), + http4sPartialFunction = Some(getBalances) + ) + + // GET /accounts/{accountId}/balances — account-level balances + lazy val getAccountBalances: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV20Prefix` / "accounts" / accountIdStr / "balances" => + EndpointHelpers.withUser(req) { (u, cc) => + for { + (account, _) <- NewStyle.function.getBankAccountByAccountId(AccountId(accountIdStr), Some(cc)) + view <- ViewNewStyle.checkOwnerViewAccessAndReturnOwnerView(u, BankIdAccountId(account.bankId, account.accountId), Some(cc)) + moderatedAccount <- Future { + BankAccountExtended(account).moderatedBankAccount(view, BankIdAccountId(account.bankId, account.accountId), Full(u), Some(cc)) + } map { x => unboxFull(fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, Some(cc.toLight)))) } + } yield JSONFactory_UKOpenBanking_200.createAccountBalanceJSON(moderatedAccount) + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountBalances), + "GET", + "/accounts/ACCOUNT_ID/balances", + "UK Open Banking: Get Account Balances", + """An AISP may retrieve the account balance information resource for a specific AccountId.""", + EmptyBody, + SwaggerDefinitionsJSON.accountBalancesUKV200, + List(AuthenticatedUserIsRequired, UnknownError), + List(apiTagUKOpenBanking, apiTagAccount, apiTagPrivateData), + http4sPartialFunction = Some(getAccountBalances) + ) + + // GET /accounts/{accountId}/transactions — account-level transactions + lazy val getAccountTransactions: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV20Prefix` / "accounts" / accountIdStr / "transactions" => + EndpointHelpers.withUser(req) { (u, cc) => + for { + (account, _) <- NewStyle.function.getBankAccountByAccountId(AccountId(accountIdStr), Some(cc)) + (bank, _) <- NewStyle.function.getBank(account.bankId, Some(cc)) + view <- ViewNewStyle.checkOwnerViewAccessAndReturnOwnerView(u, BankIdAccountId(account.bankId, account.accountId), Some(cc)) + params <- Future { + createQueriesByHttpParams(req.headers.headers.toList.map(h => HTTPParam(h.name.toString, List(h.value)))) + } map { x => unboxFull(fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, Some(cc.toLight)))) } + (transactions, _) <- Future { + BankAccountExtended(account).getModeratedTransactions(bank, Full(u), view, BankIdAccountId(account.bankId, account.accountId), Some(cc), params) + } map { x => unboxFull(fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, Some(cc.toLight)))) } + } yield JSONFactory_UKOpenBanking_200.createTransactionsJson(transactions, Nil) + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountTransactions), + "GET", + "/accounts/ACCOUNT_ID/transactions", + "UK Open Banking: Get Account Transactions", + """Reads account data from a given account addressed by "account-id".""", + EmptyBody, + SwaggerDefinitionsJSON.transactionsJsonUKV200, + List(AuthenticatedUserIsRequired, UnknownError), + List(apiTagUKOpenBanking, apiTagTransaction, apiTagPrivateData), + http4sPartialFunction = Some(getAccountTransactions) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccountList(req) + .orElse(getAccount(req)) + .orElse(getAccountBalances(req)) + .orElse(getAccountTransactions(req)) + .orElse(getBalances(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/OBP_UKOpenBanking_200.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/OBP_UKOpenBanking_200.scala index ebc867aa20..bdce830088 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/OBP_UKOpenBanking_200.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v2_0_0/OBP_UKOpenBanking_200.scala @@ -1,68 +1,46 @@ -/** -Open Bank Project - API -Copyright (C) 2011-2019, TESOBE GmbH. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -Email: contact@tesobe.com -TESOBE GmbH. -Osloer Strasse 16/17 -Berlin 13359, Germany - -This product includes software developed at -TESOBE (http://www.tesobe.com/) - - */ package code.api.UKOpenBanking.v2_0_0 import code.api.OBPRestHelper -import code.api.util.APIUtil.{OBPEndpoint, getAllowedEndpoints} +import code.api.util.APIUtil.{OBPEndpoint, ResourceDoc} import code.api.util.ScannedApis import code.util.Helper.MdcLoggable +import com.openbankproject.commons.util.{ApiVersion, ApiVersionStatus, ScannedApiVersion} -import scala.collection.immutable.Nil -import code.api.UKOpenBanking.v2_0_0.APIMethods_UKOpenBanking_200._ -import com.openbankproject.commons.util.{ApiVersion, ApiVersionStatus} - +import scala.collection.mutable.ArrayBuffer /* -This file defines which endpoints from all the versions are available in v1 + * All v2.0 UK Open Banking endpoints have been migrated to Http4sUKOBv200AIS. + * This stub is retained for ScannedApis registration (class-path scanning) and + * so that external callers (APIUtil, SwaggerJSONFactory) that access + * OBP_UKOpenBanking_200.apiVersion / .allResourceDocs continue to compile. + * Routes are served by Http4sUKOBv200.wrappedRoutes in Http4sApp (ahead of the Lift bridge). */ +object OBP_UKOpenBanking_200 extends OBPRestHelper with MdcLoggable with ScannedApis { + override val apiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV20 + val versionStatus: String = ApiVersionStatus.DRAFT.toString -object OBP_UKOpenBanking_200 extends OBPRestHelper with MdcLoggable with ScannedApis{ - - override val apiVersion = ApiVersion.ukOpenBankingV20 - val versionStatus = ApiVersionStatus.DRAFT.toString - - val allEndpoints = - getAccountList :: - getAccountTransactions :: - getAccount :: - getAccountBalances :: - getBalances :: - Nil - - override val allResourceDocs = resourceDocs - - // Filter the possible endpoints by the disabled / enabled Props settings and add them together - override val routes : List[OBPEndpoint] = getAllowedEndpoints(allEndpoints,resourceDocs) - - - // Make them available for use! - registerRoutes(routes, allResourceDocs, apiPrefix) - - logger.info(s"version $version has been run! There are ${routes.length} routes.") + override val allResourceDocs: ArrayBuffer[ResourceDoc] = Http4sUKOBv200.resourceDocs + override val routes: List[OBPEndpoint] = Nil } + +// ─── Original Lift aggregator (commented out) ──────────────────────────────── +//import code.api.UKOpenBanking.v2_0_0.APIMethods_UKOpenBanking_200._ +//import scala.collection.immutable.{Nil => immNil} +//import code.api.util.APIUtil.getAllowedEndpoints +// +// val allEndpoints = +// getAccountList :: +// getAccountTransactions :: +// getAccount :: +// getAccountBalances :: +// getBalances :: +// immNil +// +// override val allResourceDocs = resourceDocs +// +// override val routes : List[OBPEndpoint] = getAllowedEndpoints(allEndpoints, resourceDocs) +// +// registerRoutes(routes, allResourceDocs, apiPrefix) +// logger.info(s"version $version has been run! There are ${routes.length} routes.") diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/AccountAccessApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/AccountAccessApi.scala index 27a5047a44..1535213331 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/AccountAccessApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/AccountAccessApi.scala @@ -1,253 +1,253 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.Constant -import code.api.UKOpenBanking.v3_1_0.JSONFactory_UKOpenBanking_310.ConsentPostBodyUKV310 -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ErrorMessages._ -import code.api.util.NewStyle.HttpCode -import code.api.util.{ApiTag, ConsentJWT, JwtUtil, NewStyle} -import code.consent.Consents -import com.github.dwickern.macros.NameOf.nameOf -import com.openbankproject.commons.ExecutionContext.Implicits.global -import com.openbankproject.commons.model.User -import net.liftweb.common.{Empty, Full} -import net.liftweb.http.js.JE.JsRaw -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import scala.concurrent.Future - -object APIMethods_AccountAccessApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - createAccountAccessConsents :: - deleteAccountAccessConsentsConsentId :: - getAccountAccessConsentsConsentId :: - Nil - - - resourceDocs += ResourceDoc( - createAccountAccessConsents, - apiVersion, - nameOf(createAccountAccessConsents), - "POST", - "/account-access-consents", - "Create Account Access Consents", - s"""${mockedDataText(false)} - |Create Account Access Consents - |""".stripMargin, - json.parse("""{ - "Data": { - "Permissions": [ - "ReadAccountsBasic" - ], - "ExpirationDateTime": "2020-10-20T08:40:47.285Z", - "TransactionFromDateTime": "2020-10-20T08:40:47.285Z", - "TransactionToDateTime": "2020-10-20T08:40:47.285Z" - }, - "Risk": "" -}"""), - json.parse(s"""{ - "Data": { - "ConsentId": "string", - "CreationDateTime": "2020-10-20T08:40:47.375Z", - "Status": "Authorised", - "StatusUpdateDateTime": "2020-10-20T08:40:47.375Z", - "Permissions": [ - "ReadAccountsBasic" - ], - "ExpirationDateTime": "2020-10-20T08:40:47.375Z", - "TransactionFromDateTime": "2020-10-20T08:40:47.375Z", - "TransactionToDateTime": "2020-10-20T08:40:47.375Z" - }, - "Risk": {}, - "Links": { - "Self": "${Constant.HostName}/open-banking/v3.1/account-access-consents/CONSENT_ID", - }, - "Meta": { - "TotalPages": 0, - "FirstAvailableDateTime": "2020-10-20T08:40:47.375Z", - "LastAvailableDateTime": "2020-10-20T08:40:47.375Z" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Account Access") :: Nil - ) - - lazy val createAccountAccessConsents : OBPEndpoint = { - case "account-access-consents" :: Nil JsonPost postJson -> _ => { - cc => - for { - (_, callContext) <- applicationAccess(cc) - _ <- passesPsd2Aisp(callContext) - createdByUser: Option[User] <- callContext.map(_.user).getOrElse(Empty) match { - case Full(user) => Future(Some(user)) - case _ => Future(None) - } - failMsg = s"$InvalidJsonFormat The Json body should be the $ConsentPostBodyUKV310 " - consentJson <- NewStyle.function.tryons(failMsg, 400, callContext) { - postJson.extract[ConsentPostBodyUKV310] - } - createdConsent <- Future(Consents.consentProvider.vend.saveUKConsent( - createdByUser, - bankId = None, - accountIds = None, - consumerId = callContext.flatMap(_.consumer.map(_.consumerId.get)), - permissions = consentJson.Data.Permissions, - expirationDateTime = DateWithDayFormat.parse(consentJson.Data.ExpirationDateTime) , - transactionFromDateTime = DateWithDayFormat.parse(consentJson.Data.TransactionFromDateTime), - transactionToDateTime= DateWithDayFormat.parse(consentJson.Data.TransactionToDateTime), - apiStandard = Some("UKOpenBanking"), - apiVersion = Some("3.1.0") - )) map { - i => connectorEmptyResponse(i, callContext) - } - } yield { - (json.parse(s"""{ - "Meta" : { - "LastAvailableDateTime" : "2000-01-23T06:44:05.618Z", - "FirstAvailableDateTime" : "2000-01-23T06:44:05.618Z", - "TotalPages" : 0 - }, - "Links" : { - "Self" : "${Constant.HostName}/open-banking/v3.1/account-access-consents" - }, - "Risk" : "", - "Data" : { - "Status" : "${createdConsent.status}", - "StatusUpdateDateTime" : "${createdConsent.statusUpdateDateTime}", - "CreationDateTime" : "${createdConsent.creationDateTime}", - "TransactionToDateTime" : "${consentJson.Data.TransactionToDateTime}", - "ExpirationDateTime" : "${consentJson.Data.ExpirationDateTime}", - "Permissions" : ${consentJson.Data.Permissions.mkString("""["""","""","""",""""]""")}, - "ConsentId" : "${createdConsent.consentId}", - "TransactionFromDateTime" : "${consentJson.Data.TransactionFromDateTime}", - } - }"""), HttpCode.`201`(callContext)) - } - } - } - - resourceDocs += ResourceDoc( - deleteAccountAccessConsentsConsentId, - apiVersion, - nameOf(deleteAccountAccessConsentsConsentId), - "DELETE", - "/account-access-consents/CONSENT_ID", - "Delete Account Access Consents", - s"""${mockedDataText(false)} - |Delete Account Access Consents - |""".stripMargin, - EmptyBody, - EmptyBody, - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Account Access") :: Nil - ) - - lazy val deleteAccountAccessConsentsConsentId : OBPEndpoint = { - case "account-access-consents" :: consentId :: Nil JsonDelete _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc, AuthenticatedUserIsRequired) - _ <- passesPsd2Aisp(callContext) - consent <- Future(Consents.consentProvider.vend.getConsentByConsentId(consentId)) map { - unboxFullOrFail(_, callContext, ConsentNotFound) - } - consent <- Future(Consents.consentProvider.vend.revoke(consentId)) map { - i => connectorEmptyResponse(i, callContext) - } - } yield { - (JsRaw(""), HttpCode.`204`(callContext)) - } - } - } - - resourceDocs += ResourceDoc( - getAccountAccessConsentsConsentId, - apiVersion, - nameOf(getAccountAccessConsentsConsentId), - "GET", - "/account-access-consents/CONSENT_ID", - "Get Account Access Consents", - s""" - |${mockedDataText(false)} - |Get Account Access Consents - |""".stripMargin, - EmptyBody, - json.parse(s"""{ - "Data": { - "ConsentId": "string", - "CreationDateTime": "2020-10-20T10:28:39.801Z", - "Status": "Authorised", - "StatusUpdateDateTime": "2020-10-20T10:28:39.801Z", - "Permissions": [ - "ReadAccountsBasic" - ], - "ExpirationDateTime": "2020-10-20T10:28:39.801Z", - "TransactionFromDateTime": "2020-10-20T10:28:39.801Z", - "TransactionToDateTime": "2020-10-20T10:28:39.801Z" - }, - "Risk": "", - "Links": { - "Self": "${Constant.HostName}/open-banking/v3.1/account-access-consents/CONSENT_ID", - }, - "Meta": { - "TotalPages": 0, - "FirstAvailableDateTime": "2020-10-20T10:28:39.801Z", - "LastAvailableDateTime": "2020-10-20T10:28:39.801Z" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Account Access") :: Nil - ) - - lazy val getAccountAccessConsentsConsentId : OBPEndpoint = { - case "account-access-consents" :: consentId :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc, AuthenticatedUserIsRequired) - consent <- Future(Consents.consentProvider.vend.getConsentByConsentId(consentId)) map { - unboxFullOrFail(_, callContext, s"$ConsentNotFound ($consentId)") - } - consentViews <- Future(JwtUtil.getSignedPayloadAsJson(consent.jsonWebToken).map(net.liftweb.json.parse(_).extract[ConsentJWT].views.map(_.view_id))) map { - unboxFullOrFail(_, callContext, s"$ConsentViewNotFund ($consentId)") - } - } yield { - (json.parse(s"""{ - "Meta" : { - "LastAvailableDateTime" : "2000-01-23T06:44:05.618Z", - "FirstAvailableDateTime" : "2000-01-23T06:44:05.618Z", - "TotalPages" : 0 - }, - "Risk": "", - "Links" : { - "Self" : "${Constant.HostName}/open-banking/v3.1/account-access-consents/CONSENT_ID" - }, - "Data" : { - "Status" : "${consent.status}", - "StatusUpdateDateTime" : "${consent.statusUpdateDateTime}", - "CreationDateTime" : "${consent.creationDateTime}", - "TransactionToDateTime" : "${consent.transactionToDateTime}", - "ExpirationDateTime" : "${consent.expirationDateTime}", - "Permissions" : ${consentViews.mkString("""["""","""","""",""""]""")}, - "ConsentId" : "${consent.consentId}", - "TransactionFromDateTime" : "${consent.transactionFromDateTime}", - } - }"""), HttpCode.`200`(callContext)) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.Constant +//import code.api.UKOpenBanking.v3_1_0.JSONFactory_UKOpenBanking_310.ConsentPostBodyUKV310 +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ErrorMessages._ +//import code.api.util.NewStyle.HttpCode +//import code.api.util.{ApiTag, ConsentJWT, JwtUtil, NewStyle} +//import code.consent.Consents +//import com.github.dwickern.macros.NameOf.nameOf +//import com.openbankproject.commons.ExecutionContext.Implicits.global +//import com.openbankproject.commons.model.User +//import net.liftweb.common.{Empty, Full} +//import net.liftweb.http.js.JE.JsRaw +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import scala.concurrent.Future +// +//object APIMethods_AccountAccessApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// createAccountAccessConsents :: +// deleteAccountAccessConsentsConsentId :: +// getAccountAccessConsentsConsentId :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// createAccountAccessConsents, +// apiVersion, +// nameOf(createAccountAccessConsents), +// "POST", +// "/account-access-consents", +// "Create Account Access Consents", +// s"""${mockedDataText(false)} +// |Create Account Access Consents +// |""".stripMargin, +// json.parse("""{ +// "Data": { +// "Permissions": [ +// "ReadAccountsBasic" +// ], +// "ExpirationDateTime": "2020-10-20T08:40:47.285Z", +// "TransactionFromDateTime": "2020-10-20T08:40:47.285Z", +// "TransactionToDateTime": "2020-10-20T08:40:47.285Z" +// }, +// "Risk": "" +//}"""), +// json.parse(s"""{ +// "Data": { +// "ConsentId": "string", +// "CreationDateTime": "2020-10-20T08:40:47.375Z", +// "Status": "Authorised", +// "StatusUpdateDateTime": "2020-10-20T08:40:47.375Z", +// "Permissions": [ +// "ReadAccountsBasic" +// ], +// "ExpirationDateTime": "2020-10-20T08:40:47.375Z", +// "TransactionFromDateTime": "2020-10-20T08:40:47.375Z", +// "TransactionToDateTime": "2020-10-20T08:40:47.375Z" +// }, +// "Risk": {}, +// "Links": { +// "Self": "${Constant.HostName}/open-banking/v3.1/account-access-consents/CONSENT_ID", +// }, +// "Meta": { +// "TotalPages": 0, +// "FirstAvailableDateTime": "2020-10-20T08:40:47.375Z", +// "LastAvailableDateTime": "2020-10-20T08:40:47.375Z" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Account Access") :: Nil +// ) +// +// lazy val createAccountAccessConsents : OBPEndpoint = { +// case "account-access-consents" :: Nil JsonPost postJson -> _ => { +// cc => +// for { +// (_, callContext) <- applicationAccess(cc) +// _ <- passesPsd2Aisp(callContext) +// createdByUser: Option[User] <- callContext.map(_.user).getOrElse(Empty) match { +// case Full(user) => Future(Some(user)) +// case _ => Future(None) +// } +// failMsg = s"$InvalidJsonFormat The Json body should be the $ConsentPostBodyUKV310 " +// consentJson <- NewStyle.function.tryons(failMsg, 400, callContext) { +// postJson.extract[ConsentPostBodyUKV310] +// } +// createdConsent <- Future(Consents.consentProvider.vend.saveUKConsent( +// createdByUser, +// bankId = None, +// accountIds = None, +// consumerId = callContext.flatMap(_.consumer.map(_.consumerId.get)), +// permissions = consentJson.Data.Permissions, +// expirationDateTime = DateWithDayFormat.parse(consentJson.Data.ExpirationDateTime) , +// transactionFromDateTime = DateWithDayFormat.parse(consentJson.Data.TransactionFromDateTime), +// transactionToDateTime= DateWithDayFormat.parse(consentJson.Data.TransactionToDateTime), +// apiStandard = Some("UKOpenBanking"), +// apiVersion = Some("3.1.0") +// )) map { +// i => connectorEmptyResponse(i, callContext) +// } +// } yield { +// (json.parse(s"""{ +// "Meta" : { +// "LastAvailableDateTime" : "2000-01-23T06:44:05.618Z", +// "FirstAvailableDateTime" : "2000-01-23T06:44:05.618Z", +// "TotalPages" : 0 +// }, +// "Links" : { +// "Self" : "${Constant.HostName}/open-banking/v3.1/account-access-consents" +// }, +// "Risk" : "", +// "Data" : { +// "Status" : "${createdConsent.status}", +// "StatusUpdateDateTime" : "${createdConsent.statusUpdateDateTime}", +// "CreationDateTime" : "${createdConsent.creationDateTime}", +// "TransactionToDateTime" : "${consentJson.Data.TransactionToDateTime}", +// "ExpirationDateTime" : "${consentJson.Data.ExpirationDateTime}", +// "Permissions" : ${consentJson.Data.Permissions.mkString("""["""","""","""",""""]""")}, +// "ConsentId" : "${createdConsent.consentId}", +// "TransactionFromDateTime" : "${consentJson.Data.TransactionFromDateTime}", +// } +// }"""), HttpCode.`201`(callContext)) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// deleteAccountAccessConsentsConsentId, +// apiVersion, +// nameOf(deleteAccountAccessConsentsConsentId), +// "DELETE", +// "/account-access-consents/CONSENT_ID", +// "Delete Account Access Consents", +// s"""${mockedDataText(false)} +// |Delete Account Access Consents +// |""".stripMargin, +// EmptyBody, +// EmptyBody, +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Account Access") :: Nil +// ) +// +// lazy val deleteAccountAccessConsentsConsentId : OBPEndpoint = { +// case "account-access-consents" :: consentId :: Nil JsonDelete _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc, AuthenticatedUserIsRequired) +// _ <- passesPsd2Aisp(callContext) +// consent <- Future(Consents.consentProvider.vend.getConsentByConsentId(consentId)) map { +// unboxFullOrFail(_, callContext, ConsentNotFound) +// } +// consent <- Future(Consents.consentProvider.vend.revoke(consentId)) map { +// i => connectorEmptyResponse(i, callContext) +// } +// } yield { +// (JsRaw(""), HttpCode.`204`(callContext)) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getAccountAccessConsentsConsentId, +// apiVersion, +// nameOf(getAccountAccessConsentsConsentId), +// "GET", +// "/account-access-consents/CONSENT_ID", +// "Get Account Access Consents", +// s""" +// |${mockedDataText(false)} +// |Get Account Access Consents +// |""".stripMargin, +// EmptyBody, +// json.parse(s"""{ +// "Data": { +// "ConsentId": "string", +// "CreationDateTime": "2020-10-20T10:28:39.801Z", +// "Status": "Authorised", +// "StatusUpdateDateTime": "2020-10-20T10:28:39.801Z", +// "Permissions": [ +// "ReadAccountsBasic" +// ], +// "ExpirationDateTime": "2020-10-20T10:28:39.801Z", +// "TransactionFromDateTime": "2020-10-20T10:28:39.801Z", +// "TransactionToDateTime": "2020-10-20T10:28:39.801Z" +// }, +// "Risk": "", +// "Links": { +// "Self": "${Constant.HostName}/open-banking/v3.1/account-access-consents/CONSENT_ID", +// }, +// "Meta": { +// "TotalPages": 0, +// "FirstAvailableDateTime": "2020-10-20T10:28:39.801Z", +// "LastAvailableDateTime": "2020-10-20T10:28:39.801Z" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Account Access") :: Nil +// ) +// +// lazy val getAccountAccessConsentsConsentId : OBPEndpoint = { +// case "account-access-consents" :: consentId :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc, AuthenticatedUserIsRequired) +// consent <- Future(Consents.consentProvider.vend.getConsentByConsentId(consentId)) map { +// unboxFullOrFail(_, callContext, s"$ConsentNotFound ($consentId)") +// } +// consentViews <- Future(JwtUtil.getSignedPayloadAsJson(consent.jsonWebToken).map(net.liftweb.json.parse(_).extract[ConsentJWT].views.map(_.view_id))) map { +// unboxFullOrFail(_, callContext, s"$ConsentViewNotFund ($consentId)") +// } +// } yield { +// (json.parse(s"""{ +// "Meta" : { +// "LastAvailableDateTime" : "2000-01-23T06:44:05.618Z", +// "FirstAvailableDateTime" : "2000-01-23T06:44:05.618Z", +// "TotalPages" : 0 +// }, +// "Risk": "", +// "Links" : { +// "Self" : "${Constant.HostName}/open-banking/v3.1/account-access-consents/CONSENT_ID" +// }, +// "Data" : { +// "Status" : "${consent.status}", +// "StatusUpdateDateTime" : "${consent.statusUpdateDateTime}", +// "CreationDateTime" : "${consent.creationDateTime}", +// "TransactionToDateTime" : "${consent.transactionToDateTime}", +// "ExpirationDateTime" : "${consent.expirationDateTime}", +// "Permissions" : ${consentViews.mkString("""["""","""","""",""""]""")}, +// "ConsentId" : "${consent.consentId}", +// "TransactionFromDateTime" : "${consent.transactionFromDateTime}", +// } +// }"""), HttpCode.`200`(callContext)) +// } +// } +// } +// +//} +// +// +// diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/AccountsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/AccountsApi.scala index 2b2c3eddd3..21b5062a63 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/AccountsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/AccountsApi.scala @@ -1,251 +1,251 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.Constant -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.{APIUtil, ApiTag, CallContext, NewStyle} -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import code.views.Views -import com.github.dwickern.macros.NameOf.nameOf -import com.openbankproject.commons.model.{AccountAttribute, AccountId, BankAccount, BankIdAccountId, View, ViewId} -import net.liftweb.common.{Box, Empty, Full} -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_AccountsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - getAccounts :: - getAccountsAccountId :: - Nil - - - resourceDocs += ResourceDoc( - getAccounts, - apiVersion, - nameOf(getAccounts), - "GET", - "/accounts", - "Get Accounts", - s"""""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Account" : [ { - "Account" : [ { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - } ], - "Servicer" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : "String", - "Description" : "Description", - "Currency" : "Currency", - "AccountType" : "String", - "AccountSubType" : "String", - "Nickname" : "Nickname" - }, { - "Account" : [ { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - } ], - "Servicer" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : "String", - "Description" : "Description", - "Currency" : "Currency", - "AccountType" : "String", - "AccountSubType" : "String", - "Nickname" : "Nickname" - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Accounts") :: Nil - ) - - lazy val getAccounts : OBPEndpoint = { - case "accounts" :: Nil JsonGet _ => { - cc => - val detailViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_DETAIL_VIEW_ID) - val basicViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_BASIC_VIEW_ID) - for { - (Full(u), callContext) <- authenticatedAccess(cc, AuthenticatedUserIsRequired) - _ <- NewStyle.function.checkUKConsent(u, callContext) - _ <- passesPsd2Aisp(callContext) - availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) - (accounts: List[BankAccount], callContext) <- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) - (moderatedAttributes: List[AccountAttribute], callContext) <- NewStyle.function.getModeratedAccountAttributesByAccounts( - accounts.map(a => BankIdAccountId(a.bankId, a.accountId)), - basicViewId, - callContext: Option[CallContext]) - } yield { - val allAccounts: List[Box[(BankAccount, View)]] = for (account: BankAccount <- accounts) yield { - APIUtil.checkViewAccessAndReturnView(detailViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), callContext).or( - APIUtil.checkViewAccessAndReturnView(basicViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), callContext) - ) match { - case Full(view) => - Full(account, view) - case _ => - Empty - } - } - val accountsWithProperView: List[(BankAccount, View)] = allAccounts.filter(_.isDefined).map(_.openOrThrowException(attemptedToOpenAnEmptyBox)) - (JSONFactory_UKOpenBanking_310.createAccountsListJSON(accountsWithProperView, moderatedAttributes), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getAccountsAccountId, - apiVersion, - nameOf(getAccountsAccountId), - "GET", - "/accounts/ACCOUNT_ID", - "Get Accounts", - s""" -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime": "2019-03-05T13:09:30.399Z", - "LastAvailableDateTime": "2019-03-05T13:09:30.399Z" - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Account" : [ { - "Account" : [ { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - } ], - "Servicer" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : "String", - "Description" : "Description", - "Currency" : "Currency", - "AccountType" : "String", - "AccountSubType" : "String", - "Nickname" : "Nickname" - }, { - "Account" : [ { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - } ], - "Servicer" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : "String", - "Description" : "Description", - "Currency" : "Currency", - "AccountType" : "String", - "AccountSubType" : "String", - "Nickname" : "Nickname" - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Accounts") :: Nil - ) - - lazy val getAccountsAccountId : OBPEndpoint = { - case "accounts" :: AccountId(accountId) :: Nil JsonGet _ => { - val detailViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_DETAIL_VIEW_ID) - val basicViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_BASIC_VIEW_ID) - - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) map { - _.filter(_.accountId.value == accountId.value) - } - (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) - - (moderatedAttributes: List[AccountAttribute], callContext) <- NewStyle.function.getModeratedAccountAttributesByAccounts( - accounts.map(a => BankIdAccountId(a.bankId, a.accountId)), - basicViewId, - callContext: Option[CallContext]) - } yield { - val allAccounts: List[Box[(BankAccount, View)]] = for (account: BankAccount <- accounts) yield { - APIUtil.checkViewAccessAndReturnView(detailViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), callContext).or( - APIUtil.checkViewAccessAndReturnView(basicViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), callContext) - ) match { - case Full(view) => - Full(account, view) - case _ => - Empty - } - } - val accountsWithProperView: List[(BankAccount, View)] = allAccounts.filter(_.isDefined).map(_.openOrThrowException(attemptedToOpenAnEmptyBox)) - (JSONFactory_UKOpenBanking_310.createAccountsListJSON(accountsWithProperView, moderatedAttributes), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.Constant +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.{APIUtil, ApiTag, CallContext, NewStyle} +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import code.views.Views +//import com.github.dwickern.macros.NameOf.nameOf +//import com.openbankproject.commons.model.{AccountAttribute, AccountId, BankAccount, BankIdAccountId, View, ViewId} +//import net.liftweb.common.{Box, Empty, Full} +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_AccountsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// getAccounts :: +// getAccountsAccountId :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// getAccounts, +// apiVersion, +// nameOf(getAccounts), +// "GET", +// "/accounts", +// "Get Accounts", +// s"""""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Account" : [ { +// "Account" : [ { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// } ], +// "Servicer" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : "String", +// "Description" : "Description", +// "Currency" : "Currency", +// "AccountType" : "String", +// "AccountSubType" : "String", +// "Nickname" : "Nickname" +// }, { +// "Account" : [ { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// } ], +// "Servicer" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : "String", +// "Description" : "Description", +// "Currency" : "Currency", +// "AccountType" : "String", +// "AccountSubType" : "String", +// "Nickname" : "Nickname" +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Accounts") :: Nil +// ) +// +// lazy val getAccounts : OBPEndpoint = { +// case "accounts" :: Nil JsonGet _ => { +// cc => +// val detailViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_DETAIL_VIEW_ID) +// val basicViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_BASIC_VIEW_ID) +// for { +// (Full(u), callContext) <- authenticatedAccess(cc, AuthenticatedUserIsRequired) +// _ <- NewStyle.function.checkUKConsent(u, callContext) +// _ <- passesPsd2Aisp(callContext) +// availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) +// (accounts: List[BankAccount], callContext) <- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) +// (moderatedAttributes: List[AccountAttribute], callContext) <- NewStyle.function.getModeratedAccountAttributesByAccounts( +// accounts.map(a => BankIdAccountId(a.bankId, a.accountId)), +// basicViewId, +// callContext: Option[CallContext]) +// } yield { +// val allAccounts: List[Box[(BankAccount, View)]] = for (account: BankAccount <- accounts) yield { +// APIUtil.checkViewAccessAndReturnView(detailViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), callContext).or( +// APIUtil.checkViewAccessAndReturnView(basicViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), callContext) +// ) match { +// case Full(view) => +// Full(account, view) +// case _ => +// Empty +// } +// } +// val accountsWithProperView: List[(BankAccount, View)] = allAccounts.filter(_.isDefined).map(_.openOrThrowException(attemptedToOpenAnEmptyBox)) +// (JSONFactory_UKOpenBanking_310.createAccountsListJSON(accountsWithProperView, moderatedAttributes), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getAccountsAccountId, +// apiVersion, +// nameOf(getAccountsAccountId), +// "GET", +// "/accounts/ACCOUNT_ID", +// "Get Accounts", +// s""" +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime": "2019-03-05T13:09:30.399Z", +// "LastAvailableDateTime": "2019-03-05T13:09:30.399Z" +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Account" : [ { +// "Account" : [ { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// } ], +// "Servicer" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : "String", +// "Description" : "Description", +// "Currency" : "Currency", +// "AccountType" : "String", +// "AccountSubType" : "String", +// "Nickname" : "Nickname" +// }, { +// "Account" : [ { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// } ], +// "Servicer" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : "String", +// "Description" : "Description", +// "Currency" : "Currency", +// "AccountType" : "String", +// "AccountSubType" : "String", +// "Nickname" : "Nickname" +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Accounts") :: Nil +// ) +// +// lazy val getAccountsAccountId : OBPEndpoint = { +// case "accounts" :: AccountId(accountId) :: Nil JsonGet _ => { +// val detailViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_DETAIL_VIEW_ID) +// val basicViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_BASIC_VIEW_ID) +// +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) map { +// _.filter(_.accountId.value == accountId.value) +// } +// (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) +// +// (moderatedAttributes: List[AccountAttribute], callContext) <- NewStyle.function.getModeratedAccountAttributesByAccounts( +// accounts.map(a => BankIdAccountId(a.bankId, a.accountId)), +// basicViewId, +// callContext: Option[CallContext]) +// } yield { +// val allAccounts: List[Box[(BankAccount, View)]] = for (account: BankAccount <- accounts) yield { +// APIUtil.checkViewAccessAndReturnView(detailViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), callContext).or( +// APIUtil.checkViewAccessAndReturnView(basicViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), callContext) +// ) match { +// case Full(view) => +// Full(account, view) +// case _ => +// Empty +// } +// } +// val accountsWithProperView: List[(BankAccount, View)] = allAccounts.filter(_.isDefined).map(_.openOrThrowException(attemptedToOpenAnEmptyBox)) +// (JSONFactory_UKOpenBanking_310.createAccountsListJSON(accountsWithProperView, moderatedAttributes), callContext) +// } +// } +// } +// +//} +// +// +// diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/BalancesApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/BalancesApi.scala index feb7956c6c..d647155407 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/BalancesApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/BalancesApi.scala @@ -1,223 +1,223 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.Constant -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ErrorMessages._ -import code.api.util.newstyle.ViewNewStyle -import code.api.util.{ApiTag, NewStyle} -import code.views.Views -import com.github.dwickern.macros.NameOf.nameOf -import com.openbankproject.commons.ExecutionContext.Implicits.global -import com.openbankproject.commons.model.{AccountId, BankIdAccountId, View, ViewId} -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.mutable.ArrayBuffer - -object APIMethods_BalancesApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - getAccountsAccountIdBalances :: - getBalances :: - Nil - - - resourceDocs += ResourceDoc( - getAccountsAccountIdBalances, - apiVersion, - nameOf(getAccountsAccountIdBalances), - "GET", - "/accounts/ACCOUNT_ID/balances", - "Get Balances", - s"""""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Balance" : [ { - "Type" : { }, - "AccountId" : { }, - "CreditLine" : [ { - "Type" : { }, - "Included" : true, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : { }, - "Included" : true, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit", - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : { }, - "AccountId" : { }, - "CreditLine" : [ { - "Type" : { }, - "Included" : true, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : { }, - "Included" : true, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit", - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Balances") :: Nil - ) - - lazy val getAccountsAccountIdBalances : OBPEndpoint = { - case "accounts" :: AccountId(accountId):: "balances" :: Nil JsonGet _ => { - cc => - val viewId = ViewId(Constant.SYSTEM_READ_BALANCES_VIEW_ID) - for { - (Full(user), callContext) <- authenticatedAccess(cc, AuthenticatedUserIsRequired) - _ <- NewStyle.function.checkUKConsent(user, callContext) - _ <- passesPsd2Aisp(callContext) - (account, callContext) <- NewStyle.function.getBankAccountByAccountId(accountId, callContext) - view: View <- ViewNewStyle.checkViewAccessAndReturnView(viewId, BankIdAccountId(account.bankId, accountId), Full(user), callContext) - moderatedAccount <- NewStyle.function.moderatedBankAccountCore(account, view, Full(user), callContext) - } yield { - (JSONFactory_UKOpenBanking_310.createAccountBalanceJSON(moderatedAccount), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getBalances, - apiVersion, - nameOf(getBalances), - "GET", - "/balances", - "Get Balances", - s"""""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Balance" : [ { - "Type" : { }, - "AccountId" : { }, - "CreditLine" : [ { - "Type" : { }, - "Included" : true, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : { }, - "Included" : true, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit", - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : { }, - "AccountId" : { }, - "CreditLine" : [ { - "Type" : { }, - "Included" : true, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : { }, - "Included" : true, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit", - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Balances") :: Nil - ) - - lazy val getBalances : OBPEndpoint = { - case "balances" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - - availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) - - (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) - - } yield { - (JSONFactory_UKOpenBanking_310.createBalancesJSON(accounts), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.Constant +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ErrorMessages._ +//import code.api.util.newstyle.ViewNewStyle +//import code.api.util.{ApiTag, NewStyle} +//import code.views.Views +//import com.github.dwickern.macros.NameOf.nameOf +//import com.openbankproject.commons.ExecutionContext.Implicits.global +//import com.openbankproject.commons.model.{AccountId, BankIdAccountId, View, ViewId} +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.mutable.ArrayBuffer +// +//object APIMethods_BalancesApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// getAccountsAccountIdBalances :: +// getBalances :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdBalances, +// apiVersion, +// nameOf(getAccountsAccountIdBalances), +// "GET", +// "/accounts/ACCOUNT_ID/balances", +// "Get Balances", +// s"""""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Balance" : [ { +// "Type" : { }, +// "AccountId" : { }, +// "CreditLine" : [ { +// "Type" : { }, +// "Included" : true, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : { }, +// "Included" : true, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit", +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : { }, +// "AccountId" : { }, +// "CreditLine" : [ { +// "Type" : { }, +// "Included" : true, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : { }, +// "Included" : true, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit", +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Balances") :: Nil +// ) +// +// lazy val getAccountsAccountIdBalances : OBPEndpoint = { +// case "accounts" :: AccountId(accountId):: "balances" :: Nil JsonGet _ => { +// cc => +// val viewId = ViewId(Constant.SYSTEM_READ_BALANCES_VIEW_ID) +// for { +// (Full(user), callContext) <- authenticatedAccess(cc, AuthenticatedUserIsRequired) +// _ <- NewStyle.function.checkUKConsent(user, callContext) +// _ <- passesPsd2Aisp(callContext) +// (account, callContext) <- NewStyle.function.getBankAccountByAccountId(accountId, callContext) +// view: View <- ViewNewStyle.checkViewAccessAndReturnView(viewId, BankIdAccountId(account.bankId, accountId), Full(user), callContext) +// moderatedAccount <- NewStyle.function.moderatedBankAccountCore(account, view, Full(user), callContext) +// } yield { +// (JSONFactory_UKOpenBanking_310.createAccountBalanceJSON(moderatedAccount), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getBalances, +// apiVersion, +// nameOf(getBalances), +// "GET", +// "/balances", +// "Get Balances", +// s"""""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Balance" : [ { +// "Type" : { }, +// "AccountId" : { }, +// "CreditLine" : [ { +// "Type" : { }, +// "Included" : true, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : { }, +// "Included" : true, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit", +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : { }, +// "AccountId" : { }, +// "CreditLine" : [ { +// "Type" : { }, +// "Included" : true, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : { }, +// "Included" : true, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit", +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Balances") :: Nil +// ) +// +// lazy val getBalances : OBPEndpoint = { +// case "balances" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// +// availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) +// +// (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) +// +// } yield { +// (JSONFactory_UKOpenBanking_310.createBalancesJSON(accounts), callContext) +// } +// } +// } +// +//} +// +// +// diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/BeneficiariesApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/BeneficiariesApi.scala index 07919dda5d..97ff4e1d1b 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/BeneficiariesApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/BeneficiariesApi.scala @@ -1,362 +1,363 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_BeneficiariesApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - getAccountsAccountIdBeneficiaries :: - getBeneficiaries :: - Nil - - - resourceDocs += ResourceDoc( - getAccountsAccountIdBeneficiaries, - apiVersion, - nameOf(getAccountsAccountIdBeneficiaries), - "GET", - "/accounts/ACCOUNTID/beneficiaries", - "Get Beneficiaries", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Beneficiary" : [ { - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "BeneficiaryId" : "BeneficiaryId" - }, { - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "BeneficiaryId" : "BeneficiaryId" - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Beneficiaries") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdBeneficiaries : OBPEndpoint = { - case "accounts" :: accountid:: "beneficiaries" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Beneficiary" : [ { - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "BeneficiaryId" : "BeneficiaryId" - }, { - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "BeneficiaryId" : "BeneficiaryId" - } ] - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getBeneficiaries, - apiVersion, - nameOf(getBeneficiaries), - "GET", - "/beneficiaries", - "Get Beneficiaries", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Beneficiary" : [ { - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "BeneficiaryId" : "BeneficiaryId" - }, { - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "BeneficiaryId" : "BeneficiaryId" - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Beneficiaries") :: apiTagMockedData :: Nil - ) - - lazy val getBeneficiaries : OBPEndpoint = { - case "beneficiaries" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Beneficiary" : [ { - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "BeneficiaryId" : "BeneficiaryId" - }, { - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "BeneficiaryId" : "BeneficiaryId" - } ] - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_BeneficiariesApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// getAccountsAccountIdBeneficiaries :: +// getBeneficiaries :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdBeneficiaries, +// apiVersion, +// nameOf(getAccountsAccountIdBeneficiaries), +// "GET", +// "/accounts/ACCOUNTID/beneficiaries", +// "Get Beneficiaries", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Beneficiary" : [ { +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "BeneficiaryId" : "BeneficiaryId" +// }, { +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "BeneficiaryId" : "BeneficiaryId" +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Beneficiaries") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdBeneficiaries : OBPEndpoint = { +// case "accounts" :: accountid:: "beneficiaries" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Beneficiary" : [ { +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "BeneficiaryId" : "BeneficiaryId" +// }, { +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "BeneficiaryId" : "BeneficiaryId" +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getBeneficiaries, +// apiVersion, +// nameOf(getBeneficiaries), +// "GET", +// "/beneficiaries", +// "Get Beneficiaries", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Beneficiary" : [ { +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "BeneficiaryId" : "BeneficiaryId" +// }, { +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "BeneficiaryId" : "BeneficiaryId" +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Beneficiaries") :: apiTagMockedData :: Nil +// ) +// +// lazy val getBeneficiaries : OBPEndpoint = { +// case "beneficiaries" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Beneficiary" : [ { +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "BeneficiaryId" : "BeneficiaryId" +// }, { +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "BeneficiaryId" : "BeneficiaryId" +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DirectDebitsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DirectDebitsApi.scala index 6dd920ace6..3b65bf8d8c 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DirectDebitsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DirectDebitsApi.scala @@ -1,234 +1,235 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_DirectDebitsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - getAccountsAccountIdDirectDebits :: - getDirectDebits :: - Nil - - - resourceDocs += ResourceDoc( - getAccountsAccountIdDirectDebits, - apiVersion, - nameOf(getAccountsAccountIdDirectDebits), - "GET", - "/accounts/ACCOUNTID/direct-debits", - "Get Direct Debits", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "DirectDebit" : [ { - "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "AccountId" : { }, - "MandateIdentification" : "MandateIdentification", - "DirectDebitStatusCode" : { }, - "DirectDebitId" : "DirectDebitId", - "PreviousPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Name" : "Name" - }, { - "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "AccountId" : { }, - "MandateIdentification" : "MandateIdentification", - "DirectDebitStatusCode" : { }, - "DirectDebitId" : "DirectDebitId", - "PreviousPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Name" : "Name" - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Direct Debits") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdDirectDebits : OBPEndpoint = { - case "accounts" :: accountid:: "direct-debits" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "DirectDebit" : [ { - "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "AccountId" : { }, - "MandateIdentification" : "MandateIdentification", - "DirectDebitStatusCode" : { }, - "DirectDebitId" : "DirectDebitId", - "PreviousPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Name" : "Name" - }, { - "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "AccountId" : { }, - "MandateIdentification" : "MandateIdentification", - "DirectDebitStatusCode" : { }, - "DirectDebitId" : "DirectDebitId", - "PreviousPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Name" : "Name" - } ] - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getDirectDebits, - apiVersion, - nameOf(getDirectDebits), - "GET", - "/direct-debits", - "Get Direct Debits", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "DirectDebit" : [ { - "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "AccountId" : { }, - "MandateIdentification" : "MandateIdentification", - "DirectDebitStatusCode" : { }, - "DirectDebitId" : "DirectDebitId", - "PreviousPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Name" : "Name" - }, { - "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "AccountId" : { }, - "MandateIdentification" : "MandateIdentification", - "DirectDebitStatusCode" : { }, - "DirectDebitId" : "DirectDebitId", - "PreviousPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Name" : "Name" - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Direct Debits") :: apiTagMockedData :: Nil - ) - - lazy val getDirectDebits : OBPEndpoint = { - case "direct-debits" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "DirectDebit" : [ { - "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "AccountId" : { }, - "MandateIdentification" : "MandateIdentification", - "DirectDebitStatusCode" : { }, - "DirectDebitId" : "DirectDebitId", - "PreviousPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Name" : "Name" - }, { - "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "AccountId" : { }, - "MandateIdentification" : "MandateIdentification", - "DirectDebitStatusCode" : { }, - "DirectDebitId" : "DirectDebitId", - "PreviousPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Name" : "Name" - } ] - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_DirectDebitsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// getAccountsAccountIdDirectDebits :: +// getDirectDebits :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdDirectDebits, +// apiVersion, +// nameOf(getAccountsAccountIdDirectDebits), +// "GET", +// "/accounts/ACCOUNTID/direct-debits", +// "Get Direct Debits", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "DirectDebit" : [ { +// "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AccountId" : { }, +// "MandateIdentification" : "MandateIdentification", +// "DirectDebitStatusCode" : { }, +// "DirectDebitId" : "DirectDebitId", +// "PreviousPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Name" : "Name" +// }, { +// "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AccountId" : { }, +// "MandateIdentification" : "MandateIdentification", +// "DirectDebitStatusCode" : { }, +// "DirectDebitId" : "DirectDebitId", +// "PreviousPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Name" : "Name" +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Direct Debits") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdDirectDebits : OBPEndpoint = { +// case "accounts" :: accountid:: "direct-debits" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "DirectDebit" : [ { +// "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AccountId" : { }, +// "MandateIdentification" : "MandateIdentification", +// "DirectDebitStatusCode" : { }, +// "DirectDebitId" : "DirectDebitId", +// "PreviousPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Name" : "Name" +// }, { +// "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AccountId" : { }, +// "MandateIdentification" : "MandateIdentification", +// "DirectDebitStatusCode" : { }, +// "DirectDebitId" : "DirectDebitId", +// "PreviousPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Name" : "Name" +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getDirectDebits, +// apiVersion, +// nameOf(getDirectDebits), +// "GET", +// "/direct-debits", +// "Get Direct Debits", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "DirectDebit" : [ { +// "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AccountId" : { }, +// "MandateIdentification" : "MandateIdentification", +// "DirectDebitStatusCode" : { }, +// "DirectDebitId" : "DirectDebitId", +// "PreviousPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Name" : "Name" +// }, { +// "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AccountId" : { }, +// "MandateIdentification" : "MandateIdentification", +// "DirectDebitStatusCode" : { }, +// "DirectDebitId" : "DirectDebitId", +// "PreviousPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Name" : "Name" +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Direct Debits") :: apiTagMockedData :: Nil +// ) +// +// lazy val getDirectDebits : OBPEndpoint = { +// case "direct-debits" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "DirectDebit" : [ { +// "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AccountId" : { }, +// "MandateIdentification" : "MandateIdentification", +// "DirectDebitStatusCode" : { }, +// "DirectDebitId" : "DirectDebitId", +// "PreviousPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Name" : "Name" +// }, { +// "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AccountId" : { }, +// "MandateIdentification" : "MandateIdentification", +// "DirectDebitStatusCode" : { }, +// "DirectDebitId" : "DirectDebitId", +// "PreviousPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Name" : "Name" +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticPaymentsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticPaymentsApi.scala index 6d32805b57..eb5ac2a8f4 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticPaymentsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticPaymentsApi.scala @@ -1,889 +1,890 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_DomesticPaymentsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - createDomesticPaymentConsents :: - createDomesticPayments :: - getDomesticPaymentConsentsConsentId :: - getDomesticPaymentConsentsConsentIdFundsConfirmation :: - getDomesticPaymentsDomesticPaymentId :: - Nil - - - resourceDocs += ResourceDoc( - createDomesticPaymentConsents, - apiVersion, - nameOf(createDomesticPaymentConsents), - "POST", - "/domestic-payment-consents", - "Create Domestic Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Payments") :: apiTagMockedData :: Nil - ) - - lazy val createDomesticPaymentConsents : OBPEndpoint = { - case "domestic-payment-consents" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - createDomesticPayments, - apiVersion, - nameOf(createDomesticPayments), - "POST", - "/domestic-payments", - "Create Domestic Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "DomesticPaymentId" : "DomesticPaymentId", - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Payments") :: apiTagMockedData :: Nil - ) - - lazy val createDomesticPayments : OBPEndpoint = { - case "domestic-payments" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "DomesticPaymentId" : "DomesticPaymentId", - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getDomesticPaymentConsentsConsentId, - apiVersion, - nameOf(getDomesticPaymentConsentsConsentId), - "GET", - "/domestic-payment-consents/CONSENTID", - "Get Domestic Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Payments") :: apiTagMockedData :: Nil - ) - - lazy val getDomesticPaymentConsentsConsentId : OBPEndpoint = { - case "domestic-payment-consents" :: consentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getDomesticPaymentConsentsConsentIdFundsConfirmation, - apiVersion, - nameOf(getDomesticPaymentConsentsConsentIdFundsConfirmation), - "GET", - "/domestic-payment-consents/CONSENTID/funds-confirmation", - "Get Domestic Payment Consents Funds Confirmation", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "SupplementaryData" : { }, - "FundsAvailableResult" : { - "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", - "FundsAvailable" : true - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Payments") :: apiTagMockedData :: Nil - ) - - lazy val getDomesticPaymentConsentsConsentIdFundsConfirmation : OBPEndpoint = { - case "domestic-payment-consents" :: consentid:: "funds-confirmation" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "SupplementaryData" : { }, - "FundsAvailableResult" : { - "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", - "FundsAvailable" : true - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getDomesticPaymentsDomesticPaymentId, - apiVersion, - nameOf(getDomesticPaymentsDomesticPaymentId), - "GET", - "/domestic-payments/DOMESTICPAYMENTID", - "Get Domestic Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "DomesticPaymentId" : "DomesticPaymentId", - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Payments") :: apiTagMockedData :: Nil - ) - - lazy val getDomesticPaymentsDomesticPaymentId : OBPEndpoint = { - case "domestic-payments" :: domesticpaymentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "DomesticPaymentId" : "DomesticPaymentId", - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_DomesticPaymentsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// createDomesticPaymentConsents :: +// createDomesticPayments :: +// getDomesticPaymentConsentsConsentId :: +// getDomesticPaymentConsentsConsentIdFundsConfirmation :: +// getDomesticPaymentsDomesticPaymentId :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// createDomesticPaymentConsents, +// apiVersion, +// nameOf(createDomesticPaymentConsents), +// "POST", +// "/domestic-payment-consents", +// "Create Domestic Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val createDomesticPaymentConsents : OBPEndpoint = { +// case "domestic-payment-consents" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// createDomesticPayments, +// apiVersion, +// nameOf(createDomesticPayments), +// "POST", +// "/domestic-payments", +// "Create Domestic Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "DomesticPaymentId" : "DomesticPaymentId", +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val createDomesticPayments : OBPEndpoint = { +// case "domestic-payments" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "DomesticPaymentId" : "DomesticPaymentId", +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getDomesticPaymentConsentsConsentId, +// apiVersion, +// nameOf(getDomesticPaymentConsentsConsentId), +// "GET", +// "/domestic-payment-consents/CONSENTID", +// "Get Domestic Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getDomesticPaymentConsentsConsentId : OBPEndpoint = { +// case "domestic-payment-consents" :: consentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getDomesticPaymentConsentsConsentIdFundsConfirmation, +// apiVersion, +// nameOf(getDomesticPaymentConsentsConsentIdFundsConfirmation), +// "GET", +// "/domestic-payment-consents/CONSENTID/funds-confirmation", +// "Get Domestic Payment Consents Funds Confirmation", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "SupplementaryData" : { }, +// "FundsAvailableResult" : { +// "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FundsAvailable" : true +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getDomesticPaymentConsentsConsentIdFundsConfirmation : OBPEndpoint = { +// case "domestic-payment-consents" :: consentid:: "funds-confirmation" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "SupplementaryData" : { }, +// "FundsAvailableResult" : { +// "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FundsAvailable" : true +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getDomesticPaymentsDomesticPaymentId, +// apiVersion, +// nameOf(getDomesticPaymentsDomesticPaymentId), +// "GET", +// "/domestic-payments/DOMESTICPAYMENTID", +// "Get Domestic Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "DomesticPaymentId" : "DomesticPaymentId", +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getDomesticPaymentsDomesticPaymentId : OBPEndpoint = { +// case "domestic-payments" :: domesticpaymentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "DomesticPaymentId" : "DomesticPaymentId", +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticScheduledPaymentsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticScheduledPaymentsApi.scala index 1d3697e004..4772556013 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticScheduledPaymentsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticScheduledPaymentsApi.scala @@ -1,836 +1,837 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_DomesticScheduledPaymentsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - createDomesticScheduledPaymentConsents :: - createDomesticScheduledPayments :: - getDomesticScheduledPaymentConsentsConsentId :: - getDomesticScheduledPaymentsDomesticScheduledPaymentId :: - Nil - - - resourceDocs += ResourceDoc( - createDomesticScheduledPaymentConsents, - apiVersion, - nameOf(createDomesticScheduledPaymentConsents), - "POST", - "/domestic-scheduled-payment-consents", - "Create Domestic Scheduled Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil - ) - - lazy val createDomesticScheduledPaymentConsents : OBPEndpoint = { - case "domestic-scheduled-payment-consents" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - createDomesticScheduledPayments, - apiVersion, - nameOf(createDomesticScheduledPayments), - "POST", - "/domestic-scheduled-payments", - "Create Domestic Scheduled Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "DomesticScheduledPaymentId" : "DomesticScheduledPaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil - ) - - lazy val createDomesticScheduledPayments : OBPEndpoint = { - case "domestic-scheduled-payments" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "DomesticScheduledPaymentId" : "DomesticScheduledPaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getDomesticScheduledPaymentConsentsConsentId, - apiVersion, - nameOf(getDomesticScheduledPaymentConsentsConsentId), - "GET", - "/domestic-scheduled-payment-consents/CONSENTID", - "Get Domestic Scheduled Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil - ) - - lazy val getDomesticScheduledPaymentConsentsConsentId : OBPEndpoint = { - case "domestic-scheduled-payment-consents" :: consentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getDomesticScheduledPaymentsDomesticScheduledPaymentId, - apiVersion, - nameOf(getDomesticScheduledPaymentsDomesticScheduledPaymentId), - "GET", - "/domestic-scheduled-payments/DOMESTICSCHEDULEDPAYMENTID", - "Get Domestic Scheduled Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "DomesticScheduledPaymentId" : "DomesticScheduledPaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil - ) - - lazy val getDomesticScheduledPaymentsDomesticScheduledPaymentId : OBPEndpoint = { - case "domestic-scheduled-payments" :: domesticscheduledpaymentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "DomesticScheduledPaymentId" : "DomesticScheduledPaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Currency" : "Currency" - }, - "CreditorPostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_DomesticScheduledPaymentsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// createDomesticScheduledPaymentConsents :: +// createDomesticScheduledPayments :: +// getDomesticScheduledPaymentConsentsConsentId :: +// getDomesticScheduledPaymentsDomesticScheduledPaymentId :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// createDomesticScheduledPaymentConsents, +// apiVersion, +// nameOf(createDomesticScheduledPaymentConsents), +// "POST", +// "/domestic-scheduled-payment-consents", +// "Create Domestic Scheduled Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val createDomesticScheduledPaymentConsents : OBPEndpoint = { +// case "domestic-scheduled-payment-consents" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// createDomesticScheduledPayments, +// apiVersion, +// nameOf(createDomesticScheduledPayments), +// "POST", +// "/domestic-scheduled-payments", +// "Create Domestic Scheduled Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DomesticScheduledPaymentId" : "DomesticScheduledPaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val createDomesticScheduledPayments : OBPEndpoint = { +// case "domestic-scheduled-payments" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DomesticScheduledPaymentId" : "DomesticScheduledPaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getDomesticScheduledPaymentConsentsConsentId, +// apiVersion, +// nameOf(getDomesticScheduledPaymentConsentsConsentId), +// "GET", +// "/domestic-scheduled-payment-consents/CONSENTID", +// "Get Domestic Scheduled Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getDomesticScheduledPaymentConsentsConsentId : OBPEndpoint = { +// case "domestic-scheduled-payment-consents" :: consentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getDomesticScheduledPaymentsDomesticScheduledPaymentId, +// apiVersion, +// nameOf(getDomesticScheduledPaymentsDomesticScheduledPaymentId), +// "GET", +// "/domestic-scheduled-payments/DOMESTICSCHEDULEDPAYMENTID", +// "Get Domestic Scheduled Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DomesticScheduledPaymentId" : "DomesticScheduledPaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getDomesticScheduledPaymentsDomesticScheduledPaymentId : OBPEndpoint = { +// case "domestic-scheduled-payments" :: domesticscheduledpaymentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DomesticScheduledPaymentId" : "DomesticScheduledPaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorPostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticStandingOrdersApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticStandingOrdersApi.scala index 32f5f229e8..9262c1523c 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticStandingOrdersApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/DomesticStandingOrdersApi.scala @@ -1,764 +1,765 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_DomesticStandingOrdersApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - createDomesticStandingOrderConsents :: - createDomesticStandingOrders :: - getDomesticStandingOrderConsentsConsentId :: - getDomesticStandingOrdersDomesticStandingOrderId :: - Nil - - - resourceDocs += ResourceDoc( - createDomesticStandingOrderConsents, - apiVersion, - nameOf(createDomesticStandingOrderConsents), - "POST", - "/domestic-standing-order-consents", - "Create Domestic Standing Order Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "RecurringPaymentAmount" : { - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Frequency" : "Frequency", - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "FinalPaymentAmount" : { - "Currency" : "Currency" - }, - "NumberOfPayments" : "NumberOfPayments", - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil - ) - - lazy val createDomesticStandingOrderConsents : OBPEndpoint = { - case "domestic-standing-order-consents" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "RecurringPaymentAmount" : { - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Frequency" : "Frequency", - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "FinalPaymentAmount" : { - "Currency" : "Currency" - }, - "NumberOfPayments" : "NumberOfPayments", - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - createDomesticStandingOrders, - apiVersion, - nameOf(createDomesticStandingOrders), - "POST", - "/domestic-standing-orders", - "Create Domestic Standing Orders", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "DomesticStandingOrderId" : "DomesticStandingOrderId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "RecurringPaymentAmount" : { - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Frequency" : "Frequency", - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "FinalPaymentAmount" : { - "Currency" : "Currency" - }, - "NumberOfPayments" : "NumberOfPayments", - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil - ) - - lazy val createDomesticStandingOrders : OBPEndpoint = { - case "domestic-standing-orders" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "DomesticStandingOrderId" : "DomesticStandingOrderId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "RecurringPaymentAmount" : { - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Frequency" : "Frequency", - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "FinalPaymentAmount" : { - "Currency" : "Currency" - }, - "NumberOfPayments" : "NumberOfPayments", - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getDomesticStandingOrderConsentsConsentId, - apiVersion, - nameOf(getDomesticStandingOrderConsentsConsentId), - "GET", - "/domestic-standing-order-consents/CONSENTID", - "Get Domestic Standing Order Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "RecurringPaymentAmount" : { - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Frequency" : "Frequency", - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "FinalPaymentAmount" : { - "Currency" : "Currency" - }, - "NumberOfPayments" : "NumberOfPayments", - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil - ) - - lazy val getDomesticStandingOrderConsentsConsentId : OBPEndpoint = { - case "domestic-standing-order-consents" :: consentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "RecurringPaymentAmount" : { - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Frequency" : "Frequency", - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "FinalPaymentAmount" : { - "Currency" : "Currency" - }, - "NumberOfPayments" : "NumberOfPayments", - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getDomesticStandingOrdersDomesticStandingOrderId, - apiVersion, - nameOf(getDomesticStandingOrdersDomesticStandingOrderId), - "GET", - "/domestic-standing-orders/DOMESTICSTANDINGORDERID", - "Get Domestic Standing Orders", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "DomesticStandingOrderId" : "DomesticStandingOrderId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "RecurringPaymentAmount" : { - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Frequency" : "Frequency", - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "FinalPaymentAmount" : { - "Currency" : "Currency" - }, - "NumberOfPayments" : "NumberOfPayments", - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil - ) - - lazy val getDomesticStandingOrdersDomesticStandingOrderId : OBPEndpoint = { - case "domestic-standing-orders" :: domesticstandingorderid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "DomesticStandingOrderId" : "DomesticStandingOrderId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "RecurringPaymentAmount" : { - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Frequency" : "Frequency", - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "FinalPaymentAmount" : { - "Currency" : "Currency" - }, - "NumberOfPayments" : "NumberOfPayments", - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_DomesticStandingOrdersApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// createDomesticStandingOrderConsents :: +// createDomesticStandingOrders :: +// getDomesticStandingOrderConsentsConsentId :: +// getDomesticStandingOrdersDomesticStandingOrderId :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// createDomesticStandingOrderConsents, +// apiVersion, +// nameOf(createDomesticStandingOrderConsents), +// "POST", +// "/domestic-standing-order-consents", +// "Create Domestic Standing Order Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RecurringPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Frequency" : "Frequency", +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FinalPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "NumberOfPayments" : "NumberOfPayments", +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil +// ) +// +// lazy val createDomesticStandingOrderConsents : OBPEndpoint = { +// case "domestic-standing-order-consents" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RecurringPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Frequency" : "Frequency", +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FinalPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "NumberOfPayments" : "NumberOfPayments", +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// createDomesticStandingOrders, +// apiVersion, +// nameOf(createDomesticStandingOrders), +// "POST", +// "/domestic-standing-orders", +// "Create Domestic Standing Orders", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "DomesticStandingOrderId" : "DomesticStandingOrderId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RecurringPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Frequency" : "Frequency", +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FinalPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "NumberOfPayments" : "NumberOfPayments", +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil +// ) +// +// lazy val createDomesticStandingOrders : OBPEndpoint = { +// case "domestic-standing-orders" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "DomesticStandingOrderId" : "DomesticStandingOrderId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RecurringPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Frequency" : "Frequency", +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FinalPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "NumberOfPayments" : "NumberOfPayments", +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getDomesticStandingOrderConsentsConsentId, +// apiVersion, +// nameOf(getDomesticStandingOrderConsentsConsentId), +// "GET", +// "/domestic-standing-order-consents/CONSENTID", +// "Get Domestic Standing Order Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RecurringPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Frequency" : "Frequency", +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FinalPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "NumberOfPayments" : "NumberOfPayments", +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil +// ) +// +// lazy val getDomesticStandingOrderConsentsConsentId : OBPEndpoint = { +// case "domestic-standing-order-consents" :: consentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RecurringPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Frequency" : "Frequency", +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FinalPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "NumberOfPayments" : "NumberOfPayments", +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getDomesticStandingOrdersDomesticStandingOrderId, +// apiVersion, +// nameOf(getDomesticStandingOrdersDomesticStandingOrderId), +// "GET", +// "/domestic-standing-orders/DOMESTICSTANDINGORDERID", +// "Get Domestic Standing Orders", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "DomesticStandingOrderId" : "DomesticStandingOrderId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RecurringPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Frequency" : "Frequency", +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FinalPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "NumberOfPayments" : "NumberOfPayments", +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil +// ) +// +// lazy val getDomesticStandingOrdersDomesticStandingOrderId : OBPEndpoint = { +// case "domestic-standing-orders" :: domesticstandingorderid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "DomesticStandingOrderId" : "DomesticStandingOrderId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RecurringPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Frequency" : "Frequency", +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FinalPaymentAmount" : { +// "Currency" : "Currency" +// }, +// "NumberOfPayments" : "NumberOfPayments", +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/FilePaymentsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/FilePaymentsApi.scala index 88e72483a5..869571a827 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/FilePaymentsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/FilePaymentsApi.scala @@ -1,697 +1,698 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_FilePaymentsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - createFilePaymentConsents :: - createFilePaymentConsentsConsentIdFile :: - createFilePayments :: - getFilePaymentConsentsConsentId :: - getFilePaymentConsentsConsentIdFile :: - getFilePaymentsFilePaymentId :: - getFilePaymentsFilePaymentIdReportFile :: - Nil - - - resourceDocs += ResourceDoc( - createFilePaymentConsents, - apiVersion, - nameOf(createFilePaymentConsents), - "POST", - "/file-payment-consents", - "Create File Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "ControlSum" : 0.80082819046101150206595775671303272247314453125, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], - "FileHash" : "FileHash", - "NumberOfTransactions" : "NumberOfTransactions", - "FileReference" : "FileReference", - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("File Payments") :: apiTagMockedData :: Nil - ) - - lazy val createFilePaymentConsents : OBPEndpoint = { - case "file-payment-consents" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "ControlSum" : 0.80082819046101150206595775671303272247314453125, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], - "FileHash" : "FileHash", - "NumberOfTransactions" : "NumberOfTransactions", - "FileReference" : "FileReference", - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - createFilePaymentConsentsConsentIdFile, - apiVersion, - nameOf(createFilePaymentConsentsConsentIdFile), - "POST", - "/file-payment-consents/CONSENTID/file", - "Create File Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - EmptyBody, - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("File Payments") :: apiTagMockedData :: Nil - ) - - lazy val createFilePaymentConsentsConsentIdFile : OBPEndpoint = { - case "file-payment-consents" :: consentid:: "file" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (NotImplemented, callContext) - } - } - } - - resourceDocs += ResourceDoc( - createFilePayments, - apiVersion, - nameOf(createFilePayments), - "POST", - "/file-payments", - "Create File Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "FilePaymentId" : "FilePaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "ControlSum" : 0.80082819046101150206595775671303272247314453125, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], - "FileHash" : "FileHash", - "NumberOfTransactions" : "NumberOfTransactions", - "FileReference" : "FileReference", - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("File Payments") :: apiTagMockedData :: Nil - ) - - lazy val createFilePayments : OBPEndpoint = { - case "file-payments" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "FilePaymentId" : "FilePaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "ControlSum" : 0.80082819046101150206595775671303272247314453125, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], - "FileHash" : "FileHash", - "NumberOfTransactions" : "NumberOfTransactions", - "FileReference" : "FileReference", - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getFilePaymentConsentsConsentId, - apiVersion, - nameOf(getFilePaymentConsentsConsentId), - "GET", - "/file-payment-consents/CONSENTID", - "Get File Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "ControlSum" : 0.80082819046101150206595775671303272247314453125, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], - "FileHash" : "FileHash", - "NumberOfTransactions" : "NumberOfTransactions", - "FileReference" : "FileReference", - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("File Payments") :: apiTagMockedData :: Nil - ) - - lazy val getFilePaymentConsentsConsentId : OBPEndpoint = { - case "file-payment-consents" :: consentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "ControlSum" : 0.80082819046101150206595775671303272247314453125, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], - "FileHash" : "FileHash", - "NumberOfTransactions" : "NumberOfTransactions", - "FileReference" : "FileReference", - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getFilePaymentConsentsConsentIdFile, - apiVersion, - nameOf(getFilePaymentConsentsConsentIdFile), - "GET", - "/file-payment-consents/CONSENTID/file", - "Get File Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - EmptyBody, - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("File Payments") :: apiTagMockedData :: Nil - ) - - lazy val getFilePaymentConsentsConsentIdFile : OBPEndpoint = { - case "file-payment-consents" :: consentid:: "file" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (NotImplemented, callContext) - } - } - } - - resourceDocs += ResourceDoc( - getFilePaymentsFilePaymentId, - apiVersion, - nameOf(getFilePaymentsFilePaymentId), - "GET", - "/file-payments/FILEPAYMENTID", - "Get File Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "FilePaymentId" : "FilePaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "ControlSum" : 0.80082819046101150206595775671303272247314453125, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], - "FileHash" : "FileHash", - "NumberOfTransactions" : "NumberOfTransactions", - "FileReference" : "FileReference", - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("File Payments") :: apiTagMockedData :: Nil - ) - - lazy val getFilePaymentsFilePaymentId : OBPEndpoint = { - case "file-payments" :: filepaymentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "FilePaymentId" : "FilePaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "ControlSum" : 0.80082819046101150206595775671303272247314453125, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], - "FileHash" : "FileHash", - "NumberOfTransactions" : "NumberOfTransactions", - "FileReference" : "FileReference", - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getFilePaymentsFilePaymentIdReportFile, - apiVersion, - nameOf(getFilePaymentsFilePaymentIdReportFile), - "GET", - "/file-payments/FILEPAYMENTID/report-file", - "Get File Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - EmptyBody, - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("File Payments") :: apiTagMockedData :: Nil - ) - - lazy val getFilePaymentsFilePaymentIdReportFile : OBPEndpoint = { - case "file-payments" :: filepaymentid:: "report-file" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (NotImplemented, callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_FilePaymentsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// createFilePaymentConsents :: +// createFilePaymentConsentsConsentIdFile :: +// createFilePayments :: +// getFilePaymentConsentsConsentId :: +// getFilePaymentConsentsConsentIdFile :: +// getFilePaymentsFilePaymentId :: +// getFilePaymentsFilePaymentIdReportFile :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// createFilePaymentConsents, +// apiVersion, +// nameOf(createFilePaymentConsents), +// "POST", +// "/file-payment-consents", +// "Create File Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "ControlSum" : 0.80082819046101150206595775671303272247314453125, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], +// "FileHash" : "FileHash", +// "NumberOfTransactions" : "NumberOfTransactions", +// "FileReference" : "FileReference", +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("File Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val createFilePaymentConsents : OBPEndpoint = { +// case "file-payment-consents" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "ControlSum" : 0.80082819046101150206595775671303272247314453125, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], +// "FileHash" : "FileHash", +// "NumberOfTransactions" : "NumberOfTransactions", +// "FileReference" : "FileReference", +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// createFilePaymentConsentsConsentIdFile, +// apiVersion, +// nameOf(createFilePaymentConsentsConsentIdFile), +// "POST", +// "/file-payment-consents/CONSENTID/file", +// "Create File Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// EmptyBody, +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("File Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val createFilePaymentConsentsConsentIdFile : OBPEndpoint = { +// case "file-payment-consents" :: consentid:: "file" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (NotImplemented, callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// createFilePayments, +// apiVersion, +// nameOf(createFilePayments), +// "POST", +// "/file-payments", +// "Create File Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FilePaymentId" : "FilePaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "ControlSum" : 0.80082819046101150206595775671303272247314453125, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], +// "FileHash" : "FileHash", +// "NumberOfTransactions" : "NumberOfTransactions", +// "FileReference" : "FileReference", +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("File Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val createFilePayments : OBPEndpoint = { +// case "file-payments" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FilePaymentId" : "FilePaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "ControlSum" : 0.80082819046101150206595775671303272247314453125, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], +// "FileHash" : "FileHash", +// "NumberOfTransactions" : "NumberOfTransactions", +// "FileReference" : "FileReference", +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getFilePaymentConsentsConsentId, +// apiVersion, +// nameOf(getFilePaymentConsentsConsentId), +// "GET", +// "/file-payment-consents/CONSENTID", +// "Get File Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "ControlSum" : 0.80082819046101150206595775671303272247314453125, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], +// "FileHash" : "FileHash", +// "NumberOfTransactions" : "NumberOfTransactions", +// "FileReference" : "FileReference", +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("File Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getFilePaymentConsentsConsentId : OBPEndpoint = { +// case "file-payment-consents" :: consentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "ControlSum" : 0.80082819046101150206595775671303272247314453125, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], +// "FileHash" : "FileHash", +// "NumberOfTransactions" : "NumberOfTransactions", +// "FileReference" : "FileReference", +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getFilePaymentConsentsConsentIdFile, +// apiVersion, +// nameOf(getFilePaymentConsentsConsentIdFile), +// "GET", +// "/file-payment-consents/CONSENTID/file", +// "Get File Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// EmptyBody, +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("File Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getFilePaymentConsentsConsentIdFile : OBPEndpoint = { +// case "file-payment-consents" :: consentid:: "file" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (NotImplemented, callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getFilePaymentsFilePaymentId, +// apiVersion, +// nameOf(getFilePaymentsFilePaymentId), +// "GET", +// "/file-payments/FILEPAYMENTID", +// "Get File Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FilePaymentId" : "FilePaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "ControlSum" : 0.80082819046101150206595775671303272247314453125, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], +// "FileHash" : "FileHash", +// "NumberOfTransactions" : "NumberOfTransactions", +// "FileReference" : "FileReference", +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("File Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getFilePaymentsFilePaymentId : OBPEndpoint = { +// case "file-payments" :: filepaymentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FilePaymentId" : "FilePaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "ControlSum" : 0.80082819046101150206595775671303272247314453125, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], +// "FileHash" : "FileHash", +// "NumberOfTransactions" : "NumberOfTransactions", +// "FileReference" : "FileReference", +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getFilePaymentsFilePaymentIdReportFile, +// apiVersion, +// nameOf(getFilePaymentsFilePaymentIdReportFile), +// "GET", +// "/file-payments/FILEPAYMENTID/report-file", +// "Get File Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// EmptyBody, +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("File Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getFilePaymentsFilePaymentIdReportFile : OBPEndpoint = { +// case "file-payments" :: filepaymentid:: "report-file" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (NotImplemented, callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/FundsConfirmationsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/FundsConfirmationsApi.scala index a97776eeff..051b2d109e 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/FundsConfirmationsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/FundsConfirmationsApi.scala @@ -1,286 +1,287 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_FundsConfirmationsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - createFundsConfirmationConsents :: - createFundsConfirmations :: - deleteFundsConfirmationConsentsConsentId :: - getFundsConfirmationConsentsConsentId :: - Nil - - - resourceDocs += ResourceDoc( - createFundsConfirmationConsents, - apiVersion, - nameOf(createFundsConfirmationConsents), - "POST", - "/funds-confirmation-consents", - "Create Funds Confirmation Consent", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ConsentId" : "ConsentId" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil - ) - - lazy val createFundsConfirmationConsents : OBPEndpoint = { - case "funds-confirmation-consents" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ConsentId" : "ConsentId" - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - createFundsConfirmations, - apiVersion, - nameOf(createFundsConfirmations), - "POST", - "/funds-confirmations", - "Create Funds Confirmation", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "FundsConfirmationId" : "FundsConfirmationId", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "Reference" : "Reference", - "FundsAvailable" : true, - "ConsentId" : "ConsentId", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil - ) - - lazy val createFundsConfirmations : OBPEndpoint = { - case "funds-confirmations" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "FundsConfirmationId" : "FundsConfirmationId", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "Reference" : "Reference", - "FundsAvailable" : true, - "ConsentId" : "ConsentId", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - deleteFundsConfirmationConsentsConsentId, - apiVersion, - nameOf(deleteFundsConfirmationConsentsConsentId), - "DELETE", - "/funds-confirmation-consents/CONSENTID", - "Delete Funds Confirmation Consent", - s"""${mockedDataText(true)} -""", - EmptyBody, - EmptyBody, - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil - ) - - lazy val deleteFundsConfirmationConsentsConsentId : OBPEndpoint = { - case "funds-confirmation-consents" :: consentid :: Nil JsonDelete _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (NotImplemented, callContext) - } - } - } - - resourceDocs += ResourceDoc( - getFundsConfirmationConsentsConsentId, - apiVersion, - nameOf(getFundsConfirmationConsentsConsentId), - "GET", - "/funds-confirmation-consents/CONSENTID", - "Get Funds Confirmation Consent", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ConsentId" : "ConsentId" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil - ) - - lazy val getFundsConfirmationConsentsConsentId : OBPEndpoint = { - case "funds-confirmation-consents" :: consentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ConsentId" : "ConsentId" - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_FundsConfirmationsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// createFundsConfirmationConsents :: +// createFundsConfirmations :: +// deleteFundsConfirmationConsentsConsentId :: +// getFundsConfirmationConsentsConsentId :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// createFundsConfirmationConsents, +// apiVersion, +// nameOf(createFundsConfirmationConsents), +// "POST", +// "/funds-confirmation-consents", +// "Create Funds Confirmation Consent", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ConsentId" : "ConsentId" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil +// ) +// +// lazy val createFundsConfirmationConsents : OBPEndpoint = { +// case "funds-confirmation-consents" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ConsentId" : "ConsentId" +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// createFundsConfirmations, +// apiVersion, +// nameOf(createFundsConfirmations), +// "POST", +// "/funds-confirmations", +// "Create Funds Confirmation", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "FundsConfirmationId" : "FundsConfirmationId", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Reference" : "Reference", +// "FundsAvailable" : true, +// "ConsentId" : "ConsentId", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil +// ) +// +// lazy val createFundsConfirmations : OBPEndpoint = { +// case "funds-confirmations" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "FundsConfirmationId" : "FundsConfirmationId", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Reference" : "Reference", +// "FundsAvailable" : true, +// "ConsentId" : "ConsentId", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// deleteFundsConfirmationConsentsConsentId, +// apiVersion, +// nameOf(deleteFundsConfirmationConsentsConsentId), +// "DELETE", +// "/funds-confirmation-consents/CONSENTID", +// "Delete Funds Confirmation Consent", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// EmptyBody, +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil +// ) +// +// lazy val deleteFundsConfirmationConsentsConsentId : OBPEndpoint = { +// case "funds-confirmation-consents" :: consentid :: Nil JsonDelete _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (NotImplemented, callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getFundsConfirmationConsentsConsentId, +// apiVersion, +// nameOf(getFundsConfirmationConsentsConsentId), +// "GET", +// "/funds-confirmation-consents/CONSENTID", +// "Get Funds Confirmation Consent", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ConsentId" : "ConsentId" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil +// ) +// +// lazy val getFundsConfirmationConsentsConsentId : OBPEndpoint = { +// case "funds-confirmation-consents" :: consentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ConsentId" : "ConsentId" +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310.scala new file mode 100644 index 0000000000..56a3c403b1 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310.scala @@ -0,0 +1,78 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect._ +import code.api.util.APIUtil.ResourceDoc +import code.api.util.http4s.ResourceDocMiddleware +import code.util.Helper.MdcLoggable +import com.openbankproject.commons.util.ApiVersion +import org.http4s._ + +import scala.collection.mutable.ArrayBuffer + +/** + * UK Open Banking v3.1 — http4s aggregator (mirror of Berlin Group's Http4sBGv2). + * + * Collects resource docs and routes from every per-category endpoint object, + * wraps the combined routes once with ResourceDocMiddleware (which builds the + * CallContext via anonymousAccess for these non-/obp paths), and exposes + * `wrappedRoutes` for wiring into Http4sApp.baseServices. + * + * Coverage: all 20 v3.1 categories (~67 endpoints) are migrated to http4s and + * composed into allRoutes below. The Lift ScannedApis aggregator + * (OBP_UKOpenBanking_310) registers `routes = Nil`, so no UK v3.1 path is served + * by Lift — nothing falls through to the Lift bridge. + */ +object Http4sUKOBv310 extends MdcLoggable { + + type HttpF[A] = OptionT[IO, A] + + val implementedInApiVersion: ApiVersion = ApiVersion.ukOpenBankingV31 + + val resourceDocs: ArrayBuffer[ResourceDoc] = + Http4sUKOBv310AccountAccess.resourceDocs ++ + Http4sUKOBv310Accounts.resourceDocs ++ + Http4sUKOBv310Products.resourceDocs ++ + Http4sUKOBv310Beneficiaries.resourceDocs ++ + Http4sUKOBv310DirectDebits.resourceDocs ++ + Http4sUKOBv310Offers.resourceDocs ++ + Http4sUKOBv310Partys.resourceDocs ++ + Http4sUKOBv310ScheduledPayments.resourceDocs ++ + Http4sUKOBv310StandingOrders.resourceDocs ++ + Http4sUKOBv310Statements.resourceDocs ++ + Http4sUKOBv310DomesticPayments.resourceDocs ++ + Http4sUKOBv310DomesticScheduledPayments.resourceDocs ++ + Http4sUKOBv310DomesticStandingOrders.resourceDocs ++ + Http4sUKOBv310FilePayments.resourceDocs ++ + Http4sUKOBv310FundsConfirmations.resourceDocs ++ + Http4sUKOBv310InternationalPayments.resourceDocs ++ + Http4sUKOBv310InternationalScheduledPayments.resourceDocs ++ + Http4sUKOBv310InternationalStandingOrders.resourceDocs ++ + Http4sUKOBv310Balances.resourceDocs ++ + Http4sUKOBv310Transactions.resourceDocs + + val allRoutes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + Http4sUKOBv310AccountAccess.routes(req) + .orElse(Http4sUKOBv310Accounts.routes(req)) + .orElse(Http4sUKOBv310Balances.routes(req)) + .orElse(Http4sUKOBv310Transactions.routes(req)) + .orElse(Http4sUKOBv310Products.routes(req)) + .orElse(Http4sUKOBv310Beneficiaries.routes(req)) + .orElse(Http4sUKOBv310DirectDebits.routes(req)) + .orElse(Http4sUKOBv310Offers.routes(req)) + .orElse(Http4sUKOBv310Partys.routes(req)) + .orElse(Http4sUKOBv310ScheduledPayments.routes(req)) + .orElse(Http4sUKOBv310StandingOrders.routes(req)) + .orElse(Http4sUKOBv310Statements.routes(req)) + .orElse(Http4sUKOBv310DomesticPayments.routes(req)) + .orElse(Http4sUKOBv310DomesticScheduledPayments.routes(req)) + .orElse(Http4sUKOBv310DomesticStandingOrders.routes(req)) + .orElse(Http4sUKOBv310FilePayments.routes(req)) + .orElse(Http4sUKOBv310FundsConfirmations.routes(req)) + .orElse(Http4sUKOBv310InternationalPayments.routes(req)) + .orElse(Http4sUKOBv310InternationalScheduledPayments.routes(req)) + .orElse(Http4sUKOBv310InternationalStandingOrders.routes(req)) + } + + val wrappedRoutes: HttpRoutes[IO] = ResourceDocMiddleware.apply(resourceDocs)(allRoutes) +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310AccountAccess.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310AccountAccess.scala new file mode 100644 index 0000000000..0f776598f7 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310AccountAccess.scala @@ -0,0 +1,255 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.Constant +import code.api.UKOpenBanking.v3_1_0.JSONFactory_UKOpenBanking_310.ConsentPostBodyUKV310 +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, connectorEmptyResponse, mockedDataText, passesPsd2Aisp, unboxFullOrFail, DateWithDayFormat} +import code.api.util.ApiTag +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, ConsentNotFound, ConsentViewNotFund, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.{EndpointHelpers, RequestOps} +import code.api.util.CallContext +import code.api.util.{ConsentJWT, JwtUtil} +import code.consent.Consents +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.model.User +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** + * UK Open Banking v3.1 — AccountAccessApi, migrated from Lift to http4s. + * Genuine data-backed endpoints: createAccountAccessConsents (POST, 201), + * deleteAccountAccessConsentsConsentId (DELETE, 204), + * getAccountAccessConsentsConsentId (GET, 200). + */ +object Http4sUKOBv310AccountAccess extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + + lazy val createAccountAccessConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "account-access-consents" => + // Check auth FIRST (before body parsing) to mirror Lift's wrappedWithAuthCheck behaviour: + // unauthenticated → 401, invalid body → 400. withUserAndBodyCreated parses body first + // (→ 400) before checking auth — wrong order. Use executeFutureCreated + manual auth check. + EndpointHelpers.executeFutureCreated(req) { + implicit val cc: CallContext = req.callContext + for { + u <- cc.user.toOption match { + case Some(user) => Future.successful(user) + case None => Future.failed(new RuntimeException(AuthenticatedUserIsRequired)) + } + consentJson <- Future.fromTry(scala.util.Try( + net.liftweb.json.parse(cc.httpBody.getOrElse("{}")).extract[ConsentPostBodyUKV310] + )) + consumerId = cc.consumer.map(_.consumerId.get) + _ <- passesPsd2Aisp(Some(cc)) + createdConsent <- Future(Consents.consentProvider.vend.saveUKConsent( + Some(u), + bankId = None, + accountIds = None, + consumerId = consumerId, + permissions = consentJson.Data.Permissions, + expirationDateTime = DateWithDayFormat.parse(consentJson.Data.ExpirationDateTime), + transactionFromDateTime = DateWithDayFormat.parse(consentJson.Data.TransactionFromDateTime), + transactionToDateTime = DateWithDayFormat.parse(consentJson.Data.TransactionToDateTime), + apiStandard = Some("UKOpenBanking"), + apiVersion = Some("3.1.0") + )) map { i => connectorEmptyResponse(i, Some(cc)) } + } yield { + net.liftweb.json.parse(s"""{ + "Meta" : { + "LastAvailableDateTime" : "2000-01-23T06:44:05.618Z", + "FirstAvailableDateTime" : "2000-01-23T06:44:05.618Z", + "TotalPages" : 0 + }, + "Links" : { + "Self" : "${Constant.HostName}/open-banking/v3.1/account-access-consents" + }, + "Risk" : "", + "Data" : { + "Status" : "${createdConsent.status}", + "StatusUpdateDateTime" : "${createdConsent.statusUpdateDateTime}", + "CreationDateTime" : "${createdConsent.creationDateTime}", + "TransactionToDateTime" : "${consentJson.Data.TransactionToDateTime}", + "ExpirationDateTime" : "${consentJson.Data.ExpirationDateTime}", + "Permissions" : ${consentJson.Data.Permissions.mkString("[\"", "\",\"", "\"]")}, + "ConsentId" : "${createdConsent.consentId}", + "TransactionFromDateTime" : "${consentJson.Data.TransactionFromDateTime}" + } + }""") + } + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createAccountAccessConsents), + "POST", + "/account-access-consents", + "Create Account Access Consents", + s"""${mockedDataText(false)} + |Create Account Access Consents + |""".stripMargin, + parseBody("""{ + "Data": { + "Permissions": [ + "ReadAccountsBasic" + ], + "ExpirationDateTime": "2020-10-20T08:40:47.285Z", + "TransactionFromDateTime": "2020-10-20T08:40:47.285Z", + "TransactionToDateTime": "2020-10-20T08:40:47.285Z" + }, + "Risk": "" +}"""), + parseBody("""{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-10-20T08:40:47.375Z", + "Status": "Authorised", + "StatusUpdateDateTime": "2020-10-20T08:40:47.375Z", + "Permissions": [ + "ReadAccountsBasic" + ], + "ExpirationDateTime": "2020-10-20T08:40:47.375Z", + "TransactionFromDateTime": "2020-10-20T08:40:47.375Z", + "TransactionToDateTime": "2020-10-20T08:40:47.375Z" + }, + "Risk": {}, + "Links": { + "Self": "https://obp.example.com/open-banking/v3.1/account-access-consents/CONSENT_ID" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-10-20T08:40:47.375Z", + "LastAvailableDateTime": "2020-10-20T08:40:47.375Z" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Account Access") :: Nil, + http4sPartialFunction = Some(createAccountAccessConsents) + ) + + lazy val deleteAccountAccessConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ DELETE -> `ukV31Prefix` / "account-access-consents" / consentId => + EndpointHelpers.withUserDelete(req) { (_, cc) => + for { + _ <- passesPsd2Aisp(Some(cc)) + _ <- Future(Consents.consentProvider.vend.getConsentByConsentId(consentId)) map { + unboxFullOrFail(_, Some(cc), ConsentNotFound) + } + _ <- Future(Consents.consentProvider.vend.revoke(consentId)) map { + i => connectorEmptyResponse(i, Some(cc)) + } + } yield () + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(deleteAccountAccessConsentsConsentId), + "DELETE", + "/account-access-consents/CONSENT_ID", + "Delete Account Access Consents", + s"""${mockedDataText(false)} + |Delete Account Access Consents + |""".stripMargin, + EmptyBody, + EmptyBody, + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Account Access") :: Nil, + http4sPartialFunction = Some(deleteAccountAccessConsentsConsentId) + ) + + lazy val getAccountAccessConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "account-access-consents" / consentId => + EndpointHelpers.withUser(req) { (_, cc) => + for { + consent <- Future(Consents.consentProvider.vend.getConsentByConsentId(consentId)) map { + unboxFullOrFail(_, Some(cc), s"$ConsentNotFound ($consentId)") + } + consentViews <- Future(JwtUtil.getSignedPayloadAsJson(consent.jsonWebToken).map( + net.liftweb.json.parse(_).extract[ConsentJWT].views.map(_.view_id) + )) map { unboxFullOrFail(_, Some(cc), s"$ConsentViewNotFund ($consentId)") } + } yield { + net.liftweb.json.parse(s"""{ + "Meta" : { + "LastAvailableDateTime" : "2000-01-23T06:44:05.618Z", + "FirstAvailableDateTime" : "2000-01-23T06:44:05.618Z", + "TotalPages" : 0 + }, + "Risk": "", + "Links" : { + "Self" : "${Constant.HostName}/open-banking/v3.1/account-access-consents/CONSENT_ID" + }, + "Data" : { + "Status" : "${consent.status}", + "StatusUpdateDateTime" : "${consent.statusUpdateDateTime}", + "CreationDateTime" : "${consent.creationDateTime}", + "TransactionToDateTime" : "${consent.transactionToDateTime}", + "ExpirationDateTime" : "${consent.expirationDateTime}", + "Permissions" : ${consentViews.mkString("[\"", "\",\"", "\"]")}, + "ConsentId" : "${consent.consentId}", + "TransactionFromDateTime" : "${consent.transactionFromDateTime}" + } + }""") + } + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountAccessConsentsConsentId), + "GET", + "/account-access-consents/CONSENT_ID", + "Get Account Access Consents", + s""" + |${mockedDataText(false)} + |Get Account Access Consents + |""".stripMargin, + EmptyBody, + parseBody("""{ + "Data": { + "ConsentId": "string", + "CreationDateTime": "2020-10-20T10:28:39.801Z", + "Status": "Authorised", + "StatusUpdateDateTime": "2020-10-20T10:28:39.801Z", + "Permissions": [ + "ReadAccountsBasic" + ], + "ExpirationDateTime": "2020-10-20T10:28:39.801Z", + "TransactionFromDateTime": "2020-10-20T10:28:39.801Z", + "TransactionToDateTime": "2020-10-20T10:28:39.801Z" + }, + "Risk": "", + "Links": { + "Self": "https://obp.example.com/open-banking/v3.1/account-access-consents/CONSENT_ID" + }, + "Meta": { + "TotalPages": 0, + "FirstAvailableDateTime": "2020-10-20T10:28:39.801Z", + "LastAvailableDateTime": "2020-10-20T10:28:39.801Z" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Account Access") :: Nil, + http4sPartialFunction = Some(getAccountAccessConsentsConsentId) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createAccountAccessConsents(req) + .orElse(deleteAccountAccessConsentsConsentId(req)) + .orElse(getAccountAccessConsentsConsentId(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Accounts.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Accounts.scala new file mode 100644 index 0000000000..30cfa5f364 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Accounts.scala @@ -0,0 +1,212 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.Constant +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, passesPsd2Aisp} +import code.api.util.ApiTag +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError, attemptedToOpenAnEmptyBox} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.api.util.{APIUtil, NewStyle} +import code.util.Helper.MdcLoggable +import code.views.Views +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.model.{AccountId, BankAccount, BankIdAccountId, View, ViewId} +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.common.{Box, Empty, Full} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** + * UK Open Banking v3.1 — AccountsApi, migrated from Lift to http4s. + * Genuine data-backed endpoints: getAccounts (GET /accounts, 200), + * getAccountsAccountId (GET /accounts/{accountId}, 200). + */ +object Http4sUKOBv310Accounts extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + + lazy val getAccounts: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" => + EndpointHelpers.withUser(req) { (u, cc) => + val detailViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_DETAIL_VIEW_ID) + val basicViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_BASIC_VIEW_ID) + for { + _ <- NewStyle.function.checkUKConsent(u, Some(cc)) + _ <- passesPsd2Aisp(Some(cc)) + availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) + (accounts, _) <- NewStyle.function.getBankAccounts(availablePrivateAccounts, Some(cc)) + (moderatedAttributes, _) <- NewStyle.function.getModeratedAccountAttributesByAccounts( + accounts.map(a => BankIdAccountId(a.bankId, a.accountId)), + basicViewId, + Some(cc)) + } yield { + val allAccounts: List[Box[(BankAccount, View)]] = for (account: BankAccount <- accounts) yield { + APIUtil.checkViewAccessAndReturnView(detailViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), Some(cc)).or( + APIUtil.checkViewAccessAndReturnView(basicViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), Some(cc)) + ) match { + case Full(view) => Full((account, view)) + case _ => Empty + } + } + val accountsWithView: List[(BankAccount, View)] = allAccounts.filter(_.isDefined).map(_.openOrThrowException(attemptedToOpenAnEmptyBox)) + JSONFactory_UKOpenBanking_310.createAccountsListJSON(accountsWithView, moderatedAttributes) + } + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccounts), + "GET", + "/accounts", + "Get Accounts", + s"""""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : {}, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Account" : [ { + "AccountId" : "String", + "Description" : "Description", + "Currency" : "Currency", + "AccountType" : "String", + "AccountSubType" : "String", + "Nickname" : "Nickname" + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Accounts") :: Nil, + http4sPartialFunction = Some(getAccounts) + ) + + lazy val getAccountsAccountId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / accountIdStr => + EndpointHelpers.withUser(req) { (u, cc) => + val accountId = AccountId(accountIdStr) + val detailViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_DETAIL_VIEW_ID) + val basicViewId = ViewId(Constant.SYSTEM_READ_ACCOUNTS_BASIC_VIEW_ID) + for { + availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) map { + _.filter(_.accountId.value == accountId.value) + } + (accounts, _) <- NewStyle.function.getBankAccounts(availablePrivateAccounts, Some(cc)) + (moderatedAttributes, _) <- NewStyle.function.getModeratedAccountAttributesByAccounts( + accounts.map(a => BankIdAccountId(a.bankId, a.accountId)), + basicViewId, + Some(cc)) + } yield { + val allAccounts: List[Box[(BankAccount, View)]] = for (account: BankAccount <- accounts) yield { + APIUtil.checkViewAccessAndReturnView(detailViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), Some(cc)).or( + APIUtil.checkViewAccessAndReturnView(basicViewId, BankIdAccountId(account.bankId, account.accountId), Full(u), Some(cc)) + ) match { + case Full(view) => Full((account, view)) + case _ => Empty + } + } + val accountsWithView: List[(BankAccount, View)] = allAccounts.filter(_.isDefined).map(_.openOrThrowException(attemptedToOpenAnEmptyBox)) + JSONFactory_UKOpenBanking_310.createAccountsListJSON(accountsWithView, moderatedAttributes) + } + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountId), + "GET", + "/accounts/ACCOUNT_ID", + "Get Accounts", + s""" +""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime": "2019-03-05T13:09:30.399Z", + "LastAvailableDateTime": "2019-03-05T13:09:30.399Z", + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Account" : [ { + "Account" : [ { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + } ], + "Servicer" : { + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification" + }, + "AccountId" : "String", + "Description" : "Description", + "Currency" : "Currency", + "AccountType" : "String", + "AccountSubType" : "String", + "Nickname" : "Nickname" + }, { + "Account" : [ { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + } ], + "Servicer" : { + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification" + }, + "AccountId" : "String", + "Description" : "Description", + "Currency" : "Currency", + "AccountType" : "String", + "AccountSubType" : "String", + "Nickname" : "Nickname" + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Accounts") :: Nil, + http4sPartialFunction = Some(getAccountsAccountId) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccounts(req) + .orElse(getAccountsAccountId(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Balances.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Balances.scala new file mode 100644 index 0000000000..97505a2959 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Balances.scala @@ -0,0 +1,163 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.Constant +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, passesPsd2Aisp} +import code.api.util.ApiTag +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.NewStyle +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.api.util.newstyle.ViewNewStyle +import code.util.Helper.MdcLoggable +import code.views.Views +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.model.{AccountId, BankIdAccountId, ViewId} +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.common.Full +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer + +/** + * UK Open Banking v3.1 — BalancesApi, migrated from Lift to http4s. + * getAccountsAccountIdBalances: real business logic with UK consent check. + * getBalances: real business logic, no consent check (mirrors Lift). + */ +object Http4sUKOBv310Balances extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Balances") :: Nil + + private val balancesSuccessBody = parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Balance" : [ { + "Type" : { }, + "AccountId" : { }, + "CreditLine" : [ { + "Type" : { }, + "Included" : true, + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + }, { + "Type" : { }, + "Included" : true, + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + } ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit", + "DateTime" : "2000-01-23T04:56:07.000+00:00" + }, { + "Type" : { }, + "AccountId" : { }, + "CreditLine" : [ { + "Type" : { }, + "Included" : true, + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + }, { + "Type" : { }, + "Included" : true, + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + } ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit", + "DateTime" : "2000-01-23T04:56:07.000+00:00" + } ] + } +}""") + + lazy val getAccountsAccountIdBalances: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / accountIdStr / "balances" => + EndpointHelpers.withUser(req) { (u, cc) => + val accountId = AccountId(accountIdStr) + val viewId = ViewId(Constant.SYSTEM_READ_BALANCES_VIEW_ID) + for { + _ <- NewStyle.function.checkUKConsent(u, Some(cc)) + _ <- passesPsd2Aisp(Some(cc)) + (account, _) <- NewStyle.function.getBankAccountByAccountId(accountId, Some(cc)) + view <- ViewNewStyle.checkViewAccessAndReturnView(viewId, BankIdAccountId(account.bankId, accountId), Full(u), Some(cc)) + moderatedAccount <- NewStyle.function.moderatedBankAccountCore(account, view, Full(u), Some(cc)) + } yield JSONFactory_UKOpenBanking_310.createAccountBalanceJSON(moderatedAccount) + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdBalances), + "GET", + "/accounts/ACCOUNT_ID/balances", + "Get Balances", + s"""""", + EmptyBody, + balancesSuccessBody, + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdBalances) + ) + + lazy val getBalances: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "balances" => + EndpointHelpers.withUser(req) { (u, cc) => + for { + availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) + (accounts, _) <- NewStyle.function.getBankAccounts(availablePrivateAccounts, Some(cc)) + } yield JSONFactory_UKOpenBanking_310.createBalancesJSON(accounts) + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getBalances), + "GET", + "/balances", + "Get Balances", + s"""""", + EmptyBody, + balancesSuccessBody, + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getBalances) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccountsAccountIdBalances(req) + .orElse(getBalances(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Beneficiaries.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Beneficiaries.scala new file mode 100644 index 0000000000..c82bc4ea50 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Beneficiaries.scala @@ -0,0 +1,218 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** + * UK Open Banking v3.1 — BeneficiariesApi, migrated from Lift to http4s. + * Stub endpoints: Lift returned hard-coded mock JSON (HTTP 200) after auth. + * Migrated as authenticated stubs returning the NotImplemented marker (200); + * Swagger keeps the rich Lift docs (doc source not switched). Documented drift. + */ +object Http4sUKOBv310Beneficiaries extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Beneficiaries") :: apiTagMockedData :: Nil + + lazy val getAccountsAccountIdBeneficiaries: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "beneficiaries" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdBeneficiaries), + "GET", + "/accounts/ACCOUNTID/beneficiaries", + "Get Beneficiaries", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Beneficiary" : [ { + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : { }, + "Reference" : "Reference", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "BeneficiaryId" : "BeneficiaryId" + }, { + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : { }, + "Reference" : "Reference", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "BeneficiaryId" : "BeneficiaryId" + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdBeneficiaries) + ) + + lazy val getBeneficiaries: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "beneficiaries" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getBeneficiaries), + "GET", + "/beneficiaries", + "Get Beneficiaries", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Beneficiary" : [ { + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : { }, + "Reference" : "Reference", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "BeneficiaryId" : "BeneficiaryId" + }, { + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : { }, + "Reference" : "Reference", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "BeneficiaryId" : "BeneficiaryId" + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getBeneficiaries) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccountsAccountIdBeneficiaries(req).orElse(getBeneficiaries(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DirectDebits.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DirectDebits.scala new file mode 100644 index 0000000000..cb324abee6 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DirectDebits.scala @@ -0,0 +1,149 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — DirectDebitsApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310DirectDebits extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Direct Debits") :: apiTagMockedData :: Nil + + lazy val getAccountsAccountIdDirectDebits: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "direct-debits" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdDirectDebits), + "GET", + "/accounts/ACCOUNTID/direct-debits", + "Get Direct Debits", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "DirectDebit" : [ { + "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "AccountId" : { }, + "MandateIdentification" : "MandateIdentification", + "DirectDebitStatusCode" : { }, + "DirectDebitId" : "DirectDebitId", + "PreviousPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Name" : "Name" + }, { + "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "AccountId" : { }, + "MandateIdentification" : "MandateIdentification", + "DirectDebitStatusCode" : { }, + "DirectDebitId" : "DirectDebitId", + "PreviousPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Name" : "Name" + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdDirectDebits) + ) + + lazy val getDirectDebits: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "direct-debits" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getDirectDebits), + "GET", + "/direct-debits", + "Get Direct Debits", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "DirectDebit" : [ { + "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "AccountId" : { }, + "MandateIdentification" : "MandateIdentification", + "DirectDebitStatusCode" : { }, + "DirectDebitId" : "DirectDebitId", + "PreviousPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Name" : "Name" + }, { + "PreviousPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "AccountId" : { }, + "MandateIdentification" : "MandateIdentification", + "DirectDebitStatusCode" : { }, + "DirectDebitId" : "DirectDebitId", + "PreviousPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Name" : "Name" + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getDirectDebits) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccountsAccountIdDirectDebits(req).orElse(getDirectDebits(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DomesticPayments.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DomesticPayments.scala new file mode 100644 index 0000000000..36421058c9 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DomesticPayments.scala @@ -0,0 +1,498 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — DomesticPaymentsApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310DomesticPayments extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Domestic Payments") :: apiTagMockedData :: Nil + + lazy val createDomesticPaymentConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "domestic-payment-consents" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createDomesticPaymentConsents), + "POST", + "/domestic-payment-consents", + "Create Domestic Payment Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + }, + "CreditorPostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createDomesticPaymentConsents) + ) + + lazy val createDomesticPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "domestic-payments" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createDomesticPayments), + "POST", + "/domestic-payments", + "Create Domestic Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "DomesticPaymentId" : "DomesticPaymentId", + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + }, + "CreditorPostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createDomesticPayments) + ) + + // Deeper path must come before single-wildcard path in `routes` + lazy val getDomesticPaymentConsentsConsentIdFundsConfirmation: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "domestic-payment-consents" / _ / "funds-confirmation" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getDomesticPaymentConsentsConsentIdFundsConfirmation), + "GET", + "/domestic-payment-consents/CONSENTID/funds-confirmation", + "Get Domestic Payment Consents Funds Confirmation", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "SupplementaryData" : { }, + "FundsAvailableResult" : { + "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", + "FundsAvailable" : true + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getDomesticPaymentConsentsConsentIdFundsConfirmation) + ) + + lazy val getDomesticPaymentConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "domestic-payment-consents" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getDomesticPaymentConsentsConsentId), + "GET", + "/domestic-payment-consents/CONSENTID", + "Get Domestic Payment Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + }, + "CreditorPostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getDomesticPaymentConsentsConsentId) + ) + + lazy val getDomesticPaymentsDomesticPaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "domestic-payments" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getDomesticPaymentsDomesticPaymentId), + "GET", + "/domestic-payments/DOMESTICPAYMENTID", + "Get Domestic Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "DomesticPaymentId" : "DomesticPaymentId", + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + }, + "CreditorPostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getDomesticPaymentsDomesticPaymentId) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createDomesticPaymentConsents(req) + .orElse(createDomesticPayments(req)) + .orElse(getDomesticPaymentConsentsConsentIdFundsConfirmation(req)) + .orElse(getDomesticPaymentConsentsConsentId(req)) + .orElse(getDomesticPaymentsDomesticPaymentId(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DomesticScheduledPayments.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DomesticScheduledPayments.scala new file mode 100644 index 0000000000..6a077b7339 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DomesticScheduledPayments.scala @@ -0,0 +1,464 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — DomesticScheduledPaymentsApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310DomesticScheduledPayments extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil + + lazy val createDomesticScheduledPaymentConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "domestic-scheduled-payment-consents" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createDomesticScheduledPaymentConsents), + "POST", + "/domestic-scheduled-payment-consents", + "Create Domestic Scheduled Payment Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Permission" : { }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "InstructedAmount" : { + "Currency" : "Currency" + }, + "CreditorPostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createDomesticScheduledPaymentConsents) + ) + + lazy val createDomesticScheduledPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "domestic-scheduled-payments" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createDomesticScheduledPayments), + "POST", + "/domestic-scheduled-payments", + "Create Domestic Scheduled Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "DomesticScheduledPaymentId" : "DomesticScheduledPaymentId", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "InstructedAmount" : { + "Currency" : "Currency" + }, + "CreditorPostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createDomesticScheduledPayments) + ) + + lazy val getDomesticScheduledPaymentConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "domestic-scheduled-payment-consents" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getDomesticScheduledPaymentConsentsConsentId), + "GET", + "/domestic-scheduled-payment-consents/CONSENTID", + "Get Domestic Scheduled Payment Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Permission" : { }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "InstructedAmount" : { + "Currency" : "Currency" + }, + "CreditorPostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getDomesticScheduledPaymentConsentsConsentId) + ) + + lazy val getDomesticScheduledPaymentsDomesticScheduledPaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "domestic-scheduled-payments" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getDomesticScheduledPaymentsDomesticScheduledPaymentId), + "GET", + "/domestic-scheduled-payments/DOMESTICSCHEDULEDPAYMENTID", + "Get Domestic Scheduled Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "DomesticScheduledPaymentId" : "DomesticScheduledPaymentId", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "InstructedAmount" : { + "Currency" : "Currency" + }, + "CreditorPostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getDomesticScheduledPaymentsDomesticScheduledPaymentId) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createDomesticScheduledPaymentConsents(req) + .orElse(createDomesticScheduledPayments(req)) + .orElse(getDomesticScheduledPaymentConsentsConsentId(req)) + .orElse(getDomesticScheduledPaymentsDomesticScheduledPaymentId(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DomesticStandingOrders.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DomesticStandingOrders.scala new file mode 100644 index 0000000000..16dc8bf3ee --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310DomesticStandingOrders.scala @@ -0,0 +1,428 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — DomesticStandingOrdersApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310DomesticStandingOrders extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil + + lazy val createDomesticStandingOrderConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "domestic-standing-order-consents" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createDomesticStandingOrderConsents), + "POST", + "/domestic-standing-order-consents", + "Create Domestic Standing Order Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Permission" : { }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Reference" : "Reference", + "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "RecurringPaymentAmount" : { + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Frequency" : "Frequency", + "FirstPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "FinalPaymentAmount" : { + "Currency" : "Currency" + }, + "NumberOfPayments" : "NumberOfPayments", + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createDomesticStandingOrderConsents) + ) + + lazy val createDomesticStandingOrders: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "domestic-standing-orders" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createDomesticStandingOrders), + "POST", + "/domestic-standing-orders", + "Create Domestic Standing Orders", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "DomesticStandingOrderId" : "DomesticStandingOrderId", + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Reference" : "Reference", + "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "RecurringPaymentAmount" : { + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Frequency" : "Frequency", + "FirstPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "FinalPaymentAmount" : { + "Currency" : "Currency" + }, + "NumberOfPayments" : "NumberOfPayments", + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" + }, + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createDomesticStandingOrders) + ) + + lazy val getDomesticStandingOrderConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "domestic-standing-order-consents" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getDomesticStandingOrderConsentsConsentId), + "GET", + "/domestic-standing-order-consents/CONSENTID", + "Get Domestic Standing Order Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Permission" : { }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Reference" : "Reference", + "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "RecurringPaymentAmount" : { + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Frequency" : "Frequency", + "FirstPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "FinalPaymentAmount" : { + "Currency" : "Currency" + }, + "NumberOfPayments" : "NumberOfPayments", + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getDomesticStandingOrderConsentsConsentId) + ) + + lazy val getDomesticStandingOrdersDomesticStandingOrderId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "domestic-standing-orders" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getDomesticStandingOrdersDomesticStandingOrderId), + "GET", + "/domestic-standing-orders/DOMESTICSTANDINGORDERID", + "Get Domestic Standing Orders", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "DomesticStandingOrderId" : "DomesticStandingOrderId", + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Reference" : "Reference", + "RecurringPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "RecurringPaymentAmount" : { + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Frequency" : "Frequency", + "FirstPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "FinalPaymentAmount" : { + "Currency" : "Currency" + }, + "NumberOfPayments" : "NumberOfPayments", + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" + }, + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getDomesticStandingOrdersDomesticStandingOrderId) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createDomesticStandingOrderConsents(req) + .orElse(createDomesticStandingOrders(req)) + .orElse(getDomesticStandingOrderConsentsConsentId(req)) + .orElse(getDomesticStandingOrdersDomesticStandingOrderId(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310FilePayments.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310FilePayments.scala new file mode 100644 index 0000000000..f5db8cd04c --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310FilePayments.scala @@ -0,0 +1,416 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — FilePaymentsApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310FilePayments extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("File Payments") :: apiTagMockedData :: Nil + + // Deeper path (/{id}/file) must come before single-wildcard (/{id}) in `routes` + lazy val createFilePaymentConsentsConsentIdFile: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "file-payment-consents" / _ / "file" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createFilePaymentConsentsConsentIdFile), + "POST", + "/file-payment-consents/CONSENTID/file", + "Create File Payment Consents File", + s"""${mockedDataText(true)}""", + EmptyBody, + EmptyBody, + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createFilePaymentConsentsConsentIdFile) + ) + + lazy val createFilePaymentConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "file-payment-consents" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createFilePaymentConsents), + "POST", + "/file-payment-consents", + "Create File Payment Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "ControlSum" : 0.80082819046101150206595775671303272247314453125, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], + "FileHash" : "FileHash", + "NumberOfTransactions" : "NumberOfTransactions", + "FileReference" : "FileReference", + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createFilePaymentConsents) + ) + + lazy val createFilePayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "file-payments" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createFilePayments), + "POST", + "/file-payments", + "Create File Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "FilePaymentId" : "FilePaymentId", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "ControlSum" : 0.80082819046101150206595775671303272247314453125, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], + "FileHash" : "FileHash", + "NumberOfTransactions" : "NumberOfTransactions", + "FileReference" : "FileReference", + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" + }, + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createFilePayments) + ) + + lazy val getFilePaymentConsentsConsentIdFile: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "file-payment-consents" / _ / "file" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getFilePaymentConsentsConsentIdFile), + "GET", + "/file-payment-consents/CONSENTID/file", + "Get File Payment Consents File", + s"""${mockedDataText(true)}""", + EmptyBody, + EmptyBody, + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getFilePaymentConsentsConsentIdFile) + ) + + lazy val getFilePaymentConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "file-payment-consents" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getFilePaymentConsentsConsentId), + "GET", + "/file-payment-consents/CONSENTID", + "Get File Payment Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "ControlSum" : 0.80082819046101150206595775671303272247314453125, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], + "FileHash" : "FileHash", + "NumberOfTransactions" : "NumberOfTransactions", + "FileReference" : "FileReference", + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getFilePaymentConsentsConsentId) + ) + + lazy val getFilePaymentsFilePaymentIdReportFile: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "file-payments" / _ / "report-file" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getFilePaymentsFilePaymentIdReportFile), + "GET", + "/file-payments/FILEPAYMENTID/report-file", + "Get File Payments Report File", + s"""${mockedDataText(true)}""", + EmptyBody, + EmptyBody, + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getFilePaymentsFilePaymentIdReportFile) + ) + + lazy val getFilePaymentsFilePaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "file-payments" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getFilePaymentsFilePaymentId), + "GET", + "/file-payments/FILEPAYMENTID", + "Get File Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "FilePaymentId" : "FilePaymentId", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "ControlSum" : 0.80082819046101150206595775671303272247314453125, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "FileType" : [ "UK.OBIE.PaymentInitiation.3.1", "UK.OBIE.pain.001.001.08" ], + "FileHash" : "FileHash", + "NumberOfTransactions" : "NumberOfTransactions", + "FileReference" : "FileReference", + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00" + }, + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getFilePaymentsFilePaymentId) + ) + + // Routes ordered deep-first: /{id}/file and /{id}/report-file before /{id} + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createFilePaymentConsentsConsentIdFile(req) + .orElse(createFilePaymentConsents(req)) + .orElse(createFilePayments(req)) + .orElse(getFilePaymentConsentsConsentIdFile(req)) + .orElse(getFilePaymentConsentsConsentId(req)) + .orElse(getFilePaymentsFilePaymentIdReportFile(req)) + .orElse(getFilePaymentsFilePaymentId(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310FundsConfirmations.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310FundsConfirmations.scala new file mode 100644 index 0000000000..2ea23ef127 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310FundsConfirmations.scala @@ -0,0 +1,194 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** + * UK Open Banking v3.1 — FundsConfirmationsApi stubs migrated to http4s. + * GET/POST stubs return the NotImplemented marker (200); DELETE returns 204 + * (matching the Lift handler's HttpCode.`204`). + */ +object Http4sUKOBv310FundsConfirmations extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil + + lazy val createFundsConfirmationConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "funds-confirmation-consents" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createFundsConfirmationConsents), + "POST", + "/funds-confirmation-consents", + "Create Funds Confirmation Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ConsentId" : "ConsentId" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createFundsConfirmationConsents) + ) + + lazy val createFundsConfirmations: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "funds-confirmations" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createFundsConfirmations), + "POST", + "/funds-confirmations", + "Create Funds Confirmations", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "FundsConfirmationId" : "FundsConfirmationId", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "Reference" : "Reference", + "FundsAvailable" : true, + "ConsentId" : "ConsentId", + "InstructedAmount" : { + "Amount" : { }, + "Currency" : "Currency" + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createFundsConfirmations) + ) + + // DELETE returns 204 — matching Lift's HttpCode.`204` response + lazy val deleteFundsConfirmationConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ DELETE -> `ukV31Prefix` / "funds-confirmation-consents" / _ => + EndpointHelpers.withUserDelete(req) { (_, _) => Future.successful(()) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(deleteFundsConfirmationConsentsConsentId), + "DELETE", + "/funds-confirmation-consents/CONSENTID", + "Delete Funds Confirmation Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + EmptyBody, + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(deleteFundsConfirmationConsentsConsentId) + ) + + lazy val getFundsConfirmationConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "funds-confirmation-consents" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getFundsConfirmationConsentsConsentId), + "GET", + "/funds-confirmation-consents/CONSENTID", + "Get Funds Confirmation Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ConsentId" : "ConsentId" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getFundsConfirmationConsentsConsentId) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createFundsConfirmationConsents(req) + .orElse(createFundsConfirmations(req)) + .orElse(deleteFundsConfirmationConsentsConsentId(req)) + .orElse(getFundsConfirmationConsentsConsentId(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310InternationalPayments.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310InternationalPayments.scala new file mode 100644 index 0000000000..7de05c9d6e --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310InternationalPayments.scala @@ -0,0 +1,642 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — InternationalPaymentsApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310InternationalPayments extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("International Payments") :: apiTagMockedData :: Nil + + lazy val createInternationalPaymentConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "international-payment-consents" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createInternationalPaymentConsents), + "POST", + "/international-payment-consents", + "Create International Payment Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExchangeRateInformation" : { + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "RateType" : { }, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "InstructionPriority" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "ExchangeRateInformation" : { + "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createInternationalPaymentConsents) + ) + + lazy val createInternationalPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "international-payments" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createInternationalPayments), + "POST", + "/international-payments", + "Create International Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExchangeRateInformation" : { + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "RateType" : { }, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "InternationalPaymentId" : "InternationalPaymentId", + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "InstructionPriority" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "ExchangeRateInformation" : { + "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createInternationalPayments) + ) + + // Deeper path must come before single-wildcard path in `routes` + lazy val getInternationalPaymentConsentsConsentIdFundsConfirmation: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "international-payment-consents" / _ / "funds-confirmation" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getInternationalPaymentConsentsConsentIdFundsConfirmation), + "GET", + "/international-payment-consents/CONSENTID/funds-confirmation", + "Get International Payment Consents Funds Confirmation", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "SupplementaryData" : { }, + "FundsAvailableResult" : { + "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", + "FundsAvailable" : true + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getInternationalPaymentConsentsConsentIdFundsConfirmation) + ) + + lazy val getInternationalPaymentConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "international-payment-consents" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getInternationalPaymentConsentsConsentId), + "GET", + "/international-payment-consents/CONSENTID", + "Get International Payment Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExchangeRateInformation" : { + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "RateType" : { }, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "InstructionPriority" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "ExchangeRateInformation" : { + "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getInternationalPaymentConsentsConsentId) + ) + + lazy val getInternationalPaymentsInternationalPaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "international-payments" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getInternationalPaymentsInternationalPaymentId), + "GET", + "/international-payments/INTERNATIONALPAYMENTID", + "Get International Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExchangeRateInformation" : { + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "RateType" : { }, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "InternationalPaymentId" : "InternationalPaymentId", + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "InstructionPriority" : { }, + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "ExchangeRateInformation" : { + "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getInternationalPaymentsInternationalPaymentId) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createInternationalPaymentConsents(req) + .orElse(createInternationalPayments(req)) + .orElse(getInternationalPaymentConsentsConsentIdFundsConfirmation(req)) + .orElse(getInternationalPaymentConsentsConsentId(req)) + .orElse(getInternationalPaymentsInternationalPaymentId(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310InternationalScheduledPayments.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310InternationalScheduledPayments.scala new file mode 100644 index 0000000000..914427c35e --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310InternationalScheduledPayments.scala @@ -0,0 +1,648 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — InternationalScheduledPaymentsApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310InternationalScheduledPayments extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil + + lazy val createInternationalScheduledPaymentConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "international-scheduled-payment-consents" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createInternationalScheduledPaymentConsents), + "POST", + "/international-scheduled-payment-consents", + "Create International Scheduled Payment Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExchangeRateInformation" : { + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "RateType" : { }, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Permission" : { }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "InstructionPriority" : { }, + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "ExchangeRateInformation" : { + "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createInternationalScheduledPaymentConsents) + ) + + lazy val createInternationalScheduledPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "international-scheduled-payments" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createInternationalScheduledPayments), + "POST", + "/international-scheduled-payments", + "Create International Scheduled Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExchangeRateInformation" : { + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "RateType" : { }, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "InternationalScheduledPaymentId" : "InternationalScheduledPaymentId", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "InstructionPriority" : { }, + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "ExchangeRateInformation" : { + "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createInternationalScheduledPayments) + ) + + // Deeper path must come before single-wildcard path in `routes` + lazy val getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "international-scheduled-payment-consents" / _ / "funds-confirmation" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation), + "GET", + "/international-scheduled-payment-consents/CONSENTID/funds-confirmation", + "Get International Scheduled Payment Consents Funds Confirmation", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "SupplementaryData" : { }, + "FundsAvailableResult" : { + "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", + "FundsAvailable" : true + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation) + ) + + lazy val getInternationalScheduledPaymentConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "international-scheduled-payment-consents" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getInternationalScheduledPaymentConsentsConsentId), + "GET", + "/international-scheduled-payment-consents/CONSENTID", + "Get International Scheduled Payment Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExchangeRateInformation" : { + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "RateType" : { }, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Permission" : { }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "InstructionPriority" : { }, + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "ExchangeRateInformation" : { + "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getInternationalScheduledPaymentConsentsConsentId) + ) + + lazy val getInternationalScheduledPaymentsInternationalScheduledPaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "international-scheduled-payments" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getInternationalScheduledPaymentsInternationalScheduledPaymentId), + "GET", + "/international-scheduled-payments/INTERNATIONALSCHEDULEDPAYMENTID", + "Get International Scheduled Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExchangeRateInformation" : { + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "RateType" : { }, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "InternationalScheduledPaymentId" : "InternationalScheduledPaymentId", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "EndToEndIdentification" : "EndToEndIdentification", + "InstructionIdentification" : "InstructionIdentification", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "InstructionPriority" : { }, + "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", + "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], + "RemittanceInformation" : { + "Unstructured" : "Unstructured", + "Reference" : "Reference" + }, + "ExchangeRateInformation" : { + "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification" + }, + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + }, + "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getInternationalScheduledPaymentsInternationalScheduledPaymentId) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createInternationalScheduledPaymentConsents(req) + .orElse(createInternationalScheduledPayments(req)) + .orElse(getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation(req)) + .orElse(getInternationalScheduledPaymentConsentsConsentId(req)) + .orElse(getInternationalScheduledPaymentsInternationalScheduledPaymentId(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310InternationalStandingOrders.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310InternationalStandingOrders.scala new file mode 100644 index 0000000000..edb773200b --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310InternationalStandingOrders.scala @@ -0,0 +1,536 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — InternationalStandingOrdersApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310InternationalStandingOrders extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("International Standing Orders") :: apiTagMockedData :: Nil + + lazy val createInternationalStandingOrderConsents: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "international-standing-order-consents" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createInternationalStandingOrderConsents), + "POST", + "/international-standing-order-consents", + "Create International Standing Order Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Permission" : { }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Reference" : "Reference", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "Frequency" : "Frequency", + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberOfPayments" : "NumberOfPayments", + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createInternationalStandingOrderConsents) + ) + + lazy val createInternationalStandingOrders: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ POST -> `ukV31Prefix` / "international-standing-orders" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(createInternationalStandingOrders), + "POST", + "/international-standing-orders", + "Create International Standing Orders", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "InternationalStandingOrderId" : "InternationalStandingOrderId", + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Reference" : "Reference", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "Frequency" : "Frequency", + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberOfPayments" : "NumberOfPayments", + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + }, + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(createInternationalStandingOrders) + ) + + lazy val getInternationalStandingOrderConsentsConsentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "international-standing-order-consents" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getInternationalStandingOrderConsentsConsentId), + "GET", + "/international-standing-order-consents/CONSENTID", + "Get International Standing Order Consents", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Risk" : { + "PaymentContextCode" : { }, + "DeliveryAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], + "AddressLine" : [ "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "PostCode" : "PostCode" + }, + "MerchantCategoryCode" : "MerchantCategoryCode", + "MerchantCustomerIdentification" : "MerchantCustomerIdentification" + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", + "Authorisation" : { + "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", + "AuthorisationType" : { } + }, + "Permission" : { }, + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Reference" : "Reference", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "Frequency" : "Frequency", + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberOfPayments" : "NumberOfPayments", + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getInternationalStandingOrderConsentsConsentId) + ) + + lazy val getInternationalStandingOrdersInternationalStandingOrderPaymentId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "international-standing-orders" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getInternationalStandingOrdersInternationalStandingOrderPaymentId), + "GET", + "/international-standing-orders/INTERNATIONALSTANDINGORDERID", + "Get International Standing Orders", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Status" : { }, + "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "Charges" : [ { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + }, { + "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ChargeBearer" : { } + } ], + "InternationalStandingOrderId" : "InternationalStandingOrderId", + "ConsentId" : "ConsentId", + "Initiation" : { + "SupplementaryData" : { }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Reference" : "Reference", + "CurrencyOfTransfer" : "CurrencyOfTransfer", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Purpose" : { }, + "ChargeBearer" : { }, + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "Frequency" : "Frequency", + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberOfPayments" : "NumberOfPayments", + "Creditor" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "Name" : "Name" + }, + "InstructedAmount" : { + "Currency" : "Currency" + } + }, + "MultiAuthorisation" : { + "Status" : { }, + "NumberReceived" : 6, + "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", + "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", + "NumberRequired" : 0 + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getInternationalStandingOrdersInternationalStandingOrderPaymentId) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + createInternationalStandingOrderConsents(req) + .orElse(createInternationalStandingOrders(req)) + .orElse(getInternationalStandingOrderConsentsConsentId(req)) + .orElse(getInternationalStandingOrdersInternationalStandingOrderPaymentId(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Offers.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Offers.scala new file mode 100644 index 0000000000..83ce4a6b17 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Offers.scala @@ -0,0 +1,181 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — OffersApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310Offers extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Offers") :: apiTagMockedData :: Nil + + lazy val getAccountsAccountIdOffers: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "offers" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdOffers), + "GET", + "/accounts/ACCOUNTID/offers", + "Get Offers", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Offer" : [ { + "OfferId" : "OfferId", + "AccountId" : { }, + "Description" : "Description", + "StartDateTime" : "2000-01-23T04:56:07.000+00:00", + "EndDateTime" : "2000-01-23T04:56:07.000+00:00", + "Rate" : "Rate", + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Fee" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Value" : 0, + "Term" : "Term", + "URL" : "URL", + "OfferType" : { } + }, { + "OfferId" : "OfferId", + "AccountId" : { }, + "Description" : "Description", + "StartDateTime" : "2000-01-23T04:56:07.000+00:00", + "EndDateTime" : "2000-01-23T04:56:07.000+00:00", + "Rate" : "Rate", + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Fee" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Value" : 0, + "Term" : "Term", + "URL" : "URL", + "OfferType" : { } + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdOffers) + ) + + lazy val getOffers: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "offers" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getOffers), + "GET", + "/offers", + "Get Offers", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Offer" : [ { + "OfferId" : "OfferId", + "AccountId" : { }, + "Description" : "Description", + "StartDateTime" : "2000-01-23T04:56:07.000+00:00", + "EndDateTime" : "2000-01-23T04:56:07.000+00:00", + "Rate" : "Rate", + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Fee" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Value" : 0, + "Term" : "Term", + "URL" : "URL", + "OfferType" : { } + }, { + "OfferId" : "OfferId", + "AccountId" : { }, + "Description" : "Description", + "StartDateTime" : "2000-01-23T04:56:07.000+00:00", + "EndDateTime" : "2000-01-23T04:56:07.000+00:00", + "Rate" : "Rate", + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Fee" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "Value" : 0, + "Term" : "Term", + "URL" : "URL", + "OfferType" : { } + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getOffers) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccountsAccountIdOffers(req).orElse(getOffers(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Partys.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Partys.scala new file mode 100644 index 0000000000..271ed49e4f --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Partys.scala @@ -0,0 +1,159 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — PartysApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310Partys extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Partys") :: apiTagMockedData :: Nil + + lazy val getAccountsAccountIdParty: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "party" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdParty), + "GET", + "/accounts/ACCOUNTID/party", + "Get Party", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Party" : { + "PartyNumber" : "PartyNumber", + "PartyId" : "PartyId", + "Address" : [ { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "AddressType" : { }, + "PostCode" : "PostCode" + }, { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "AddressType" : { }, + "PostCode" : "PostCode" + } ], + "Phone" : "Phone", + "Mobile" : "Mobile", + "PartyType" : { }, + "EmailAddress" : "EmailAddress", + "Name" : "Name" + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdParty) + ) + + lazy val getParty: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "party" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getParty), + "GET", + "/party", + "Get Party", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Party" : { + "PartyNumber" : "PartyNumber", + "PartyId" : "PartyId", + "Address" : [ { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "AddressType" : { }, + "PostCode" : "PostCode" + }, { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "AddressType" : { }, + "PostCode" : "PostCode" + } ], + "Phone" : "Phone", + "Mobile" : "Mobile", + "PartyType" : { }, + "EmailAddress" : "EmailAddress", + "Name" : "Name" + } + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getParty) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccountsAccountIdParty(req).orElse(getParty(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Products.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Products.scala new file mode 100644 index 0000000000..23553086fb --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Products.scala @@ -0,0 +1,88 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** + * UK Open Banking v3.1 — ProductsApi, migrated from Lift to http4s. + * + * Both endpoints are stubs: the Lift handler authenticated the user and returned + * the NotImplemented marker (HTTP 200). We mirror that with `withUser` (which + * yields 401 when unauthenticated) returning the same marker. + */ +object Http4sUKOBv310Products extends MdcLoggable { + + type HttpF[A] = OptionT[IO, A] + + implicit val formats: Formats = CustomJsonFormats.formats + + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + + private val tag = ApiTag("Products") :: apiTagMockedData :: Nil + + // ── GET /accounts/ACCOUNTID/product ──────────────────────────────── + lazy val getAccountsAccountIdProduct: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "product" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdProduct), + "GET", + "/accounts/ACCOUNTID/product", + "Get Products", + s"""${mockedDataText(true)}""", + EmptyBody, + EmptyBody, + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdProduct) + ) + + // ── GET /products ────────────────────────────────────────────────── + lazy val getProducts: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "products" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getProducts), + "GET", + "/products", + "Get Products", + s"""${mockedDataText(true)}""", + EmptyBody, + EmptyBody, + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getProducts) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccountsAccountIdProduct(req) + .orElse(getProducts(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310ScheduledPayments.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310ScheduledPayments.scala new file mode 100644 index 0000000000..ab33d7fdd5 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310ScheduledPayments.scala @@ -0,0 +1,185 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — ScheduledPaymentsApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310ScheduledPayments extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Scheduled Payments") :: apiTagMockedData :: Nil + + lazy val getAccountsAccountIdScheduledPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "scheduled-payments" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdScheduledPayments), + "GET", + "/accounts/ACCOUNTID/scheduled-payments", + "Get Scheduled Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "ScheduledPayment" : [ { + "CreditorAgent" : { + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification" + }, + "AccountId" : { }, + "Reference" : "Reference", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "InstructedAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ScheduledPaymentId" : "ScheduledPaymentId", + "ScheduledType" : { } + }, { + "CreditorAgent" : { + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification" + }, + "AccountId" : { }, + "Reference" : "Reference", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "InstructedAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ScheduledPaymentId" : "ScheduledPaymentId", + "ScheduledType" : { } + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdScheduledPayments) + ) + + lazy val getScheduledPayments: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "scheduled-payments" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getScheduledPayments), + "GET", + "/scheduled-payments", + "Get Scheduled Payments", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "ScheduledPayment" : [ { + "CreditorAgent" : { + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification" + }, + "AccountId" : { }, + "Reference" : "Reference", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "InstructedAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ScheduledPaymentId" : "ScheduledPaymentId", + "ScheduledType" : { } + }, { + "CreditorAgent" : { + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification" + }, + "AccountId" : { }, + "Reference" : "Reference", + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "InstructedAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "ScheduledPaymentId" : "ScheduledPaymentId", + "ScheduledType" : { } + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getScheduledPayments) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccountsAccountIdScheduledPayments(req).orElse(getScheduledPayments(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310StandingOrders.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310StandingOrders.scala new file mode 100644 index 0000000000..46d31be218 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310StandingOrders.scala @@ -0,0 +1,233 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** UK Open Banking v3.1 — StandingOrdersApi stubs migrated to http4s (NotImplemented marker, 200). */ +object Http4sUKOBv310StandingOrders extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Standing Orders") :: apiTagMockedData :: Nil + + lazy val getAccountsAccountIdStandingOrders: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "standing-orders" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdStandingOrders), + "GET", + "/accounts/ACCOUNTID/standing-orders", + "Get Standing Orders", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "StandingOrder" : [ { + "SupplementaryData" : { }, + "CreditorAgent" : { + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification" + }, + "AccountId" : { }, + "StandingOrderId" : "StandingOrderId", + "Reference" : "Reference", + "StandingOrderStatusCode" : { }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "FirstPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FinalPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "NextPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "Frequency" : "Frequency", + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" + }, { + "SupplementaryData" : { }, + "CreditorAgent" : { + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification" + }, + "AccountId" : { }, + "StandingOrderId" : "StandingOrderId", + "Reference" : "Reference", + "StandingOrderStatusCode" : { }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "FirstPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FinalPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "NextPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "Frequency" : "Frequency", + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdStandingOrders) + ) + + lazy val getStandingOrders: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "standing-orders" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getStandingOrders), + "GET", + "/standing-orders", + "Get Standing Orders", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "StandingOrder" : [ { + "SupplementaryData" : { }, + "CreditorAgent" : { + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification" + }, + "AccountId" : { }, + "StandingOrderId" : "StandingOrderId", + "Reference" : "Reference", + "StandingOrderStatusCode" : { }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "FirstPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FinalPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "NextPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "Frequency" : "Frequency", + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" + }, { + "SupplementaryData" : { }, + "CreditorAgent" : { + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification" + }, + "AccountId" : { }, + "StandingOrderId" : "StandingOrderId", + "Reference" : "Reference", + "StandingOrderStatusCode" : { }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "FirstPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FinalPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "NextPaymentAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", + "Frequency" : "Frequency", + "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getStandingOrders) + ) + + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccountsAccountIdStandingOrders(req).orElse(getStandingOrders(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Statements.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Statements.scala new file mode 100644 index 0000000000..7d964dbe32 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Statements.scala @@ -0,0 +1,938 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, mockedDataText} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.util.Helper.MdcLoggable +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** + * UK Open Banking v3.1 — StatementsApi stubs migrated to http4s (NotImplemented marker, 200). + * Note: the /accounts/{id}/statements/{sid}/transactions route is also declared by + * TransactionsApi (duplicate); Lift serves Statements first, so it lives here. + */ +object Http4sUKOBv310Statements extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + private val tag = ApiTag("Statements") :: apiTagMockedData :: Nil + + lazy val getAccountsAccountIdStatements: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "statements" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdStatements), + "GET", + "/accounts/ACCOUNTID/statements", + "Get Statements", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Statement" : [ { + "AccountId" : { }, + "StatementReference" : "StatementReference", + "StatementDateTime" : [ { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + }, { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + } ], + "StatementInterest" : [ { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "Type" : { }, + "StartDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementRate" : [ { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + }, { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + } ], + "EndDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementId" : "StatementId", + "StatementValue" : [ { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + }, { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + } ], + "StatementBenefit" : [ { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + }, { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + } ], + "StatementFee" : [ { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "StatementDescription" : [ "StatementDescription", "StatementDescription" ], + "StatementAmount" : [ { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ] + }, { + "AccountId" : { }, + "StatementReference" : "StatementReference", + "StatementDateTime" : [ { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + }, { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + } ], + "StatementInterest" : [ { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "Type" : { }, + "StartDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementRate" : [ { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + }, { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + } ], + "EndDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementId" : "StatementId", + "StatementValue" : [ { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + }, { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + } ], + "StatementBenefit" : [ { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + }, { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + } ], + "StatementFee" : [ { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "StatementDescription" : [ "StatementDescription", "StatementDescription" ], + "StatementAmount" : [ { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ] + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdStatements) + ) + + // Deeper paths must come before the single-segment path in `routes` + lazy val getAccountsAccountIdStatementsStatementIdFile: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "statements" / _ / "file" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdStatementsStatementIdFile), + "GET", + "/accounts/ACCOUNTID/statements/STATEMENTID/file", + "Get Statements File", + s"""${mockedDataText(true)}""", + EmptyBody, + EmptyBody, + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdStatementsStatementIdFile) + ) + + lazy val getAccountsAccountIdStatementsStatementIdTransactions: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "statements" / _ / "transactions" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdStatementsStatementIdTransactions), + "GET", + "/accounts/ACCOUNTID/statements/STATEMENTID/transactions", + "Get Statement Transactions", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Transaction" : [ { + "Status" : { }, + "SupplementaryData" : { }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : { }, + "TransactionReference" : "TransactionReference", + "ProprietaryBankTransactionCode" : { + "Issuer" : "Issuer", + "Code" : "Code" + }, + "AddressLine" : "AddressLine", + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditDebitIndicator" : "Credit", + "CurrencyExchange" : { + "SourceCurrency" : "SourceCurrency", + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "QuotationDate" : "2000-01-23T04:56:07.000+00:00", + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification", + "InstructedAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "TargetCurrency" : "TargetCurrency" + }, + "StatementReference" : [ "StatementReference", "StatementReference" ], + "ChargeAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "TransactionId" : "TransactionId", + "TransactionInformation" : { }, + "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", + "BankTransactionCode" : { + "SubCode" : "SubCode", + "Code" : "Code" + }, + "MerchantDetails" : { + "MerchantName" : "MerchantName", + "MerchantCategoryCode" : "MerchantCategoryCode" + }, + "CardInstrument" : { + "AuthorisationType" : { }, + "Identification" : "Identification", + "CardSchemeName" : { }, + "Name" : "Name" + }, + "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", + "DebtorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Balance" : { + "Type" : { }, + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } + }, { + "Status" : { }, + "SupplementaryData" : { }, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : { }, + "TransactionReference" : "TransactionReference", + "ProprietaryBankTransactionCode" : { + "Issuer" : "Issuer", + "Code" : "Code" + }, + "AddressLine" : "AddressLine", + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditDebitIndicator" : "Credit", + "CurrencyExchange" : { + "SourceCurrency" : "SourceCurrency", + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "QuotationDate" : "2000-01-23T04:56:07.000+00:00", + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification", + "InstructedAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "TargetCurrency" : "TargetCurrency" + }, + "StatementReference" : [ "StatementReference", "StatementReference" ], + "ChargeAmount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "TransactionId" : "TransactionId", + "TransactionInformation" : { }, + "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", + "BankTransactionCode" : { + "SubCode" : "SubCode", + "Code" : "Code" + }, + "MerchantDetails" : { + "MerchantName" : "MerchantName", + "MerchantCategoryCode" : "MerchantCategoryCode" + }, + "CardInstrument" : { + "AuthorisationType" : { }, + "Identification" : "Identification", + "CardSchemeName" : { }, + "Name" : "Name" + }, + "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", + "DebtorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : { }, + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Balance" : { + "Type" : { }, + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdStatementsStatementIdTransactions) + ) + + lazy val getAccountsAccountIdStatementsStatementId: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "statements" / _ => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdStatementsStatementId), + "GET", + "/accounts/ACCOUNTID/statements/STATEMENTID", + "Get Statements", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Statement" : [ { + "AccountId" : { }, + "StatementReference" : "StatementReference", + "StatementDateTime" : [ { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + }, { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + } ], + "StatementInterest" : [ { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "Type" : { }, + "StartDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementRate" : [ { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + }, { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + } ], + "EndDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementId" : "StatementId", + "StatementValue" : [ { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + }, { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + } ], + "StatementBenefit" : [ { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + }, { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + } ], + "StatementFee" : [ { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "StatementDescription" : [ "StatementDescription", "StatementDescription" ], + "StatementAmount" : [ { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ] + }, { + "AccountId" : { }, + "StatementReference" : "StatementReference", + "StatementDateTime" : [ { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + }, { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + } ], + "StatementInterest" : [ { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "Type" : { }, + "StartDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementRate" : [ { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + }, { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + } ], + "EndDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementId" : "StatementId", + "StatementValue" : [ { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + }, { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + } ], + "StatementBenefit" : [ { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + }, { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + } ], + "StatementFee" : [ { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "StatementDescription" : [ "StatementDescription", "StatementDescription" ], + "StatementAmount" : [ { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ] + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getAccountsAccountIdStatementsStatementId) + ) + + lazy val getStatements: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "statements" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getStatements), + "GET", + "/statements", + "Get Statements", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime" : { }, + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Statement" : [ { + "AccountId" : { }, + "StatementReference" : "StatementReference", + "StatementDateTime" : [ { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + }, { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + } ], + "StatementInterest" : [ { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "Type" : { }, + "StartDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementRate" : [ { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + }, { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + } ], + "EndDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementId" : "StatementId", + "StatementValue" : [ { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + }, { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + } ], + "StatementBenefit" : [ { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + }, { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + } ], + "StatementFee" : [ { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "StatementDescription" : [ "StatementDescription", "StatementDescription" ], + "StatementAmount" : [ { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ] + }, { + "AccountId" : { }, + "StatementReference" : "StatementReference", + "StatementDateTime" : [ { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + }, { + "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], + "DateTime" : "2000-01-23T04:56:07.000+00:00" + } ], + "StatementInterest" : [ { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "Type" : { }, + "StartDateTime" : "2000-01-23T04:56:07.000+00:00", + "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementRate" : [ { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + }, { + "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], + "Rate" : "Rate" + } ], + "EndDateTime" : "2000-01-23T04:56:07.000+00:00", + "StatementId" : "StatementId", + "StatementValue" : [ { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + }, { + "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], + "Value" : 0 + } ], + "StatementBenefit" : [ { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + }, { + "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + } + } ], + "StatementFee" : [ { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ], + "StatementDescription" : [ "StatementDescription", "StatementDescription" ], + "StatementAmount" : [ { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + }, { + "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], + "Amount" : { + "Amount" : { }, + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } ] + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + tag, + http4sPartialFunction = Some(getStatements) + ) + + // Routes ordered deep-first to avoid the single-wildcard pattern swallowing deeper paths + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccountsAccountIdStatementsStatementIdFile(req) + .orElse(getAccountsAccountIdStatementsStatementIdTransactions(req)) + .orElse(getAccountsAccountIdStatementsStatementId(req)) + .orElse(getAccountsAccountIdStatements(req)) + .orElse(getStatements(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Transactions.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Transactions.scala new file mode 100644 index 0000000000..2636d41e26 --- /dev/null +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/Http4sUKOBv310Transactions.scala @@ -0,0 +1,839 @@ +package code.api.UKOpenBanking.v3_1_0 + +import cats.data.{Kleisli, OptionT} +import cats.effect.IO +import code.api.APIFailureNewStyle +import code.api.Constant +import code.api.util.APIUtil.{EmptyBody, ResourceDoc, createQueriesByHttpParams, defaultBankId, fullBoxOrException, mockedDataText, passesPsd2Aisp, unboxFull} +import code.api.util.ApiTag +import code.api.util.ApiTag._ +import code.api.util.CustomJsonFormats +import code.api.util.ErrorMessages +import code.api.util.ErrorMessages.{AuthenticatedUserIsRequired, UnknownError} +import code.api.util.NewStyle +import code.api.util.http4s.Http4sRequestAttributes.EndpointHelpers +import code.api.util.newstyle.ViewNewStyle +import code.util.Helper.MdcLoggable +import code.views.Views +import com.github.dwickern.macros.NameOf.nameOf +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.model.{AccountId, BankId, BankIdAccountId, TransactionAttribute, ViewId} +import com.openbankproject.commons.util.{ApiVersion, ScannedApiVersion} +import net.liftweb.common.Full +import code.model.{BankAccountExtended, UserExtended} +import net.liftweb.http.provider.HTTPParam +import net.liftweb.json +import net.liftweb.json.Formats +import org.http4s._ +import org.http4s.dsl.io._ + +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.Future + +/** + * UK Open Banking v3.1 — TransactionsApi, migrated from Lift to http4s. + * + * getAccountsAccountIdStatementsStatementIdTransactions is declared as a stub in + * Http4sUKOBv310Statements (which takes precedence in the Lift priority order). + * This file owns: + * - getAccountsAccountIdTransactions: real business logic with UK consent check. + * - getTransactions: real business logic, bulk (no consent check, mirrors Lift). + */ +object Http4sUKOBv310Transactions extends MdcLoggable { + type HttpF[A] = OptionT[IO, A] + implicit val formats: Formats = CustomJsonFormats.formats + val implementedInApiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val resourceDocs = ArrayBuffer[ResourceDoc]() + private def parseBody(s: String): net.liftweb.json.JObject = net.liftweb.json.parse(s).asInstanceOf[net.liftweb.json.JObject] + val ukV31Prefix = Root / ApiVersion.ukOpenBankingV31.urlPrefix / ApiVersion.ukOpenBankingV31.apiShortVersion + + // ----------------------------------------------------------------------- + // getAccountsAccountIdStatementsStatementIdTransactions (stub) + // The Lift handler for this route returned hard-coded mock JSON after auth. + // Http4sUKOBv310Statements declares an identical route as a stub and is wired + // before this object in Http4sUKOBv310.allRoutes, so the Statements stub takes + // precedence at runtime. We re-register the ResourceDoc here so that the doc + // entry appears under the "Transactions" tag (matching the Lift source of truth) + // in addition to the "Statements" entry. + // ----------------------------------------------------------------------- + lazy val getAccountsAccountIdStatementsStatementIdTransactions: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / _ / "statements" / _ / "transactions" => + EndpointHelpers.withUser(req) { (_, _) => Future.successful(ErrorMessages.NotImplemented) } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdStatementsStatementIdTransactions), + "GET", + "/accounts/ACCOUNTID/statements/STATEMENTID/transactions", + "Get Transactions", + s"""${mockedDataText(true)}""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime": "2019-03-06T07:38:51.169Z", + "LastAvailableDateTime": "2019-03-06T07:38:51.169Z", + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Transaction" : [ { + "Status" : "string", + "SupplementaryData" : {}, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : "string", + "TransactionReference" : "TransactionReference", + "ProprietaryBankTransactionCode" : { + "Issuer" : "Issuer", + "Code" : "Code" + }, + "AddressLine" : "AddressLine", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditDebitIndicator" : "Credit", + "CurrencyExchange" : { + "SourceCurrency" : "SourceCurrency", + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "QuotationDate" : "2000-01-23T04:56:07.000+00:00", + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification", + "InstructedAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TargetCurrency" : "TargetCurrency" + }, + "StatementReference" : [ "StatementReference", "StatementReference" ], + "ChargeAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TransactionId" : "TransactionId", + "TransactionInformation" : "string", + "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", + "BankTransactionCode" : { + "SubCode" : "SubCode", + "Code" : "Code" + }, + "MerchantDetails" : { + "MerchantName" : "MerchantName", + "MerchantCategoryCode" : "MerchantCategoryCode" + }, + "CardInstrument" : { + "AuthorisationType" : "string", + "Identification" : "Identification", + "CardSchemeName" : "string", + "Name" : "Name" + }, + "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", + "DebtorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Balance" : { + "Type" : "string", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } + }, { + "Status" : "string", + "SupplementaryData" : {}, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : "string", + "TransactionReference" : "TransactionReference", + "ProprietaryBankTransactionCode" : { + "Issuer" : "Issuer", + "Code" : "Code" + }, + "AddressLine" : "AddressLine", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditDebitIndicator" : "Credit", + "CurrencyExchange" : { + "SourceCurrency" : "SourceCurrency", + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "QuotationDate" : "2000-01-23T04:56:07.000+00:00", + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification", + "InstructedAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TargetCurrency" : "TargetCurrency" + }, + "StatementReference" : [ "StatementReference", "StatementReference" ], + "ChargeAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TransactionId" : "TransactionId", + "TransactionInformation" : "string", + "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", + "BankTransactionCode" : { + "SubCode" : "SubCode", + "Code" : "Code" + }, + "MerchantDetails" : { + "MerchantName" : "MerchantName", + "MerchantCategoryCode" : "MerchantCategoryCode" + }, + "CardInstrument" : { + "AuthorisationType" : "string", + "Identification" : "Identification", + "CardSchemeName" : "string", + "Name" : "Name" + }, + "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", + "DebtorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Balance" : { + "Type" : "string", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Statements") :: ApiTag("Transactions") :: apiTagMockedData :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdStatementsStatementIdTransactions) + ) + + // ----------------------------------------------------------------------- + // getAccountsAccountIdTransactions — real business logic + // ----------------------------------------------------------------------- + lazy val getAccountsAccountIdTransactions: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "accounts" / accountIdStr / "transactions" => + EndpointHelpers.withUser(req) { (u, cc) => + val accountId = AccountId(accountIdStr) + val detailViewId = ViewId(Constant.SYSTEM_READ_TRANSACTIONS_DETAIL_VIEW_ID) + val basicViewId = ViewId(Constant.SYSTEM_READ_TRANSACTIONS_BASIC_VIEW_ID) + for { + _ <- NewStyle.function.checkUKConsent(u, Some(cc)) + _ <- passesPsd2Aisp(Some(cc)) + (account, _) <- NewStyle.function.getBankAccountByAccountId(accountId, Some(cc)) + (bank, _) <- NewStyle.function.getBank(account.bankId, Some(cc)) + view <- ViewNewStyle.checkViewsAccessAndReturnView(detailViewId, basicViewId, BankIdAccountId(account.bankId, accountId), Full(u), Some(cc)) + params <- Future { + createQueriesByHttpParams(req.headers.headers.toList.map(h => HTTPParam(h.name.toString, List(h.value)))) + } map { x => + unboxFull(fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, Some(cc.toLight)))) + } + (transactions, _) <- BankAccountExtended(account).getModeratedTransactionsFuture(bank, Full(u), view, Some(cc), params) map { x => + unboxFull(fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, Some(cc.toLight)))) + } + (moderatedAttributes: List[TransactionAttribute], _) <- NewStyle.function.getModeratedAttributesByTransactions( + account.bankId, + transactions.map(_.id), + view.viewId, + Some(cc)) + } yield JSONFactory_UKOpenBanking_310.createTransactionsJsonNew(account.bankId, transactions, moderatedAttributes, view) + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getAccountsAccountIdTransactions), + "GET", + "/accounts/ACCOUNT_ID/transactions", + "Get Transactions", + s"""""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime": "2019-03-06T07:38:51.169Z", + "LastAvailableDateTime": "2019-03-06T07:38:51.169Z", + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Transaction" : [ { + "Status" : "string", + "SupplementaryData" : {}, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : "string", + "TransactionReference" : "TransactionReference", + "ProprietaryBankTransactionCode" : { + "Issuer" : "Issuer", + "Code" : "Code" + }, + "AddressLine" : "AddressLine", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditDebitIndicator" : "Credit", + "CurrencyExchange" : { + "SourceCurrency" : "SourceCurrency", + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "QuotationDate" : "2000-01-23T04:56:07.000+00:00", + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification", + "InstructedAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TargetCurrency" : "TargetCurrency" + }, + "StatementReference" : [ "StatementReference", "StatementReference" ], + "ChargeAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TransactionId" : "TransactionId", + "TransactionInformation" : "string", + "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", + "BankTransactionCode" : { + "SubCode" : "SubCode", + "Code" : "Code" + }, + "MerchantDetails" : { + "MerchantName" : "MerchantName", + "MerchantCategoryCode" : "MerchantCategoryCode" + }, + "CardInstrument" : { + "AuthorisationType" : "string", + "Identification" : "Identification", + "CardSchemeName" : "string", + "Name" : "Name" + }, + "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", + "DebtorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Balance" : { + "Type" : "string", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } + }, { + "Status" : "string", + "SupplementaryData" : {}, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : "string", + "TransactionReference" : "TransactionReference", + "ProprietaryBankTransactionCode" : { + "Issuer" : "Issuer", + "Code" : "Code" + }, + "AddressLine" : "AddressLine", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditDebitIndicator" : "Credit", + "CurrencyExchange" : { + "SourceCurrency" : "SourceCurrency", + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "QuotationDate" : "2000-01-23T04:56:07.000+00:00", + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification", + "InstructedAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TargetCurrency" : "TargetCurrency" + }, + "StatementReference" : [ "StatementReference", "StatementReference" ], + "ChargeAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TransactionId" : "TransactionId", + "TransactionInformation" : "string", + "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", + "BankTransactionCode" : { + "SubCode" : "SubCode", + "Code" : "Code" + }, + "MerchantDetails" : { + "MerchantName" : "MerchantName", + "MerchantCategoryCode" : "MerchantCategoryCode" + }, + "CardInstrument" : { + "AuthorisationType" : "string", + "Identification" : "Identification", + "CardSchemeName" : "string", + "Name" : "Name" + }, + "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", + "DebtorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Balance" : { + "Type" : "string", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Transactions") :: Nil, + http4sPartialFunction = Some(getAccountsAccountIdTransactions) + ) + + // ----------------------------------------------------------------------- + // getTransactions — real business logic (bulk, no consent check) + // ----------------------------------------------------------------------- + lazy val getTransactions: HttpRoutes[IO] = HttpRoutes.of[IO] { + case req @ GET -> `ukV31Prefix` / "transactions" => + EndpointHelpers.withUser(req) { (u, cc) => + for { + (bank, _) <- NewStyle.function.getBank(BankId(defaultBankId), Some(cc)) + availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) + (accounts, _) <- NewStyle.function.getBankAccounts(availablePrivateAccounts, Some(cc)) + allTxns <- Future { + accounts.flatMap { bankAccount => + (for { + view <- UserExtended(u).checkOwnerViewAccessAndReturnOwnerView(BankIdAccountId(bankAccount.bankId, bankAccount.accountId), Some(cc)) + params = createQueriesByHttpParams(req.headers.headers.toList.map(h => HTTPParam(h.name.toString, List(h.value)))).getOrElse(Nil) + (transactions, _) <- BankAccountExtended(bankAccount).getModeratedTransactions(bank, Full(u), view, BankIdAccountId(bankAccount.bankId, bankAccount.accountId), Some(cc), params) + } yield transactions).getOrElse(Nil) + } + } + } yield JSONFactory_UKOpenBanking_310.createTransactionsJson(allTxns, Nil) + } + } + resourceDocs += ResourceDoc( + null, + implementedInApiVersion, + nameOf(getTransactions), + "GET", + "/transactions", + "Get Transactions", + s"""""", + EmptyBody, + parseBody("""{ + "Meta" : { + "FirstAvailableDateTime": "2019-03-06T07:38:51.169Z", + "LastAvailableDateTime": "2019-03-06T07:38:51.169Z", + "TotalPages" : 0 + }, + "Links" : { + "Last" : "http://example.com/aeiou", + "Prev" : "http://example.com/aeiou", + "Next" : "http://example.com/aeiou", + "Self" : "http://example.com/aeiou", + "First" : "http://example.com/aeiou" + }, + "Data" : { + "Transaction" : [ { + "Status" : "string", + "SupplementaryData" : {}, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : "string", + "TransactionReference" : "TransactionReference", + "ProprietaryBankTransactionCode" : { + "Issuer" : "Issuer", + "Code" : "Code" + }, + "AddressLine" : "AddressLine", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditDebitIndicator" : "Credit", + "CurrencyExchange" : { + "SourceCurrency" : "SourceCurrency", + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "QuotationDate" : "2000-01-23T04:56:07.000+00:00", + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification", + "InstructedAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TargetCurrency" : "TargetCurrency" + }, + "StatementReference" : [ "StatementReference", "StatementReference" ], + "ChargeAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TransactionId" : "TransactionId", + "TransactionInformation" : "string", + "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", + "BankTransactionCode" : { + "SubCode" : "SubCode", + "Code" : "Code" + }, + "MerchantDetails" : { + "MerchantName" : "MerchantName", + "MerchantCategoryCode" : "MerchantCategoryCode" + }, + "CardInstrument" : { + "AuthorisationType" : "string", + "Identification" : "Identification", + "CardSchemeName" : "string", + "Name" : "Name" + }, + "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", + "DebtorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Balance" : { + "Type" : "string", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } + }, { + "Status" : "string", + "SupplementaryData" : {}, + "CreditorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "DebtorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "AccountId" : "string", + "TransactionReference" : "TransactionReference", + "ProprietaryBankTransactionCode" : { + "Issuer" : "Issuer", + "Code" : "Code" + }, + "AddressLine" : "AddressLine", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditorAccount" : { + "SecondaryIdentification" : "SecondaryIdentification", + "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "CreditDebitIndicator" : "Credit", + "CurrencyExchange" : { + "SourceCurrency" : "SourceCurrency", + "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, + "QuotationDate" : "2000-01-23T04:56:07.000+00:00", + "UnitCurrency" : "UnitCurrency", + "ContractIdentification" : "ContractIdentification", + "InstructedAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TargetCurrency" : "TargetCurrency" + }, + "StatementReference" : [ "StatementReference", "StatementReference" ], + "ChargeAmount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "TransactionId" : "TransactionId", + "TransactionInformation" : "string", + "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", + "BankTransactionCode" : { + "SubCode" : "SubCode", + "Code" : "Code" + }, + "MerchantDetails" : { + "MerchantName" : "MerchantName", + "MerchantCategoryCode" : "MerchantCategoryCode" + }, + "CardInstrument" : { + "AuthorisationType" : "string", + "Identification" : "Identification", + "CardSchemeName" : "string", + "Name" : "Name" + }, + "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", + "DebtorAgent" : { + "PostalAddress" : { + "StreetName" : "StreetName", + "CountrySubDivision" : "CountrySubDivision", + "Department" : "Department", + "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], + "BuildingNumber" : "BuildingNumber", + "TownName" : "TownName", + "Country" : "Country", + "SubDepartment" : "SubDepartment", + "AddressType" : "string", + "PostCode" : "PostCode" + }, + "SchemeName" : [ "UK.OBIE.BICFI" ], + "Identification" : "Identification", + "Name" : "Name" + }, + "Balance" : { + "Type" : "string", + "Amount" : { + "Amount" : "string", + "Currency" : "Currency" + }, + "CreditDebitIndicator" : "Credit" + } + } ] + } +}"""), + List(AuthenticatedUserIsRequired, UnknownError), + ApiTag("Transactions") :: Nil, + http4sPartialFunction = Some(getTransactions) + ) + + // Routes ordered deep-first: 5-segment path before 3-segment before 1-segment + val routes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req => + getAccountsAccountIdStatementsStatementIdTransactions(req) + .orElse(getAccountsAccountIdTransactions(req)) + .orElse(getTransactions(req)) + } +} diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalPaymentsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalPaymentsApi.scala index dc2db414a5..98b1f034ea 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalPaymentsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalPaymentsApi.scala @@ -1,1177 +1,1178 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_InternationalPaymentsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - createInternationalPaymentConsents :: - createInternationalPayments :: - getInternationalPaymentConsentsConsentId :: - getInternationalPaymentConsentsConsentIdFundsConfirmation :: - getInternationalPaymentsInternationalPaymentId :: - Nil - - - resourceDocs += ResourceDoc( - createInternationalPaymentConsents, - apiVersion, - nameOf(createInternationalPaymentConsents), - "POST", - "/international-payment-consents", - "Create International Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Payments") :: apiTagMockedData :: Nil - ) - - lazy val createInternationalPaymentConsents : OBPEndpoint = { - case "international-payment-consents" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - createInternationalPayments, - apiVersion, - nameOf(createInternationalPayments), - "POST", - "/international-payments", - "Create International Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "InternationalPaymentId" : "InternationalPaymentId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Payments") :: apiTagMockedData :: Nil - ) - - lazy val createInternationalPayments : OBPEndpoint = { - case "international-payments" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "InternationalPaymentId" : "InternationalPaymentId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getInternationalPaymentConsentsConsentId, - apiVersion, - nameOf(getInternationalPaymentConsentsConsentId), - "GET", - "/international-payment-consents/CONSENTID", - "Get International Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Payments") :: apiTagMockedData :: Nil - ) - - lazy val getInternationalPaymentConsentsConsentId : OBPEndpoint = { - case "international-payment-consents" :: consentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getInternationalPaymentConsentsConsentIdFundsConfirmation, - apiVersion, - nameOf(getInternationalPaymentConsentsConsentIdFundsConfirmation), - "GET", - "/international-payment-consents/CONSENTID/funds-confirmation", - "Get International Payment Consents Funds Confirmation", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "SupplementaryData" : { }, - "FundsAvailableResult" : { - "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", - "FundsAvailable" : true - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Payments") :: apiTagMockedData :: Nil - ) - - lazy val getInternationalPaymentConsentsConsentIdFundsConfirmation : OBPEndpoint = { - case "international-payment-consents" :: consentid:: "funds-confirmation" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "SupplementaryData" : { }, - "FundsAvailableResult" : { - "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", - "FundsAvailable" : true - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getInternationalPaymentsInternationalPaymentId, - apiVersion, - nameOf(getInternationalPaymentsInternationalPaymentId), - "GET", - "/international-payments/INTERNATIONALPAYMENTID", - "Get International Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "InternationalPaymentId" : "InternationalPaymentId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Payments") :: apiTagMockedData :: Nil - ) - - lazy val getInternationalPaymentsInternationalPaymentId : OBPEndpoint = { - case "international-payments" :: internationalpaymentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "InternationalPaymentId" : "InternationalPaymentId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_InternationalPaymentsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// createInternationalPaymentConsents :: +// createInternationalPayments :: +// getInternationalPaymentConsentsConsentId :: +// getInternationalPaymentConsentsConsentIdFundsConfirmation :: +// getInternationalPaymentsInternationalPaymentId :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// createInternationalPaymentConsents, +// apiVersion, +// nameOf(createInternationalPaymentConsents), +// "POST", +// "/international-payment-consents", +// "Create International Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val createInternationalPaymentConsents : OBPEndpoint = { +// case "international-payment-consents" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// createInternationalPayments, +// apiVersion, +// nameOf(createInternationalPayments), +// "POST", +// "/international-payments", +// "Create International Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "InternationalPaymentId" : "InternationalPaymentId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val createInternationalPayments : OBPEndpoint = { +// case "international-payments" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "InternationalPaymentId" : "InternationalPaymentId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getInternationalPaymentConsentsConsentId, +// apiVersion, +// nameOf(getInternationalPaymentConsentsConsentId), +// "GET", +// "/international-payment-consents/CONSENTID", +// "Get International Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getInternationalPaymentConsentsConsentId : OBPEndpoint = { +// case "international-payment-consents" :: consentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getInternationalPaymentConsentsConsentIdFundsConfirmation, +// apiVersion, +// nameOf(getInternationalPaymentConsentsConsentIdFundsConfirmation), +// "GET", +// "/international-payment-consents/CONSENTID/funds-confirmation", +// "Get International Payment Consents Funds Confirmation", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "SupplementaryData" : { }, +// "FundsAvailableResult" : { +// "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FundsAvailable" : true +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getInternationalPaymentConsentsConsentIdFundsConfirmation : OBPEndpoint = { +// case "international-payment-consents" :: consentid:: "funds-confirmation" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "SupplementaryData" : { }, +// "FundsAvailableResult" : { +// "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FundsAvailable" : true +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getInternationalPaymentsInternationalPaymentId, +// apiVersion, +// nameOf(getInternationalPaymentsInternationalPaymentId), +// "GET", +// "/international-payments/INTERNATIONALPAYMENTID", +// "Get International Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "InternationalPaymentId" : "InternationalPaymentId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getInternationalPaymentsInternationalPaymentId : OBPEndpoint = { +// case "international-payments" :: internationalpaymentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "InternationalPaymentId" : "InternationalPaymentId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalScheduledPaymentsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalScheduledPaymentsApi.scala index 05070bb0df..61dfdc78cb 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalScheduledPaymentsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalScheduledPaymentsApi.scala @@ -1,1189 +1,1190 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_InternationalScheduledPaymentsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - createInternationalScheduledPaymentConsents :: - createInternationalScheduledPayments :: - getInternationalScheduledPaymentConsentsConsentId :: - getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation :: - getInternationalScheduledPaymentsInternationalScheduledPaymentId :: - Nil - - - resourceDocs += ResourceDoc( - createInternationalScheduledPaymentConsents, - apiVersion, - nameOf(createInternationalScheduledPaymentConsents), - "POST", - "/international-scheduled-payment-consents", - "Create International Scheduled Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil - ) - - lazy val createInternationalScheduledPaymentConsents : OBPEndpoint = { - case "international-scheduled-payment-consents" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - createInternationalScheduledPayments, - apiVersion, - nameOf(createInternationalScheduledPayments), - "POST", - "/international-scheduled-payments", - "Create International Scheduled Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "InternationalScheduledPaymentId" : "InternationalScheduledPaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil - ) - - lazy val createInternationalScheduledPayments : OBPEndpoint = { - case "international-scheduled-payments" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "InternationalScheduledPaymentId" : "InternationalScheduledPaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getInternationalScheduledPaymentConsentsConsentId, - apiVersion, - nameOf(getInternationalScheduledPaymentConsentsConsentId), - "GET", - "/international-scheduled-payment-consents/CONSENTID", - "Get International Scheduled Payment Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil - ) - - lazy val getInternationalScheduledPaymentConsentsConsentId : OBPEndpoint = { - case "international-scheduled-payment-consents" :: consentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation, - apiVersion, - nameOf(getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation), - "GET", - "/international-scheduled-payment-consents/CONSENTID/funds-confirmation", - "Get International Scheduled Payment Consents Funds Confirmation", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "SupplementaryData" : { }, - "FundsAvailableResult" : { - "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", - "FundsAvailable" : true - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil - ) - - lazy val getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation : OBPEndpoint = { - case "international-scheduled-payment-consents" :: consentid:: "funds-confirmation" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "SupplementaryData" : { }, - "FundsAvailableResult" : { - "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", - "FundsAvailable" : true - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getInternationalScheduledPaymentsInternationalScheduledPaymentId, - apiVersion, - nameOf(getInternationalScheduledPaymentsInternationalScheduledPaymentId), - "GET", - "/international-scheduled-payments/INTERNATIONALSCHEDULEDPAYMENTID", - "Get International Scheduled Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "InternationalScheduledPaymentId" : "InternationalScheduledPaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil - ) - - lazy val getInternationalScheduledPaymentsInternationalScheduledPaymentId : OBPEndpoint = { - case "international-scheduled-payments" :: internationalscheduledpaymentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExchangeRateInformation" : { - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "RateType" : { }, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "InternationalScheduledPaymentId" : "InternationalScheduledPaymentId", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "EndToEndIdentification" : "EndToEndIdentification", - "InstructionIdentification" : "InstructionIdentification", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "InstructionPriority" : { }, - "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", - "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], - "RemittanceInformation" : { - "Unstructured" : "Unstructured", - "Reference" : "Reference" - }, - "ExchangeRateInformation" : { - "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification" - }, - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_InternationalScheduledPaymentsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// createInternationalScheduledPaymentConsents :: +// createInternationalScheduledPayments :: +// getInternationalScheduledPaymentConsentsConsentId :: +// getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation :: +// getInternationalScheduledPaymentsInternationalScheduledPaymentId :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// createInternationalScheduledPaymentConsents, +// apiVersion, +// nameOf(createInternationalScheduledPaymentConsents), +// "POST", +// "/international-scheduled-payment-consents", +// "Create International Scheduled Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val createInternationalScheduledPaymentConsents : OBPEndpoint = { +// case "international-scheduled-payment-consents" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// createInternationalScheduledPayments, +// apiVersion, +// nameOf(createInternationalScheduledPayments), +// "POST", +// "/international-scheduled-payments", +// "Create International Scheduled Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "InternationalScheduledPaymentId" : "InternationalScheduledPaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val createInternationalScheduledPayments : OBPEndpoint = { +// case "international-scheduled-payments" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "InternationalScheduledPaymentId" : "InternationalScheduledPaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getInternationalScheduledPaymentConsentsConsentId, +// apiVersion, +// nameOf(getInternationalScheduledPaymentConsentsConsentId), +// "GET", +// "/international-scheduled-payment-consents/CONSENTID", +// "Get International Scheduled Payment Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getInternationalScheduledPaymentConsentsConsentId : OBPEndpoint = { +// case "international-scheduled-payment-consents" :: consentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00" +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation, +// apiVersion, +// nameOf(getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation), +// "GET", +// "/international-scheduled-payment-consents/CONSENTID/funds-confirmation", +// "Get International Scheduled Payment Consents Funds Confirmation", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "SupplementaryData" : { }, +// "FundsAvailableResult" : { +// "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FundsAvailable" : true +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation : OBPEndpoint = { +// case "international-scheduled-payment-consents" :: consentid:: "funds-confirmation" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "SupplementaryData" : { }, +// "FundsAvailableResult" : { +// "FundsAvailableDateTime" : "2000-01-23T04:56:07.000+00:00", +// "FundsAvailable" : true +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getInternationalScheduledPaymentsInternationalScheduledPaymentId, +// apiVersion, +// nameOf(getInternationalScheduledPaymentsInternationalScheduledPaymentId), +// "GET", +// "/international-scheduled-payments/INTERNATIONALSCHEDULEDPAYMENTID", +// "Get International Scheduled Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "InternationalScheduledPaymentId" : "InternationalScheduledPaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getInternationalScheduledPaymentsInternationalScheduledPaymentId : OBPEndpoint = { +// case "international-scheduled-payments" :: internationalscheduledpaymentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpectedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExchangeRateInformation" : { +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "RateType" : { }, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "InternationalScheduledPaymentId" : "InternationalScheduledPaymentId", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "EndToEndIdentification" : "EndToEndIdentification", +// "InstructionIdentification" : "InstructionIdentification", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "InstructionPriority" : { }, +// "RequestedExecutionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "LocalInstrument" : [ "UK.OBIE.BACS", "UK.OBIE.BalanceTransfer", "UK.OBIE.CHAPS", "UK.OBIE.Euro1", "UK.OBIE.FPS", "UK.OBIE.Link", "UK.OBIE.MoneyTransfer", "UK.OBIE.Paym", "UK.OBIE.SEPACreditTransfer", "UK.OBIE.SEPAInstantCreditTransfer", "UK.OBIE.SWIFT", "UK.OBIE.Target2" ], +// "RemittanceInformation" : { +// "Unstructured" : "Unstructured", +// "Reference" : "Reference" +// }, +// "ExchangeRateInformation" : { +// "ExchangeRate" : 6.02745618307040320615897144307382404804229736328125, +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification" +// }, +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "ExpectedSettlementDateTime" : "2000-01-23T04:56:07.000+00:00", +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalStandingOrdersApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalStandingOrdersApi.scala index 8735d6c6c6..a5f90d47ef 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalStandingOrdersApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/InternationalStandingOrdersApi.scala @@ -1,980 +1,981 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_InternationalStandingOrdersApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - createInternationalStandingOrderConsents :: - createInternationalStandingOrders :: - getInternationalStandingOrderConsentsConsentId :: - getInternationalStandingOrdersInternationalStandingOrderPaymentId :: - Nil - - - resourceDocs += ResourceDoc( - createInternationalStandingOrderConsents, - apiVersion, - nameOf(createInternationalStandingOrderConsents), - "POST", - "/international-standing-order-consents", - "Create International Standing Order Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberOfPayments" : "NumberOfPayments", - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Standing Orders") :: apiTagMockedData :: Nil - ) - - lazy val createInternationalStandingOrderConsents : OBPEndpoint = { - case "international-standing-order-consents" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberOfPayments" : "NumberOfPayments", - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - createInternationalStandingOrders, - apiVersion, - nameOf(createInternationalStandingOrders), - "POST", - "/international-standing-orders", - "Create International Standing Orders", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "InternationalStandingOrderId" : "InternationalStandingOrderId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberOfPayments" : "NumberOfPayments", - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Standing Orders") :: apiTagMockedData :: Nil - ) - - lazy val createInternationalStandingOrders : OBPEndpoint = { - case "international-standing-orders" :: Nil JsonPost _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "InternationalStandingOrderId" : "InternationalStandingOrderId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberOfPayments" : "NumberOfPayments", - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getInternationalStandingOrderConsentsConsentId, - apiVersion, - nameOf(getInternationalStandingOrderConsentsConsentId), - "GET", - "/international-standing-order-consents/CONSENTID", - "Get International Standing Order Consents", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberOfPayments" : "NumberOfPayments", - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Standing Orders") :: apiTagMockedData :: Nil - ) - - lazy val getInternationalStandingOrderConsentsConsentId : OBPEndpoint = { - case "international-standing-order-consents" :: consentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Risk" : { - "PaymentContextCode" : { }, - "DeliveryAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], - "AddressLine" : [ "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "PostCode" : "PostCode" - }, - "MerchantCategoryCode" : "MerchantCategoryCode", - "MerchantCustomerIdentification" : "MerchantCustomerIdentification" - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", - "Authorisation" : { - "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", - "AuthorisationType" : { } - }, - "Permission" : { }, - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberOfPayments" : "NumberOfPayments", - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getInternationalStandingOrdersInternationalStandingOrderPaymentId, - apiVersion, - nameOf(getInternationalStandingOrdersInternationalStandingOrderPaymentId), - "GET", - "/international-standing-orders/INTERNATIONALSTANDINGORDERPAYMENTID", - "Get International Standing Orders", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "InternationalStandingOrderId" : "InternationalStandingOrderId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberOfPayments" : "NumberOfPayments", - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("International Standing Orders") :: apiTagMockedData :: Nil - ) - - lazy val getInternationalStandingOrdersInternationalStandingOrderPaymentId : OBPEndpoint = { - case "international-standing-orders" :: internationalstandingorderpaymentid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Status" : { }, - "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "Charges" : [ { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - }, { - "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ChargeBearer" : { } - } ], - "InternationalStandingOrderId" : "InternationalStandingOrderId", - "ConsentId" : "ConsentId", - "Initiation" : { - "SupplementaryData" : { }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Reference" : "Reference", - "CurrencyOfTransfer" : "CurrencyOfTransfer", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Purpose" : { }, - "ChargeBearer" : { }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberOfPayments" : "NumberOfPayments", - "Creditor" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "Name" : "Name" - }, - "InstructedAmount" : { - "Currency" : "Currency" - } - }, - "MultiAuthorisation" : { - "Status" : { }, - "NumberReceived" : 6, - "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", - "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", - "NumberRequired" : 0 - } - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_InternationalStandingOrdersApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// createInternationalStandingOrderConsents :: +// createInternationalStandingOrders :: +// getInternationalStandingOrderConsentsConsentId :: +// getInternationalStandingOrdersInternationalStandingOrderPaymentId :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// createInternationalStandingOrderConsents, +// apiVersion, +// nameOf(createInternationalStandingOrderConsents), +// "POST", +// "/international-standing-order-consents", +// "Create International Standing Order Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberOfPayments" : "NumberOfPayments", +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Standing Orders") :: apiTagMockedData :: Nil +// ) +// +// lazy val createInternationalStandingOrderConsents : OBPEndpoint = { +// case "international-standing-order-consents" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberOfPayments" : "NumberOfPayments", +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// createInternationalStandingOrders, +// apiVersion, +// nameOf(createInternationalStandingOrders), +// "POST", +// "/international-standing-orders", +// "Create International Standing Orders", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "InternationalStandingOrderId" : "InternationalStandingOrderId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberOfPayments" : "NumberOfPayments", +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Standing Orders") :: apiTagMockedData :: Nil +// ) +// +// lazy val createInternationalStandingOrders : OBPEndpoint = { +// case "international-standing-orders" :: Nil JsonPost _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "InternationalStandingOrderId" : "InternationalStandingOrderId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberOfPayments" : "NumberOfPayments", +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getInternationalStandingOrderConsentsConsentId, +// apiVersion, +// nameOf(getInternationalStandingOrderConsentsConsentId), +// "GET", +// "/international-standing-order-consents/CONSENTID", +// "Get International Standing Order Consents", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberOfPayments" : "NumberOfPayments", +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Standing Orders") :: apiTagMockedData :: Nil +// ) +// +// lazy val getInternationalStandingOrderConsentsConsentId : OBPEndpoint = { +// case "international-standing-order-consents" :: consentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Risk" : { +// "PaymentContextCode" : { }, +// "DeliveryAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : [ "CountrySubDivision", "CountrySubDivision" ], +// "AddressLine" : [ "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "PostCode" : "PostCode" +// }, +// "MerchantCategoryCode" : "MerchantCategoryCode", +// "MerchantCustomerIdentification" : "MerchantCustomerIdentification" +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CutOffDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Authorisation" : { +// "CompletionDateTime" : "2000-01-23T04:56:07.000+00:00", +// "AuthorisationType" : { } +// }, +// "Permission" : { }, +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberOfPayments" : "NumberOfPayments", +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getInternationalStandingOrdersInternationalStandingOrderPaymentId, +// apiVersion, +// nameOf(getInternationalStandingOrdersInternationalStandingOrderPaymentId), +// "GET", +// "/international-standing-orders/INTERNATIONALSTANDINGORDERPAYMENTID", +// "Get International Standing Orders", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "InternationalStandingOrderId" : "InternationalStandingOrderId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberOfPayments" : "NumberOfPayments", +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("International Standing Orders") :: apiTagMockedData :: Nil +// ) +// +// lazy val getInternationalStandingOrdersInternationalStandingOrderPaymentId : OBPEndpoint = { +// case "international-standing-orders" :: internationalstandingorderpaymentid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Status" : { }, +// "StatusUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Charges" : [ { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// }, { +// "Type" : [ "UK.OBIE.CHAPSOut", "UK.OBIE.BalanceTransferOut", "UK.OBIE.MoneyTransferOut" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ChargeBearer" : { } +// } ], +// "InternationalStandingOrderId" : "InternationalStandingOrderId", +// "ConsentId" : "ConsentId", +// "Initiation" : { +// "SupplementaryData" : { }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Reference" : "Reference", +// "CurrencyOfTransfer" : "CurrencyOfTransfer", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Purpose" : { }, +// "ChargeBearer" : { }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberOfPayments" : "NumberOfPayments", +// "Creditor" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "Name" : "Name" +// }, +// "InstructedAmount" : { +// "Currency" : "Currency" +// } +// }, +// "MultiAuthorisation" : { +// "Status" : { }, +// "NumberReceived" : 6, +// "LastUpdateDateTime" : "2000-01-23T04:56:07.000+00:00", +// "ExpirationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NumberRequired" : 0 +// } +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/OBP_UKOpenBanking_310.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/OBP_UKOpenBanking_310.scala index 6ea2f9742f..b9a24b718f 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/OBP_UKOpenBanking_310.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/OBP_UKOpenBanking_310.scala @@ -1,104 +1,85 @@ -/** - * Open Bank Project - API - * Copyright (C) 2011-2019, TESOBE GmbH - ** - *This program is free software: you can redistribute it and/or modify - *it under the terms of the GNU Affero General Public License as published by - *the Free Software Foundation, either version 3 of the License, or - *(at your option) any later version. - ** - *This program is distributed in the hope that it will be useful, - *but WITHOUT ANY WARRANTY; without even the implied warranty of - *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - *GNU Affero General Public License for more details. - ** - *You should have received a copy of the GNU Affero General Public License - *along with this program. If not, see . - ** - *Email: contact@tesobe.com - *TESOBE GmbH - *Osloerstrasse 16/17 - *Berlin 13359, Germany - ** - *This product includes software developed at - *TESOBE (http://www.tesobe.com/) - * by - *Simon Redfern : simon AT tesobe DOT com - *Stefan Bethge : stefan AT tesobe DOT com - *Everett Sochowski : everett AT tesobe DOT com - *Ayoub Benali: ayoub AT tesobe DOT com - * - */ package code.api.UKOpenBanking.v3_1_0 import code.api.OBPRestHelper -import code.api.util.APIUtil.{OBPEndpoint, ResourceDoc, getAllowedEndpoints} +import code.api.util.APIUtil.{OBPEndpoint, ResourceDoc} import code.api.util.ScannedApis import code.util.Helper.MdcLoggable -import com.openbankproject.commons.util.{ApiVersion, ApiVersionStatus} +import com.openbankproject.commons.util.{ApiVersion, ApiVersionStatus, ScannedApiVersion} import scala.collection.mutable.ArrayBuffer - - - /* -This file defines which endpoints from all the versions are available in v1 + * All UK Open Banking v3.1 endpoints have been migrated to their respective + * Http4sUKOBv310* objects (all 20 categories, ~67 endpoints). + * + * This aggregator is retained for ScannedApis registration (class-path scanning) + * and so that external callers (APIUtil, SwaggerJSONFactory) that access + * OBP_UKOpenBanking_310.apiVersion / .allResourceDocs continue to compile. + * Routes are served by Http4sUKOBv310.wrappedRoutes in Http4sApp (ahead of the + * Lift bridge). */ object OBP_UKOpenBanking_310 extends OBPRestHelper with MdcLoggable with ScannedApis { - //please modify these three parameter if it is not correct. - override val apiVersion = ApiVersion.ukOpenBankingV31 - val versionStatus = ApiVersionStatus.DRAFT.toString - private[this] val endpoints = - APIMethods_AccountAccessApi.endpoints ++ - APIMethods_AccountsApi.endpoints ++ - APIMethods_BalancesApi.endpoints ++ - APIMethods_BeneficiariesApi.endpoints ++ - APIMethods_DirectDebitsApi.endpoints ++ - APIMethods_DomesticPaymentsApi.endpoints ++ - APIMethods_DomesticScheduledPaymentsApi.endpoints ++ - APIMethods_DomesticStandingOrdersApi.endpoints ++ - APIMethods_FilePaymentsApi.endpoints ++ - APIMethods_FundsConfirmationsApi.endpoints ++ - APIMethods_InternationalPaymentsApi.endpoints ++ - APIMethods_InternationalScheduledPaymentsApi.endpoints ++ - APIMethods_InternationalStandingOrdersApi.endpoints ++ - APIMethods_OffersApi.endpoints ++ - APIMethods_PartysApi.endpoints ++ - APIMethods_ProductsApi.endpoints ++ - APIMethods_ScheduledPaymentsApi.endpoints ++ - APIMethods_StandingOrdersApi.endpoints ++ - APIMethods_StatementsApi.endpoints ++ - APIMethods_TransactionsApi.endpoints + override val apiVersion: ScannedApiVersion = ApiVersion.ukOpenBankingV31 + val versionStatus: String = ApiVersionStatus.DRAFT.toString - override val allResourceDocs: ArrayBuffer[ResourceDoc] = - APIMethods_AccountAccessApi.resourceDocs ++ - APIMethods_AccountsApi.resourceDocs ++ - APIMethods_BalancesApi.resourceDocs ++ - APIMethods_BeneficiariesApi.resourceDocs ++ - APIMethods_DirectDebitsApi.resourceDocs ++ - APIMethods_DomesticPaymentsApi.resourceDocs ++ - APIMethods_DomesticScheduledPaymentsApi.resourceDocs ++ - APIMethods_DomesticStandingOrdersApi.resourceDocs ++ - APIMethods_FilePaymentsApi.resourceDocs ++ - APIMethods_FundsConfirmationsApi.resourceDocs ++ - APIMethods_InternationalPaymentsApi.resourceDocs ++ - APIMethods_InternationalScheduledPaymentsApi.resourceDocs ++ - APIMethods_InternationalStandingOrdersApi.resourceDocs ++ - APIMethods_OffersApi.resourceDocs ++ - APIMethods_PartysApi.resourceDocs ++ - APIMethods_ProductsApi.resourceDocs ++ - APIMethods_ScheduledPaymentsApi.resourceDocs ++ - APIMethods_StandingOrdersApi.resourceDocs ++ - APIMethods_StatementsApi.resourceDocs ++ - APIMethods_TransactionsApi.resourceDocs + override val allResourceDocs: ArrayBuffer[ResourceDoc] = Http4sUKOBv310.resourceDocs - // Filter the possible endpoints by the disabled / enabled Props settings and add them together - override val routes : List[OBPEndpoint] = getAllowedEndpoints(endpoints, allResourceDocs) - - // Make them available for use! - registerRoutes(routes, allResourceDocs, apiPrefix) - - logger.info(s"version $version has been run! There are ${routes.length} routes.") + override val routes: List[OBPEndpoint] = Nil } + +// ─── Original Lift aggregator (commented out) ──────────────────────────────── +// The 16 stub *Api.scala files (Products, Beneficiaries, DirectDebits, Offers, +// Partys, ScheduledPayments, StandingOrders, Statements, DomesticPayments, +// DomesticScheduledPayments, DomesticStandingOrders, FilePayments, +// FundsConfirmations, InternationalPayments, InternationalScheduledPayments, +// InternationalStandingOrders) have been commented out. Their endpoints are +// now served by the corresponding Http4sUKOBv310* objects. +// +// private[this] val endpoints = +// APIMethods_AccountAccessApi.endpoints ++ +// APIMethods_AccountsApi.endpoints ++ +// APIMethods_BalancesApi.endpoints ++ +// APIMethods_BeneficiariesApi.endpoints ++ +// APIMethods_DirectDebitsApi.endpoints ++ +// APIMethods_DomesticPaymentsApi.endpoints ++ +// APIMethods_DomesticScheduledPaymentsApi.endpoints ++ +// APIMethods_DomesticStandingOrdersApi.endpoints ++ +// APIMethods_FilePaymentsApi.endpoints ++ +// APIMethods_FundsConfirmationsApi.endpoints ++ +// APIMethods_InternationalPaymentsApi.endpoints ++ +// APIMethods_InternationalScheduledPaymentsApi.endpoints ++ +// APIMethods_InternationalStandingOrdersApi.endpoints ++ +// APIMethods_OffersApi.endpoints ++ +// APIMethods_PartysApi.endpoints ++ +// APIMethods_ProductsApi.endpoints ++ +// APIMethods_ScheduledPaymentsApi.endpoints ++ +// APIMethods_StandingOrdersApi.endpoints ++ +// APIMethods_StatementsApi.endpoints ++ +// APIMethods_TransactionsApi.endpoints +// +// override val allResourceDocs: ArrayBuffer[ResourceDoc] = +// APIMethods_AccountAccessApi.resourceDocs ++ +// APIMethods_AccountsApi.resourceDocs ++ +// APIMethods_BalancesApi.resourceDocs ++ +// APIMethods_BeneficiariesApi.resourceDocs ++ +// APIMethods_DirectDebitsApi.resourceDocs ++ +// APIMethods_DomesticPaymentsApi.resourceDocs ++ +// APIMethods_DomesticScheduledPaymentsApi.resourceDocs ++ +// APIMethods_DomesticStandingOrdersApi.resourceDocs ++ +// APIMethods_FilePaymentsApi.resourceDocs ++ +// APIMethods_FundsConfirmationsApi.resourceDocs ++ +// APIMethods_InternationalPaymentsApi.resourceDocs ++ +// APIMethods_InternationalScheduledPaymentsApi.resourceDocs ++ +// APIMethods_InternationalStandingOrdersApi.resourceDocs ++ +// APIMethods_OffersApi.resourceDocs ++ +// APIMethods_PartysApi.resourceDocs ++ +// APIMethods_ProductsApi.resourceDocs ++ +// APIMethods_ScheduledPaymentsApi.resourceDocs ++ +// APIMethods_StandingOrdersApi.resourceDocs ++ +// APIMethods_StatementsApi.resourceDocs ++ +// APIMethods_TransactionsApi.resourceDocs +// +// override val routes : List[OBPEndpoint] = getAllowedEndpoints(endpoints, allResourceDocs) +// registerRoutes(routes, allResourceDocs, apiPrefix) +// logger.info(s"version $version has been run! There are ${routes.length} routes.") diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/OffersApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/OffersApi.scala index 56b1ad4081..a4567846b6 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/OffersApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/OffersApi.scala @@ -1,298 +1,299 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_OffersApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - getAccountsAccountIdOffers :: - getOffers :: - Nil - - - resourceDocs += ResourceDoc( - getAccountsAccountIdOffers, - apiVersion, - nameOf(getAccountsAccountIdOffers), - "GET", - "/accounts/ACCOUNTID/offers", - "Get Offers", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Offer" : [ { - "OfferId" : "OfferId", - "AccountId" : { }, - "Description" : "Description", - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "Rate" : "Rate", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Fee" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Value" : 0, - "Term" : "Term", - "URL" : "URL", - "OfferType" : { } - }, { - "OfferId" : "OfferId", - "AccountId" : { }, - "Description" : "Description", - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "Rate" : "Rate", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Fee" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Value" : 0, - "Term" : "Term", - "URL" : "URL", - "OfferType" : { } - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Offers") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdOffers : OBPEndpoint = { - case "accounts" :: accountid:: "offers" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Offer" : [ { - "OfferId" : "OfferId", - "AccountId" : { }, - "Description" : "Description", - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "Rate" : "Rate", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Fee" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Value" : 0, - "Term" : "Term", - "URL" : "URL", - "OfferType" : { } - }, { - "OfferId" : "OfferId", - "AccountId" : { }, - "Description" : "Description", - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "Rate" : "Rate", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Fee" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Value" : 0, - "Term" : "Term", - "URL" : "URL", - "OfferType" : { } - } ] - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getOffers, - apiVersion, - nameOf(getOffers), - "GET", - "/offers", - "Get Offers", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Offer" : [ { - "OfferId" : "OfferId", - "AccountId" : { }, - "Description" : "Description", - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "Rate" : "Rate", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Fee" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Value" : 0, - "Term" : "Term", - "URL" : "URL", - "OfferType" : { } - }, { - "OfferId" : "OfferId", - "AccountId" : { }, - "Description" : "Description", - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "Rate" : "Rate", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Fee" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Value" : 0, - "Term" : "Term", - "URL" : "URL", - "OfferType" : { } - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Offers") :: apiTagMockedData :: Nil - ) - - lazy val getOffers : OBPEndpoint = { - case "offers" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Offer" : [ { - "OfferId" : "OfferId", - "AccountId" : { }, - "Description" : "Description", - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "Rate" : "Rate", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Fee" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Value" : 0, - "Term" : "Term", - "URL" : "URL", - "OfferType" : { } - }, { - "OfferId" : "OfferId", - "AccountId" : { }, - "Description" : "Description", - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "Rate" : "Rate", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Fee" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "Value" : 0, - "Term" : "Term", - "URL" : "URL", - "OfferType" : { } - } ] - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_OffersApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// getAccountsAccountIdOffers :: +// getOffers :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdOffers, +// apiVersion, +// nameOf(getAccountsAccountIdOffers), +// "GET", +// "/accounts/ACCOUNTID/offers", +// "Get Offers", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Offer" : [ { +// "OfferId" : "OfferId", +// "AccountId" : { }, +// "Description" : "Description", +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Rate" : "Rate", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Fee" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Value" : 0, +// "Term" : "Term", +// "URL" : "URL", +// "OfferType" : { } +// }, { +// "OfferId" : "OfferId", +// "AccountId" : { }, +// "Description" : "Description", +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Rate" : "Rate", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Fee" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Value" : 0, +// "Term" : "Term", +// "URL" : "URL", +// "OfferType" : { } +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Offers") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdOffers : OBPEndpoint = { +// case "accounts" :: accountid:: "offers" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Offer" : [ { +// "OfferId" : "OfferId", +// "AccountId" : { }, +// "Description" : "Description", +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Rate" : "Rate", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Fee" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Value" : 0, +// "Term" : "Term", +// "URL" : "URL", +// "OfferType" : { } +// }, { +// "OfferId" : "OfferId", +// "AccountId" : { }, +// "Description" : "Description", +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Rate" : "Rate", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Fee" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Value" : 0, +// "Term" : "Term", +// "URL" : "URL", +// "OfferType" : { } +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getOffers, +// apiVersion, +// nameOf(getOffers), +// "GET", +// "/offers", +// "Get Offers", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Offer" : [ { +// "OfferId" : "OfferId", +// "AccountId" : { }, +// "Description" : "Description", +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Rate" : "Rate", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Fee" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Value" : 0, +// "Term" : "Term", +// "URL" : "URL", +// "OfferType" : { } +// }, { +// "OfferId" : "OfferId", +// "AccountId" : { }, +// "Description" : "Description", +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Rate" : "Rate", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Fee" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Value" : 0, +// "Term" : "Term", +// "URL" : "URL", +// "OfferType" : { } +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Offers") :: apiTagMockedData :: Nil +// ) +// +// lazy val getOffers : OBPEndpoint = { +// case "offers" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Offer" : [ { +// "OfferId" : "OfferId", +// "AccountId" : { }, +// "Description" : "Description", +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Rate" : "Rate", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Fee" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Value" : 0, +// "Term" : "Term", +// "URL" : "URL", +// "OfferType" : { } +// }, { +// "OfferId" : "OfferId", +// "AccountId" : { }, +// "Description" : "Description", +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Rate" : "Rate", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Fee" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "Value" : 0, +// "Term" : "Term", +// "URL" : "URL", +// "OfferType" : { } +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/PartysApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/PartysApi.scala index f5222be85e..d235d9b32a 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/PartysApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/PartysApi.scala @@ -1,254 +1,255 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_PartysApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - getAccountsAccountIdParty :: - getParty :: - Nil - - - resourceDocs += ResourceDoc( - getAccountsAccountIdParty, - apiVersion, - nameOf(getAccountsAccountIdParty), - "GET", - "/accounts/ACCOUNTID/party", - "Get Party", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Party" : { - "PartyNumber" : "PartyNumber", - "PartyId" : "PartyId", - "Address" : [ { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "AddressType" : { }, - "PostCode" : "PostCode" - }, { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "AddressType" : { }, - "PostCode" : "PostCode" - } ], - "Phone" : "Phone", - "Mobile" : "Mobile", - "PartyType" : { }, - "EmailAddress" : "EmailAddress", - "Name" : "Name" - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Partys") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdParty : OBPEndpoint = { - case "accounts" :: accountid:: "party" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Party" : { - "PartyNumber" : "PartyNumber", - "PartyId" : "PartyId", - "Address" : [ { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "AddressType" : { }, - "PostCode" : "PostCode" - }, { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "AddressType" : { }, - "PostCode" : "PostCode" - } ], - "Phone" : "Phone", - "Mobile" : "Mobile", - "PartyType" : { }, - "EmailAddress" : "EmailAddress", - "Name" : "Name" - } - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getParty, - apiVersion, - nameOf(getParty), - "GET", - "/party", - "Get Party", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Party" : { - "PartyNumber" : "PartyNumber", - "PartyId" : "PartyId", - "Address" : [ { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "AddressType" : { }, - "PostCode" : "PostCode" - }, { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "AddressType" : { }, - "PostCode" : "PostCode" - } ], - "Phone" : "Phone", - "Mobile" : "Mobile", - "PartyType" : { }, - "EmailAddress" : "EmailAddress", - "Name" : "Name" - } - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Partys") :: apiTagMockedData :: Nil - ) - - lazy val getParty : OBPEndpoint = { - case "party" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Party" : { - "PartyNumber" : "PartyNumber", - "PartyId" : "PartyId", - "Address" : [ { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "AddressType" : { }, - "PostCode" : "PostCode" - }, { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "AddressType" : { }, - "PostCode" : "PostCode" - } ], - "Phone" : "Phone", - "Mobile" : "Mobile", - "PartyType" : { }, - "EmailAddress" : "EmailAddress", - "Name" : "Name" - } - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_PartysApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// getAccountsAccountIdParty :: +// getParty :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdParty, +// apiVersion, +// nameOf(getAccountsAccountIdParty), +// "GET", +// "/accounts/ACCOUNTID/party", +// "Get Party", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Party" : { +// "PartyNumber" : "PartyNumber", +// "PartyId" : "PartyId", +// "Address" : [ { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } ], +// "Phone" : "Phone", +// "Mobile" : "Mobile", +// "PartyType" : { }, +// "EmailAddress" : "EmailAddress", +// "Name" : "Name" +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Partys") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdParty : OBPEndpoint = { +// case "accounts" :: accountid:: "party" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Party" : { +// "PartyNumber" : "PartyNumber", +// "PartyId" : "PartyId", +// "Address" : [ { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } ], +// "Phone" : "Phone", +// "Mobile" : "Mobile", +// "PartyType" : { }, +// "EmailAddress" : "EmailAddress", +// "Name" : "Name" +// } +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getParty, +// apiVersion, +// nameOf(getParty), +// "GET", +// "/party", +// "Get Party", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Party" : { +// "PartyNumber" : "PartyNumber", +// "PartyId" : "PartyId", +// "Address" : [ { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } ], +// "Phone" : "Phone", +// "Mobile" : "Mobile", +// "PartyType" : { }, +// "EmailAddress" : "EmailAddress", +// "Name" : "Name" +// } +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Partys") :: apiTagMockedData :: Nil +// ) +// +// lazy val getParty : OBPEndpoint = { +// case "party" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Party" : { +// "PartyNumber" : "PartyNumber", +// "PartyId" : "PartyId", +// "Address" : [ { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// } ], +// "Phone" : "Phone", +// "Mobile" : "Mobile", +// "PartyType" : { }, +// "EmailAddress" : "EmailAddress", +// "Name" : "Name" +// } +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/ProductsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/ProductsApi.scala index 49f24147a8..8206ad1be9 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/ProductsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/ProductsApi.scala @@ -1,85 +1,86 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_ProductsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - getAccountsAccountIdProduct :: - getProducts :: - Nil - - - resourceDocs += ResourceDoc( - getAccountsAccountIdProduct, - apiVersion, - nameOf(getAccountsAccountIdProduct), - "GET", - "/accounts/ACCOUNTID/product", - "Get Products", - s"""${mockedDataText(true)}""", - EmptyBody, - EmptyBody, - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Products") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdProduct : OBPEndpoint = { - case "accounts" :: accountid:: "product" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (NotImplemented, callContext) - } - } - } - - resourceDocs += ResourceDoc( - getProducts, - apiVersion, - nameOf(getProducts), - "GET", - "/products", - "Get Products", - s"""${mockedDataText(true)} -""", - EmptyBody, - EmptyBody, - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Products") :: apiTagMockedData :: Nil - ) - - lazy val getProducts : OBPEndpoint = { - case "products" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (NotImplemented, callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_ProductsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// getAccountsAccountIdProduct :: +// getProducts :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdProduct, +// apiVersion, +// nameOf(getAccountsAccountIdProduct), +// "GET", +// "/accounts/ACCOUNTID/product", +// "Get Products", +// s"""${mockedDataText(true)}""", +// EmptyBody, +// EmptyBody, +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Products") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdProduct : OBPEndpoint = { +// case "accounts" :: accountid:: "product" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (NotImplemented, callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getProducts, +// apiVersion, +// nameOf(getProducts), +// "GET", +// "/products", +// "Get Products", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// EmptyBody, +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Products") :: apiTagMockedData :: Nil +// ) +// +// lazy val getProducts : OBPEndpoint = { +// case "products" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (NotImplemented, callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/ScheduledPaymentsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/ScheduledPaymentsApi.scala index b5e0bf1703..40aeb0c868 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/ScheduledPaymentsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/ScheduledPaymentsApi.scala @@ -1,306 +1,307 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_ScheduledPaymentsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - getAccountsAccountIdScheduledPayments :: - getScheduledPayments :: - Nil - - - resourceDocs += ResourceDoc( - getAccountsAccountIdScheduledPayments, - apiVersion, - nameOf(getAccountsAccountIdScheduledPayments), - "GET", - "/accounts/ACCOUNTID/scheduled-payments", - "Get Scheduled Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "ScheduledPayment" : [ { - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ScheduledPaymentId" : "ScheduledPaymentId", - "ScheduledType" : { } - }, { - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ScheduledPaymentId" : "ScheduledPaymentId", - "ScheduledType" : { } - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Scheduled Payments") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdScheduledPayments : OBPEndpoint = { - case "accounts" :: accountid:: "scheduled-payments" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "ScheduledPayment" : [ { - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ScheduledPaymentId" : "ScheduledPaymentId", - "ScheduledType" : { } - }, { - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ScheduledPaymentId" : "ScheduledPaymentId", - "ScheduledType" : { } - } ] - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getScheduledPayments, - apiVersion, - nameOf(getScheduledPayments), - "GET", - "/scheduled-payments", - "Get Scheduled Payments", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "ScheduledPayment" : [ { - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ScheduledPaymentId" : "ScheduledPaymentId", - "ScheduledType" : { } - }, { - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ScheduledPaymentId" : "ScheduledPaymentId", - "ScheduledType" : { } - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Scheduled Payments") :: apiTagMockedData :: Nil - ) - - lazy val getScheduledPayments : OBPEndpoint = { - case "scheduled-payments" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "ScheduledPayment" : [ { - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ScheduledPaymentId" : "ScheduledPaymentId", - "ScheduledType" : { } - }, { - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "Reference" : "Reference", - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "ScheduledPaymentId" : "ScheduledPaymentId", - "ScheduledType" : { } - } ] - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_ScheduledPaymentsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// getAccountsAccountIdScheduledPayments :: +// getScheduledPayments :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdScheduledPayments, +// apiVersion, +// nameOf(getAccountsAccountIdScheduledPayments), +// "GET", +// "/accounts/ACCOUNTID/scheduled-payments", +// "Get Scheduled Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "ScheduledPayment" : [ { +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ScheduledPaymentId" : "ScheduledPaymentId", +// "ScheduledType" : { } +// }, { +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ScheduledPaymentId" : "ScheduledPaymentId", +// "ScheduledType" : { } +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Scheduled Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdScheduledPayments : OBPEndpoint = { +// case "accounts" :: accountid:: "scheduled-payments" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "ScheduledPayment" : [ { +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ScheduledPaymentId" : "ScheduledPaymentId", +// "ScheduledType" : { } +// }, { +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ScheduledPaymentId" : "ScheduledPaymentId", +// "ScheduledType" : { } +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getScheduledPayments, +// apiVersion, +// nameOf(getScheduledPayments), +// "GET", +// "/scheduled-payments", +// "Get Scheduled Payments", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "ScheduledPayment" : [ { +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ScheduledPaymentId" : "ScheduledPaymentId", +// "ScheduledType" : { } +// }, { +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ScheduledPaymentId" : "ScheduledPaymentId", +// "ScheduledType" : { } +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Scheduled Payments") :: apiTagMockedData :: Nil +// ) +// +// lazy val getScheduledPayments : OBPEndpoint = { +// case "scheduled-payments" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "ScheduledPayment" : [ { +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ScheduledPaymentId" : "ScheduledPaymentId", +// "ScheduledType" : { } +// }, { +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "Reference" : "Reference", +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "ScheduledPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "ScheduledPaymentId" : "ScheduledPaymentId", +// "ScheduledType" : { } +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/StandingOrdersApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/StandingOrdersApi.scala index 4dc1409f00..989d41ee84 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/StandingOrdersApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/StandingOrdersApi.scala @@ -1,402 +1,403 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_StandingOrdersApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - getAccountsAccountIdStandingOrders :: - getStandingOrders :: - Nil - - - resourceDocs += ResourceDoc( - getAccountsAccountIdStandingOrders, - apiVersion, - nameOf(getAccountsAccountIdStandingOrders), - "GET", - "/accounts/ACCOUNTID/standing-orders", - "Get Standing Orders", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "StandingOrder" : [ { - "SupplementaryData" : { }, - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "StandingOrderId" : "StandingOrderId", - "Reference" : "Reference", - "StandingOrderStatusCode" : { }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NextPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "SupplementaryData" : { }, - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "StandingOrderId" : "StandingOrderId", - "Reference" : "Reference", - "StandingOrderStatusCode" : { }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NextPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Standing Orders") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdStandingOrders : OBPEndpoint = { - case "accounts" :: accountid:: "standing-orders" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "StandingOrder" : [ { - "SupplementaryData" : { }, - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "StandingOrderId" : "StandingOrderId", - "Reference" : "Reference", - "StandingOrderStatusCode" : { }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NextPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "SupplementaryData" : { }, - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "StandingOrderId" : "StandingOrderId", - "Reference" : "Reference", - "StandingOrderStatusCode" : { }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NextPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - } ] - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getStandingOrders, - apiVersion, - nameOf(getStandingOrders), - "GET", - "/standing-orders", - "Get Standing Orders", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "StandingOrder" : [ { - "SupplementaryData" : { }, - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "StandingOrderId" : "StandingOrderId", - "Reference" : "Reference", - "StandingOrderStatusCode" : { }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NextPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "SupplementaryData" : { }, - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "StandingOrderId" : "StandingOrderId", - "Reference" : "Reference", - "StandingOrderStatusCode" : { }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NextPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Standing Orders") :: apiTagMockedData :: Nil - ) - - lazy val getStandingOrders : OBPEndpoint = { - case "standing-orders" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "StandingOrder" : [ { - "SupplementaryData" : { }, - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "StandingOrderId" : "StandingOrderId", - "Reference" : "Reference", - "StandingOrderStatusCode" : { }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NextPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "SupplementaryData" : { }, - "CreditorAgent" : { - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification" - }, - "AccountId" : { }, - "StandingOrderId" : "StandingOrderId", - "Reference" : "Reference", - "StandingOrderStatusCode" : { }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "FirstPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "NextPaymentAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", - "Frequency" : "Frequency", - "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" - } ] - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_StandingOrdersApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// getAccountsAccountIdStandingOrders :: +// getStandingOrders :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdStandingOrders, +// apiVersion, +// nameOf(getAccountsAccountIdStandingOrders), +// "GET", +// "/accounts/ACCOUNTID/standing-orders", +// "Get Standing Orders", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "StandingOrder" : [ { +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "StandingOrderId" : "StandingOrderId", +// "Reference" : "Reference", +// "StandingOrderStatusCode" : { }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NextPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "StandingOrderId" : "StandingOrderId", +// "Reference" : "Reference", +// "StandingOrderStatusCode" : { }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NextPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Standing Orders") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdStandingOrders : OBPEndpoint = { +// case "accounts" :: accountid:: "standing-orders" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "StandingOrder" : [ { +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "StandingOrderId" : "StandingOrderId", +// "Reference" : "Reference", +// "StandingOrderStatusCode" : { }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NextPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "StandingOrderId" : "StandingOrderId", +// "Reference" : "Reference", +// "StandingOrderStatusCode" : { }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NextPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getStandingOrders, +// apiVersion, +// nameOf(getStandingOrders), +// "GET", +// "/standing-orders", +// "Get Standing Orders", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "StandingOrder" : [ { +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "StandingOrderId" : "StandingOrderId", +// "Reference" : "Reference", +// "StandingOrderStatusCode" : { }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NextPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "StandingOrderId" : "StandingOrderId", +// "Reference" : "Reference", +// "StandingOrderStatusCode" : { }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NextPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Standing Orders") :: apiTagMockedData :: Nil +// ) +// +// lazy val getStandingOrders : OBPEndpoint = { +// case "standing-orders" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "StandingOrder" : [ { +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "StandingOrderId" : "StandingOrderId", +// "Reference" : "Reference", +// "StandingOrderStatusCode" : { }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NextPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification" +// }, +// "AccountId" : { }, +// "StandingOrderId" : "StandingOrderId", +// "Reference" : "Reference", +// "StandingOrderStatusCode" : { }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "FirstPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "FinalPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "NextPaymentAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "NextPaymentDateTime" : "2000-01-23T04:56:07.000+00:00", +// "Frequency" : "Frequency", +// "FirstPaymentDateTime" : "2000-01-23T04:56:07.000+00:00" +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/StatementsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/StatementsApi.scala index 0ec509d248..5e66be73e3 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/StatementsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/StatementsApi.scala @@ -1,1759 +1,1760 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil._ -import code.api.util.ApiTag -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import com.github.dwickern.macros.NameOf.nameOf -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.immutable.Nil -import scala.collection.mutable.ArrayBuffer -import com.openbankproject.commons.ExecutionContext.Implicits.global - -object APIMethods_StatementsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - getAccountsAccountIdStatements :: - getAccountsAccountIdStatementsStatementId :: - getAccountsAccountIdStatementsStatementIdFile :: - getAccountsAccountIdStatementsStatementIdTransactions :: - getStatements :: - Nil - - - resourceDocs += ResourceDoc( - getAccountsAccountIdStatements, - apiVersion, - nameOf(getAccountsAccountIdStatements), - "GET", - "/accounts/ACCOUNTID/statements", - "Get Statements", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Statement" : [ { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - }, { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Statements") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdStatements : OBPEndpoint = { - case "accounts" :: accountid:: "statements" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Statement" : [ { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - }, { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - } ] - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getAccountsAccountIdStatementsStatementId, - apiVersion, - nameOf(getAccountsAccountIdStatementsStatementId), - "GET", - "/accounts/ACCOUNTID/statements/STATEMENTID", - "Get Statements", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Statement" : [ { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - }, { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Statements") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdStatementsStatementId : OBPEndpoint = { - case "accounts" :: accountid:: "statements" :: statementid :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Statement" : [ { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - }, { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - } ] - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getAccountsAccountIdStatementsStatementIdFile, - apiVersion, - nameOf(getAccountsAccountIdStatementsStatementIdFile), - "GET", - "/accounts/ACCOUNTID/statements/STATEMENTID/file", - "Get Statements", - s"""${mockedDataText(true)} -""", - EmptyBody, - EmptyBody, - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Statements") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdStatementsStatementIdFile : OBPEndpoint = { - case "accounts" :: accountid:: "statements" :: statementid:: "file" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (NotImplemented, callContext) - } - } - } - - resourceDocs += ResourceDoc( - getAccountsAccountIdStatementsStatementIdTransactions, - apiVersion, - nameOf(getAccountsAccountIdStatementsStatementIdTransactions), - "GET", - "/accounts/ACCOUNTID/statements/STATEMENTID/transactions", - "Get Transactions", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Transaction" : [ { - "Status" : { }, - "SupplementaryData" : { }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : { }, - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : { }, - "Identification" : "Identification", - "CardSchemeName" : { }, - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : { }, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - }, { - "Status" : { }, - "SupplementaryData" : { }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : { }, - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : { }, - "Identification" : "Identification", - "CardSchemeName" : { }, - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : { }, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Statements") ::ApiTag("Transactions") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdStatementsStatementIdTransactions : OBPEndpoint = { - case "accounts" :: accountid:: "statements" :: statementid:: "transactions" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Transaction" : [ { - "Status" : { }, - "SupplementaryData" : { }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : { }, - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : { }, - "Identification" : "Identification", - "CardSchemeName" : { }, - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : { }, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - }, { - "Status" : { }, - "SupplementaryData" : { }, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : { }, - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : { }, - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : { }, - "Identification" : "Identification", - "CardSchemeName" : { }, - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : { }, - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : { }, - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - } ] - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getStatements, - apiVersion, - nameOf(getStatements), - "GET", - "/statements", - "Get Statements", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Statement" : [ { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - }, { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Statements") :: apiTagMockedData :: Nil - ) - - lazy val getStatements : OBPEndpoint = { - case "statements" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime" : { }, - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Statement" : [ { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - }, { - "AccountId" : { }, - "StatementReference" : "StatementReference", - "StatementDateTime" : [ { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - }, { - "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], - "DateTime" : "2000-01-23T04:56:07.000+00:00" - } ], - "StatementInterest" : [ { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "Type" : { }, - "StartDateTime" : "2000-01-23T04:56:07.000+00:00", - "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementRate" : [ { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - }, { - "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], - "Rate" : "Rate" - } ], - "EndDateTime" : "2000-01-23T04:56:07.000+00:00", - "StatementId" : "StatementId", - "StatementValue" : [ { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - }, { - "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], - "Value" : 0 - } ], - "StatementBenefit" : [ { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - }, { - "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - } - } ], - "StatementFee" : [ { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ], - "StatementDescription" : [ "StatementDescription", "StatementDescription" ], - "StatementAmount" : [ { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - }, { - "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], - "Amount" : { - "Amount" : { }, - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } ] - } ] - } -}"""), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil._ +//import code.api.util.ApiTag +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import com.github.dwickern.macros.NameOf.nameOf +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.immutable.Nil +//import scala.collection.mutable.ArrayBuffer +//import com.openbankproject.commons.ExecutionContext.Implicits.global +// +//object APIMethods_StatementsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// getAccountsAccountIdStatements :: +// getAccountsAccountIdStatementsStatementId :: +// getAccountsAccountIdStatementsStatementIdFile :: +// getAccountsAccountIdStatementsStatementIdTransactions :: +// getStatements :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdStatements, +// apiVersion, +// nameOf(getAccountsAccountIdStatements), +// "GET", +// "/accounts/ACCOUNTID/statements", +// "Get Statements", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Statement" : [ { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// }, { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Statements") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdStatements : OBPEndpoint = { +// case "accounts" :: accountid:: "statements" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Statement" : [ { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// }, { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdStatementsStatementId, +// apiVersion, +// nameOf(getAccountsAccountIdStatementsStatementId), +// "GET", +// "/accounts/ACCOUNTID/statements/STATEMENTID", +// "Get Statements", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Statement" : [ { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// }, { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Statements") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdStatementsStatementId : OBPEndpoint = { +// case "accounts" :: accountid:: "statements" :: statementid :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Statement" : [ { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// }, { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdStatementsStatementIdFile, +// apiVersion, +// nameOf(getAccountsAccountIdStatementsStatementIdFile), +// "GET", +// "/accounts/ACCOUNTID/statements/STATEMENTID/file", +// "Get Statements", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// EmptyBody, +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Statements") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdStatementsStatementIdFile : OBPEndpoint = { +// case "accounts" :: accountid:: "statements" :: statementid:: "file" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (NotImplemented, callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdStatementsStatementIdTransactions, +// apiVersion, +// nameOf(getAccountsAccountIdStatementsStatementIdTransactions), +// "GET", +// "/accounts/ACCOUNTID/statements/STATEMENTID/transactions", +// "Get Transactions", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Transaction" : [ { +// "Status" : { }, +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : { }, +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : { }, +// "Identification" : "Identification", +// "CardSchemeName" : { }, +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : { }, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// }, { +// "Status" : { }, +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : { }, +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : { }, +// "Identification" : "Identification", +// "CardSchemeName" : { }, +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : { }, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Statements") ::ApiTag("Transactions") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdStatementsStatementIdTransactions : OBPEndpoint = { +// case "accounts" :: accountid:: "statements" :: statementid:: "transactions" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Transaction" : [ { +// "Status" : { }, +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : { }, +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : { }, +// "Identification" : "Identification", +// "CardSchemeName" : { }, +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : { }, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// }, { +// "Status" : { }, +// "SupplementaryData" : { }, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : { }, +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : { }, +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : { }, +// "Identification" : "Identification", +// "CardSchemeName" : { }, +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : { }, +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : { }, +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getStatements, +// apiVersion, +// nameOf(getStatements), +// "GET", +// "/statements", +// "Get Statements", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Statement" : [ { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// }, { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Statements") :: apiTagMockedData :: Nil +// ) +// +// lazy val getStatements : OBPEndpoint = { +// case "statements" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime" : { }, +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Statement" : [ { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// }, { +// "AccountId" : { }, +// "StatementReference" : "StatementReference", +// "StatementDateTime" : [ { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransferPromoEnd", "UK.OBIE.DirectDebitDue", "UK.OBIE.LastPayment", "UK.OBIE.LastStatement", "UK.OBIE.NextStatement", "UK.OBIE.PaymentDue", "UK.OBIE.PurchasePromoEnd", "UK.OBIE.StatementAvailable" ], +// "DateTime" : "2000-01-23T04:56:07.000+00:00" +// } ], +// "StatementInterest" : [ { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.BalanceTransfer", "UK.OBIE.Cash", "UK.OBIE.EstimatedNext", "UK.OBIE.Purchase", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "Type" : { }, +// "StartDateTime" : "2000-01-23T04:56:07.000+00:00", +// "CreationDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementRate" : [ { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// }, { +// "Type" : [ "UK.OBIE.AnnualBalanceTransfer", "UK.OBIE.AnnualBalanceTransferAfterPromo", "UK.OBIE.AnnualBalanceTransferPromo", "UK.OBIE.AnnualCash", "UK.OBIE.AnnualPurchase", "UK.OBIE.AnnualPurchaseAfterPromo", "UK.OBIE.AnnualPurchasePromo", "UK.OBIE.MonthlyBalanceTransfer", "UK.OBIE.MonthlyCash", "UK.OBIE.MonthlyPurchase" ], +// "Rate" : "Rate" +// } ], +// "EndDateTime" : "2000-01-23T04:56:07.000+00:00", +// "StatementId" : "StatementId", +// "StatementValue" : [ { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// }, { +// "Type" : [ "UK.OBIE.AirMilesPoints", "UK.OBIE.AirMilesPointsBalance", "UK.OBIE.Credits", "UK.OBIE.Debits", "UK.OBIE.HotelPoints", "UK.OBIE.HotelPointsBalance", "UK.OBIE.RetailShoppingPoints", "UK.OBIE.RetailShoppingPointsBalance" ], +// "Value" : 0 +// } ], +// "StatementBenefit" : [ { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// }, { +// "Type" : [ "UK.OBIE.Cashback", "UK.OBIE.Insurance", "UK.OBIE.TravelDiscount", "UK.OBIE.TravelInsurance" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// } +// } ], +// "StatementFee" : [ { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.Annual", "UK.OBIE.BalanceTransfer", "UK.OBIE.CashAdvance", "UK.OBIE.CashTransaction", "UK.OBIE.ForeignCashTransaction", "UK.OBIE.ForeignTransaction", "UK.OBIE.Gambling", "UK.OBIE.LatePayment", "UK.OBIE.MoneyTransfer", "UK.OBIE.Monthly", "UK.OBIE.Overlimit", "UK.OBIE.PostalOrder", "UK.OBIE.PrizeEntry", "UK.OBIE.StatementCopy", "UK.OBIE.Total" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ], +// "StatementDescription" : [ "StatementDescription", "StatementDescription" ], +// "StatementAmount" : [ { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// }, { +// "Type" : [ "UK.OBIE.ArrearsClosingBalance", "UK.OBIE.AvailableBalance", "UK.OBIE.AverageBalanceWhenInCredit", "UK.OBIE.AverageBalanceWhenInDebit", "UK.OBIE.AverageDailyBalance", "UK.OBIE.BalanceTransferClosingBalance", "UK.OBIE.CashClosingBalance", "UK.OBIE.ClosingBalance", "UK.OBIE.CreditLimit", "UK.OBIE.CurrentPayment", "UK.OBIE.DirectDebitPaymentDue", "UK.OBIE.FSCSInsurance", "UK.OBIE.MinimumPaymentDue", "UK.OBIE.PendingTransactionsBalance", "UK.OBIE.PreviousClosingBalance", "UK.OBIE.PreviousPayment", "UK.OBIE.PurchaseClosingBalance", "UK.OBIE.StartingBalance", "UK.OBIE.TotalAdjustments", "UK.OBIE.TotalCashAdvances", "UK.OBIE.TotalCharges", "UK.OBIE.TotalCredits", "UK.OBIE.TotalDebits", "UK.OBIE.TotalPurchases" ], +// "Amount" : { +// "Amount" : { }, +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } ] +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +//} +// +// +// +// \ No newline at end of file diff --git a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/TransactionsApi.scala b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/TransactionsApi.scala index 924cfa0b8a..765f496a60 100644 --- a/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/TransactionsApi.scala +++ b/obp-api/src/main/scala/code/api/UKOpenBanking/v3_1_0/TransactionsApi.scala @@ -1,1054 +1,1054 @@ -package code.api.UKOpenBanking.v3_1_0 - -import scala.language.implicitConversions -import code.api.berlin.group.v1_3.JvalueCaseClass -import code.api.util.APIUtil.{defaultBankId, _} -import code.api.util.ApiTag._ -import code.api.util.ErrorMessages._ -import code.api.util.newstyle.ViewNewStyle -import code.api.util.{ApiTag, NewStyle} -import code.api.{APIFailureNewStyle, Constant} -import code.bankconnectors.Connector -import code.model._ -import code.views.Views -import com.github.dwickern.macros.NameOf.nameOf -import com.openbankproject.commons.ExecutionContext.Implicits.global -import com.openbankproject.commons.model._ -import net.liftweb.common.Full -import net.liftweb.http.rest.RestHelper -import net.liftweb.json -import net.liftweb.json._ - -import scala.collection.mutable.ArrayBuffer -import scala.concurrent.Future - -object APIMethods_TransactionsApi extends RestHelper { - val apiVersion = OBP_UKOpenBanking_310.apiVersion - val resourceDocs = ArrayBuffer[ResourceDoc]() - val apiRelations = ArrayBuffer[ApiRelation]() - protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) - - val endpoints = - getAccountsAccountIdStatementsStatementIdTransactions :: - getAccountsAccountIdTransactions :: - getTransactions :: - Nil - - - resourceDocs += ResourceDoc( - getAccountsAccountIdStatementsStatementIdTransactions, - apiVersion, - nameOf(getAccountsAccountIdStatementsStatementIdTransactions), - "GET", - "/accounts/ACCOUNTID/statements/STATEMENTID/transactions", - "Get Transactions", - s"""${mockedDataText(true)} -""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime": "2019-03-06T07:38:51.169Z", - "LastAvailableDateTime": "2019-03-06T07:38:51.169Z" - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Transaction" : [ { - "Status" : "string", - "SupplementaryData" : {}, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : "string", - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : "string", - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : "string", - "Identification" : "Identification", - "CardSchemeName" : "string", - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : "string", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - }, { - "Status" : "string", - "SupplementaryData" : {}, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : "string", - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : "string", - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : "string", - "Identification" : "Identification", - "CardSchemeName" : "string", - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : "string", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Statements") ::ApiTag("Transactions") :: apiTagMockedData :: Nil - ) - - lazy val getAccountsAccountIdStatementsStatementIdTransactions : OBPEndpoint = { - case "accounts" :: accountid:: "statements" :: statementid:: "transactions" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - } yield { - (json.parse("""{ - "Meta" : { - "FirstAvailableDateTime": "2019-03-06T07:38:51.169Z", - "LastAvailableDateTime": "2019-03-06T07:38:51.169Z" - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Transaction" : [ { - "Status" : "string", - "SupplementaryData" : {}, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : "string", - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : "string", - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : "string", - "Identification" : "Identification", - "CardSchemeName" : "string", - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : "string", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - }, { - "Status" : "string", - "SupplementaryData" : {}, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : "string", - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : "string", - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : "string", - "Identification" : "Identification", - "CardSchemeName" : "string", - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : "string", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - } ] - } -}"""), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getAccountsAccountIdTransactions, - apiVersion, - nameOf(getAccountsAccountIdTransactions), - "GET", - "/accounts/ACCOUNT_ID/transactions", - "Get Transactions", - s"""""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime": "2019-03-06T07:38:51.169Z", - "LastAvailableDateTime": "2019-03-06T07:38:51.169Z" - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Transaction" : [ { - "Status" : "string", - "SupplementaryData" : {}, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : "string", - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : "string", - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : "string", - "Identification" : "Identification", - "CardSchemeName" : "string", - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : "string", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - }, { - "Status" : "string", - "SupplementaryData" : {}, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : "string", - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : "string", - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : "string", - "Identification" : "Identification", - "CardSchemeName" : "string", - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : "string", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Transactions") :: Nil - ) - - lazy val getAccountsAccountIdTransactions : OBPEndpoint = { - case "accounts" :: AccountId(accountId):: "transactions" :: Nil JsonGet _ => { - cc => - val detailViewId = ViewId(Constant.SYSTEM_READ_TRANSACTIONS_DETAIL_VIEW_ID) - val basicViewId = ViewId(Constant.SYSTEM_READ_TRANSACTIONS_BASIC_VIEW_ID) - for { - (Full(u), callContext) <- authenticatedAccess(cc) - _ <- NewStyle.function.checkUKConsent(u, callContext) - _ <- passesPsd2Aisp(callContext) - (account, callContext) <- NewStyle.function.getBankAccountByAccountId(accountId, callContext) - (bank, callContext) <- NewStyle.function.getBank(account.bankId, callContext) - view <- ViewNewStyle.checkViewsAccessAndReturnView(detailViewId, basicViewId, BankIdAccountId(account.bankId, accountId), Full(u), callContext) - params <- Future { createQueriesByHttpParams(callContext.get.requestHeaders)} map { - x => fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, callContext.map(_.toLight))) - } map { unboxFull(_) } - (transactions, callContext) <- account.getModeratedTransactionsFuture(bank, Full(u), view, callContext, params) map { - x => fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, callContext.map(_.toLight))) - } map { unboxFull(_) } - (moderatedAttributes: List[TransactionAttribute], callContext) <- NewStyle.function.getModeratedAttributesByTransactions( - account.bankId, - transactions.map(_.id), - view.viewId, - callContext) - } yield { - (JSONFactory_UKOpenBanking_310.createTransactionsJsonNew(account.bankId, transactions, moderatedAttributes, view), callContext) - } - } - } - - resourceDocs += ResourceDoc( - getTransactions, - apiVersion, - nameOf(getTransactions), - "GET", - "/transactions", - "Get Transactions", - s"""""", - EmptyBody, - json.parse("""{ - "Meta" : { - "FirstAvailableDateTime": "2019-03-06T07:38:51.169Z", - "LastAvailableDateTime": "2019-03-06T07:38:51.169Z" - "TotalPages" : 0 - }, - "Links" : { - "Last" : "http://example.com/aeiou", - "Prev" : "http://example.com/aeiou", - "Next" : "http://example.com/aeiou", - "Self" : "http://example.com/aeiou", - "First" : "http://example.com/aeiou" - }, - "Data" : { - "Transaction" : [ { - "Status" : "string", - "SupplementaryData" : {}, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : "string", - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : "string", - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : "string", - "Identification" : "Identification", - "CardSchemeName" : "string", - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : "string", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - }, { - "Status" : "string", - "SupplementaryData" : {}, - "CreditorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "DebtorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "AccountId" : "string", - "TransactionReference" : "TransactionReference", - "ProprietaryBankTransactionCode" : { - "Issuer" : "Issuer", - "Code" : "Code" - }, - "AddressLine" : "AddressLine", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditorAccount" : { - "SecondaryIdentification" : "SecondaryIdentification", - "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "CreditDebitIndicator" : "Credit", - "CurrencyExchange" : { - "SourceCurrency" : "SourceCurrency", - "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, - "QuotationDate" : "2000-01-23T04:56:07.000+00:00", - "UnitCurrency" : "UnitCurrency", - "ContractIdentification" : "ContractIdentification", - "InstructedAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TargetCurrency" : "TargetCurrency" - }, - "StatementReference" : [ "StatementReference", "StatementReference" ], - "ChargeAmount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "TransactionId" : "TransactionId", - "TransactionInformation" : "string", - "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", - "BankTransactionCode" : { - "SubCode" : "SubCode", - "Code" : "Code" - }, - "MerchantDetails" : { - "MerchantName" : "MerchantName", - "MerchantCategoryCode" : "MerchantCategoryCode" - }, - "CardInstrument" : { - "AuthorisationType" : "string", - "Identification" : "Identification", - "CardSchemeName" : "string", - "Name" : "Name" - }, - "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", - "DebtorAgent" : { - "PostalAddress" : { - "StreetName" : "StreetName", - "CountrySubDivision" : "CountrySubDivision", - "Department" : "Department", - "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], - "BuildingNumber" : "BuildingNumber", - "TownName" : "TownName", - "Country" : "Country", - "SubDepartment" : "SubDepartment", - "AddressType" : "string", - "PostCode" : "PostCode" - }, - "SchemeName" : [ "UK.OBIE.BICFI" ], - "Identification" : "Identification", - "Name" : "Name" - }, - "Balance" : { - "Type" : "string", - "Amount" : { - "Amount" : "string", - "Currency" : "Currency" - }, - "CreditDebitIndicator" : "Credit" - } - } ] - } -}"""), - List(AuthenticatedUserIsRequired, UnknownError), - ApiTag("Transactions") :: Nil - ) - - lazy val getTransactions : OBPEndpoint = { - case "transactions" :: Nil JsonGet _ => { - cc => - for { - (Full(u), callContext) <- authenticatedAccess(cc) - - (bank, callContext) <- NewStyle.function.getBank(BankId(defaultBankId), callContext) - - availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) - - (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) - - transactionAndTransactionRequestTuple = for{ - bankAccount <- accounts - } yield{ - for{ - view <- u.checkOwnerViewAccessAndReturnOwnerView(BankIdAccountId(bankAccount.bankId, bankAccount.accountId), callContext) - params <- createQueriesByHttpParams(callContext.get.requestHeaders) - (transactionRequests, callContext) <- Connector.connector.vend.getTransactionRequests210(u, bankAccount, callContext) - (transactions, callContext) <- bankAccount.getModeratedTransactions(bank, Full(u), view, BankIdAccountId(bankAccount.bankId, bankAccount.accountId), callContext, params) - } yield{ - (transactionRequests,transactions) - } - } - //TODO, need to try the error handling here... - transactionRequests = transactionAndTransactionRequestTuple.map(_.map(_._1)).flatten.flatten - transactions= transactionAndTransactionRequestTuple.map(_.map(_._2)).flatten.flatten - - } yield { - (JSONFactory_UKOpenBanking_310.createTransactionsJson(transactions, transactionRequests), callContext) - } - } - } - -} - - - +//package code.api.UKOpenBanking.v3_1_0 +// +//import scala.language.implicitConversions +//import code.api.berlin.group.v1_3.JvalueCaseClass +//import code.api.util.APIUtil.{defaultBankId, _} +//import code.api.util.ApiTag._ +//import code.api.util.ErrorMessages._ +//import code.api.util.newstyle.ViewNewStyle +//import code.api.util.{ApiTag, NewStyle} +//import code.api.{APIFailureNewStyle, Constant} +//import code.bankconnectors.Connector +//import code.model._ +//import code.views.Views +//import com.github.dwickern.macros.NameOf.nameOf +//import com.openbankproject.commons.ExecutionContext.Implicits.global +//import com.openbankproject.commons.model._ +//import net.liftweb.common.Full +//import net.liftweb.http.rest.RestHelper +//import net.liftweb.json +//import net.liftweb.json._ +// +//import scala.collection.mutable.ArrayBuffer +//import scala.concurrent.Future +// +//object APIMethods_TransactionsApi extends RestHelper { +// val apiVersion = OBP_UKOpenBanking_310.apiVersion +// val resourceDocs = ArrayBuffer[ResourceDoc]() +// val apiRelations = ArrayBuffer[ApiRelation]() +// protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what) +// +// val endpoints = +// getAccountsAccountIdStatementsStatementIdTransactions :: +// getAccountsAccountIdTransactions :: +// getTransactions :: +// Nil +// +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdStatementsStatementIdTransactions, +// apiVersion, +// nameOf(getAccountsAccountIdStatementsStatementIdTransactions), +// "GET", +// "/accounts/ACCOUNTID/statements/STATEMENTID/transactions", +// "Get Transactions", +// s"""${mockedDataText(true)} +//""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime": "2019-03-06T07:38:51.169Z", +// "LastAvailableDateTime": "2019-03-06T07:38:51.169Z" +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Transaction" : [ { +// "Status" : "string", +// "SupplementaryData" : {}, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : "string", +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : "string", +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : "string", +// "Identification" : "Identification", +// "CardSchemeName" : "string", +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : "string", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// }, { +// "Status" : "string", +// "SupplementaryData" : {}, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : "string", +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : "string", +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : "string", +// "Identification" : "Identification", +// "CardSchemeName" : "string", +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : "string", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Statements") ::ApiTag("Transactions") :: apiTagMockedData :: Nil +// ) +// +// lazy val getAccountsAccountIdStatementsStatementIdTransactions : OBPEndpoint = { +// case "accounts" :: accountid:: "statements" :: statementid:: "transactions" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// } yield { +// (json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime": "2019-03-06T07:38:51.169Z", +// "LastAvailableDateTime": "2019-03-06T07:38:51.169Z" +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Transaction" : [ { +// "Status" : "string", +// "SupplementaryData" : {}, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : "string", +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : "string", +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : "string", +// "Identification" : "Identification", +// "CardSchemeName" : "string", +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : "string", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// }, { +// "Status" : "string", +// "SupplementaryData" : {}, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : "string", +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : "string", +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : "string", +// "Identification" : "Identification", +// "CardSchemeName" : "string", +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : "string", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// } ] +// } +//}"""), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getAccountsAccountIdTransactions, +// apiVersion, +// nameOf(getAccountsAccountIdTransactions), +// "GET", +// "/accounts/ACCOUNT_ID/transactions", +// "Get Transactions", +// s"""""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime": "2019-03-06T07:38:51.169Z", +// "LastAvailableDateTime": "2019-03-06T07:38:51.169Z" +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Transaction" : [ { +// "Status" : "string", +// "SupplementaryData" : {}, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : "string", +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : "string", +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : "string", +// "Identification" : "Identification", +// "CardSchemeName" : "string", +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : "string", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// }, { +// "Status" : "string", +// "SupplementaryData" : {}, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : "string", +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : "string", +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : "string", +// "Identification" : "Identification", +// "CardSchemeName" : "string", +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : "string", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Transactions") :: Nil +// ) +// +// lazy val getAccountsAccountIdTransactions : OBPEndpoint = { +// case "accounts" :: AccountId(accountId):: "transactions" :: Nil JsonGet _ => { +// cc => +// val detailViewId = ViewId(Constant.SYSTEM_READ_TRANSACTIONS_DETAIL_VIEW_ID) +// val basicViewId = ViewId(Constant.SYSTEM_READ_TRANSACTIONS_BASIC_VIEW_ID) +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// _ <- NewStyle.function.checkUKConsent(u, callContext) +// _ <- passesPsd2Aisp(callContext) +// (account, callContext) <- NewStyle.function.getBankAccountByAccountId(accountId, callContext) +// (bank, callContext) <- NewStyle.function.getBank(account.bankId, callContext) +// view <- ViewNewStyle.checkViewsAccessAndReturnView(detailViewId, basicViewId, BankIdAccountId(account.bankId, accountId), Full(u), callContext) +// params <- Future { createQueriesByHttpParams(callContext.get.requestHeaders)} map { +// x => fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, callContext.map(_.toLight))) +// } map { unboxFull(_) } +// (transactions, callContext) <- account.getModeratedTransactionsFuture(bank, Full(u), view, callContext, params) map { +// x => fullBoxOrException(x ~> APIFailureNewStyle(UnknownError, 400, callContext.map(_.toLight))) +// } map { unboxFull(_) } +// (moderatedAttributes: List[TransactionAttribute], callContext) <- NewStyle.function.getModeratedAttributesByTransactions( +// account.bankId, +// transactions.map(_.id), +// view.viewId, +// callContext) +// } yield { +// (JSONFactory_UKOpenBanking_310.createTransactionsJsonNew(account.bankId, transactions, moderatedAttributes, view), callContext) +// } +// } +// } +// +// resourceDocs += ResourceDoc( +// getTransactions, +// apiVersion, +// nameOf(getTransactions), +// "GET", +// "/transactions", +// "Get Transactions", +// s"""""", +// EmptyBody, +// json.parse("""{ +// "Meta" : { +// "FirstAvailableDateTime": "2019-03-06T07:38:51.169Z", +// "LastAvailableDateTime": "2019-03-06T07:38:51.169Z" +// "TotalPages" : 0 +// }, +// "Links" : { +// "Last" : "http://example.com/aeiou", +// "Prev" : "http://example.com/aeiou", +// "Next" : "http://example.com/aeiou", +// "Self" : "http://example.com/aeiou", +// "First" : "http://example.com/aeiou" +// }, +// "Data" : { +// "Transaction" : [ { +// "Status" : "string", +// "SupplementaryData" : {}, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : "string", +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : "string", +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : "string", +// "Identification" : "Identification", +// "CardSchemeName" : "string", +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : "string", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// }, { +// "Status" : "string", +// "SupplementaryData" : {}, +// "CreditorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "DebtorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "AccountId" : "string", +// "TransactionReference" : "TransactionReference", +// "ProprietaryBankTransactionCode" : { +// "Issuer" : "Issuer", +// "Code" : "Code" +// }, +// "AddressLine" : "AddressLine", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditorAccount" : { +// "SecondaryIdentification" : "SecondaryIdentification", +// "SchemeName" : [ "UK.OBIE.BBAN", "UK.OBIE.IBAN", "UK.OBIE.PAN", "UK.OBIE.Paym", "UK.OBIE.SortCodeAccountNumber" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "CreditDebitIndicator" : "Credit", +// "CurrencyExchange" : { +// "SourceCurrency" : "SourceCurrency", +// "ExchangeRate" : 0.80082819046101150206595775671303272247314453125, +// "QuotationDate" : "2000-01-23T04:56:07.000+00:00", +// "UnitCurrency" : "UnitCurrency", +// "ContractIdentification" : "ContractIdentification", +// "InstructedAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TargetCurrency" : "TargetCurrency" +// }, +// "StatementReference" : [ "StatementReference", "StatementReference" ], +// "ChargeAmount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "TransactionId" : "TransactionId", +// "TransactionInformation" : "string", +// "BookingDateTime" : "2000-01-23T04:56:07.000+00:00", +// "BankTransactionCode" : { +// "SubCode" : "SubCode", +// "Code" : "Code" +// }, +// "MerchantDetails" : { +// "MerchantName" : "MerchantName", +// "MerchantCategoryCode" : "MerchantCategoryCode" +// }, +// "CardInstrument" : { +// "AuthorisationType" : "string", +// "Identification" : "Identification", +// "CardSchemeName" : "string", +// "Name" : "Name" +// }, +// "ValueDateTime" : "2000-01-23T04:56:07.000+00:00", +// "DebtorAgent" : { +// "PostalAddress" : { +// "StreetName" : "StreetName", +// "CountrySubDivision" : "CountrySubDivision", +// "Department" : "Department", +// "AddressLine" : [ "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine", "AddressLine" ], +// "BuildingNumber" : "BuildingNumber", +// "TownName" : "TownName", +// "Country" : "Country", +// "SubDepartment" : "SubDepartment", +// "AddressType" : "string", +// "PostCode" : "PostCode" +// }, +// "SchemeName" : [ "UK.OBIE.BICFI" ], +// "Identification" : "Identification", +// "Name" : "Name" +// }, +// "Balance" : { +// "Type" : "string", +// "Amount" : { +// "Amount" : "string", +// "Currency" : "Currency" +// }, +// "CreditDebitIndicator" : "Credit" +// } +// } ] +// } +//}"""), +// List(AuthenticatedUserIsRequired, UnknownError), +// ApiTag("Transactions") :: Nil +// ) +// +// lazy val getTransactions : OBPEndpoint = { +// case "transactions" :: Nil JsonGet _ => { +// cc => +// for { +// (Full(u), callContext) <- authenticatedAccess(cc) +// +// (bank, callContext) <- NewStyle.function.getBank(BankId(defaultBankId), callContext) +// +// availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u) +// +// (accounts, callContext)<- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext) +// +// transactionAndTransactionRequestTuple = for{ +// bankAccount <- accounts +// } yield{ +// for{ +// view <- u.checkOwnerViewAccessAndReturnOwnerView(BankIdAccountId(bankAccount.bankId, bankAccount.accountId), callContext) +// params <- createQueriesByHttpParams(callContext.get.requestHeaders) +// (transactionRequests, callContext) <- Connector.connector.vend.getTransactionRequests210(u, bankAccount, callContext) +// (transactions, callContext) <- bankAccount.getModeratedTransactions(bank, Full(u), view, BankIdAccountId(bankAccount.bankId, bankAccount.accountId), callContext, params) +// } yield{ +// (transactionRequests,transactions) +// } +// } +// //TODO, need to try the error handling here... +// transactionRequests = transactionAndTransactionRequestTuple.map(_.map(_._1)).flatten.flatten +// transactions= transactionAndTransactionRequestTuple.map(_.map(_._2)).flatten.flatten +// +// } yield { +// (JSONFactory_UKOpenBanking_310.createTransactionsJson(transactions, transactionRequests), callContext) +// } +// } +// } +// +//} +// +// +// diff --git a/obp-api/src/main/scala/code/api/util/http4s/Http4sApp.scala b/obp-api/src/main/scala/code/api/util/http4s/Http4sApp.scala index 93622dd0bc..e6d6b81a9d 100644 --- a/obp-api/src/main/scala/code/api/util/http4s/Http4sApp.scala +++ b/obp-api/src/main/scala/code/api/util/http4s/Http4sApp.scala @@ -78,6 +78,12 @@ object Http4sApp { // OBPAPIDynamicEntity dispatch. dynamic-endpoint (proxy + compiled resource docs) is a // separate task and still falls through to the Lift bridge. private val dynamicEntityRoutes: HttpRoutes[IO] = gate(ApiVersion.`dynamic-entity`, code.api.dynamic.entity.Http4sDynamicEntity.wrappedRoutesDynamicEntity) + // UK Open Banking (non-/obp prefixes /open-banking/v2.0 and /open-banking/v3.1) — native + // http4s, replaces the classpath-scanned Lift ScannedApis. All endpoints (v2.0: 5, v3.1: ~67) + // are migrated to http4s; the Lift ScannedApis aggregators register `routes = Nil`, so Lift + // serves no UK path. Wired before the Lift bridge for ordering, but nothing falls through to it. + private val ukV20Routes: HttpRoutes[IO] = gate(ApiVersion.ukOpenBankingV20, code.api.UKOpenBanking.v2_0_0.Http4sUKOBv200.wrappedRoutes) + private val ukV31Routes: HttpRoutes[IO] = gate(ApiVersion.ukOpenBankingV31, code.api.UKOpenBanking.v3_1_0.Http4sUKOBv310.wrappedRoutes) /** * Build the base HTTP4S routes with priority-based routing. @@ -122,6 +128,8 @@ object Http4sApp { .orElse(v500Routes.run(req)) .orElse(v700Routes.run(req)) .orElse(code.api.berlin.group.v2.Http4sBGv2.wrappedRoutes.run(req)) + .orElse(ukV20Routes.run(req)) + .orElse(ukV31Routes.run(req)) .orElse(v400Routes.run(req)) .orElse(v310Routes.run(req)) .orElse(v300Routes.run(req)) diff --git a/obp-api/src/test/scala/code/api/UKOpenBanking/v2_0_0/UKOpenBankingV200Tests.scala b/obp-api/src/test/scala/code/api/UKOpenBanking/v2_0_0/UKOpenBankingV200Tests.scala index 82c806ba06..6122a7e10a 100644 --- a/obp-api/src/test/scala/code/api/UKOpenBanking/v2_0_0/UKOpenBankingV200Tests.scala +++ b/obp-api/src/test/scala/code/api/UKOpenBanking/v2_0_0/UKOpenBankingV200Tests.scala @@ -6,26 +6,58 @@ import code.setup.{APIResponse, DefaultUsers} import org.scalatest.Tag class UKOpenBankingV200Tests extends UKOpenBankingV200ServerSetup with DefaultUsers { - + object UKOpenBankingV200 extends Tag("UKOpenBankingV200") - - feature("test the UKOpenBankingV200 GET Account List") + + feature("test the UKOpenBankingV200 GET Account List") { - scenario("Successful Case", UKOpenBankingV200) + scenario("Successful Case", UKOpenBankingV200) { val requestGetAll = (UKOpenBankingV200Request / "accounts" ).GET <@(user1) val response: APIResponse = makeGetRequest(requestGetAll) - + Then("We should get a 200 ") response.code should equal(200) val accounts = response.body.extract[Accounts] accounts.Links.Self contains ("open-banking/v2.0/accounts") should be (true) } + + scenario("Unauthenticated access is rejected", UKOpenBankingV200) + { + val requestGetAll = (UKOpenBankingV200Request / "accounts" ).GET + val response: APIResponse = makeGetRequest(requestGetAll) + + Then("We should get a 401 ") + response.code should equal(401) + } } - - feature("test the UKOpenBankingV200 Get Account Balances") + + feature("test the UKOpenBankingV200 GET Account") { - scenario("Successful Case", UKOpenBankingV200) + scenario("Successful Case", UKOpenBankingV200) + { + val requestGetAll = (UKOpenBankingV200Request / "accounts" / testAccountId1.value ).GET <@(user1) + val response: APIResponse = makeGetRequest(requestGetAll) + + Then("We should get a 200 ") + response.code should equal(200) + val accounts = response.body.extract[Accounts] + accounts.Links.Self contains ("open-banking/v2.0/accounts") should be (true) + } + + scenario("Unauthenticated access is rejected", UKOpenBankingV200) + { + val requestGetAll = (UKOpenBankingV200Request / "accounts" / testAccountId1.value ).GET + val response: APIResponse = makeGetRequest(requestGetAll) + + Then("We should get a 401 ") + response.code should equal(401) + } + } + + feature("test the UKOpenBankingV200 Get Account Balances") + { + scenario("Successful Case", UKOpenBankingV200) { val requestGetAll = (UKOpenBankingV200Request / "accounts"/ testAccountId1.value /"balances" ).GET <@(user1) val response = makeGetRequest(requestGetAll) @@ -34,38 +66,65 @@ class UKOpenBankingV200Tests extends UKOpenBankingV200ServerSetup with DefaultUs response.code should equal(200) val accountBalancesUKV200 = response.body.extract[AccountBalancesUKV200] accountBalancesUKV200.Links.Self contains("balances") - + + } + + scenario("Unauthenticated access is rejected", UKOpenBankingV200) + { + val requestGetAll = (UKOpenBankingV200Request / "accounts"/ testAccountId1.value /"balances" ).GET + val response = makeGetRequest(requestGetAll) + + Then("We should get a 401 ") + response.code should equal(401) } } - + feature("test the UKOpenBankingV200 Get Balances") { scenario("Successful Case", UKOpenBankingV200) { val requestGetAll = (UKOpenBankingV200Request / "balances" ).GET <@(user1) val response = makeGetRequest(requestGetAll) - + Then("We should get a 200 ") response.code should equal(200) val accountBalancesUKV200 = response.body.extract[AccountBalancesUKV200] accountBalancesUKV200.Links.Self contains("balances") - + + } + + scenario("Unauthenticated access is rejected", UKOpenBankingV200) + { + val requestGetAll = (UKOpenBankingV200Request / "balances" ).GET + val response = makeGetRequest(requestGetAll) + + Then("We should get a 401 ") + response.code should equal(401) } } - - feature("test the UKOpenBankingV200 GET Account Transactions") + + feature("test the UKOpenBankingV200 GET Account Transactions") { scenario("Successful Case", UKOpenBankingV200) { val requestGetAll = (UKOpenBankingV200Request / "accounts"/ testAccountId1.value /"transactions" ).GET <@(user1) val response = makeGetRequest(requestGetAll) - + Then("We should get a 200 ") response.code should equal(200) - + val transactionsJsonUKV200 = response.body.extract[TransactionsJsonUKV200] transactionsJsonUKV200.Links.Self contains("Transactions") } + + scenario("Unauthenticated access is rejected", UKOpenBankingV200) + { + val requestGetAll = (UKOpenBankingV200Request / "accounts"/ testAccountId1.value /"transactions" ).GET + val response = makeGetRequest(requestGetAll) + + Then("We should get a 401 ") + response.code should equal(401) + } } - -} \ No newline at end of file + +} diff --git a/obp-api/src/test/scala/code/api/UKOpenBanking/v3_1_0/UKOpenBankingV310AisTests.scala b/obp-api/src/test/scala/code/api/UKOpenBanking/v3_1_0/UKOpenBankingV310AisTests.scala new file mode 100644 index 0000000000..e369ca5706 --- /dev/null +++ b/obp-api/src/test/scala/code/api/UKOpenBanking/v3_1_0/UKOpenBankingV310AisTests.scala @@ -0,0 +1,281 @@ +package code.api.UKOpenBanking.v3_1_0 + +import org.scalatest.Tag + +/** + * UK Open Banking v3.1 — AIS (Account Information) family. + * + * Each endpoint gets two scenarios: + * - authenticated -> the success status the Lift handler currently returns + * - unauthenticated -> 401 (every handler calls authenticatedAccess / + * applicationAccess) + * + * Endpoints whose authenticated status depends on runtime data (UK consent, + * existing consent id, account access) are marked DATA-DEPENDENT; their authed + * assertion is calibrated against the Lift baseline in Phase 1. + */ +class UKOpenBankingV310AisTests extends UKOpenBankingV310ServerSetup { + + object UKOpenBankingV310 extends Tag("UKOpenBankingV310") + + val acc = testAccountId1.value + + // ── AccountAccessApi ─────────────────────────────────────────────── + feature("UKOB v3.1 POST /account-access-consents") { + scenario("authenticated", UKOpenBankingV310) { + // DATA-DEPENDENT: applicationAccess + ConsentPostBodyUKV310 body parse (201 on success) + postAuthed("{}", "account-access-consents").code should not equal (401) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + postUnauthed("{}", "account-access-consents").code should equal(401) + } + } + feature("UKOB v3.1 DELETE /account-access-consents/CONSENT_ID") { + scenario("authenticated", UKOpenBankingV310) { + // DATA-DEPENDENT: real consent lookup (204 on success) + deleteAuthed("account-access-consents", "fake-consent-id").code should not equal (401) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + deleteUnauthed("account-access-consents", "fake-consent-id").code should equal(401) + } + } + feature("UKOB v3.1 GET /account-access-consents/CONSENT_ID") { + scenario("authenticated", UKOpenBankingV310) { + // DATA-DEPENDENT: real consent JWT lookup + getAuthed("account-access-consents", "fake-consent-id").code should not equal (401) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("account-access-consents", "fake-consent-id").code should equal(401) + } + } + + // ── AccountsApi ──────────────────────────────────────────────────── + feature("UKOB v3.1 GET /accounts") { + scenario("authenticated", UKOpenBankingV310) { + // DATA-DEPENDENT: checkUKConsent + passesPsd2Aisp + getAuthed("accounts").code should not equal (401) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts").code should equal(401) + } + } + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID") { + scenario("authenticated", UKOpenBankingV310) { + // DATA-DEPENDENT: real account/view lookup + getAuthed("accounts", acc).code should not equal (401) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc).code should equal(401) + } + } + + // ── BalancesApi ──────────────────────────────────────────────────── + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/balances") { + scenario("authenticated", UKOpenBankingV310) { + // DATA-DEPENDENT: checkUKConsent + passesPsd2Aisp + getAuthed("accounts", acc, "balances").code should not equal (401) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "balances").code should equal(401) + } + } + feature("UKOB v3.1 GET /balances") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("balances").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("balances").code should equal(401) + } + } + + // ── BeneficiariesApi ─────────────────────────────────────────────── + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/beneficiaries") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("accounts", acc, "beneficiaries").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "beneficiaries").code should equal(401) + } + } + feature("UKOB v3.1 GET /beneficiaries") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("beneficiaries").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("beneficiaries").code should equal(401) + } + } + + // ── DirectDebitsApi ──────────────────────────────────────────────── + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/direct-debits") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("accounts", acc, "direct-debits").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "direct-debits").code should equal(401) + } + } + feature("UKOB v3.1 GET /direct-debits") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("direct-debits").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("direct-debits").code should equal(401) + } + } + + // ── OffersApi ────────────────────────────────────────────────────── + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/offers") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("accounts", acc, "offers").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "offers").code should equal(401) + } + } + feature("UKOB v3.1 GET /offers") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("offers").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("offers").code should equal(401) + } + } + + // ── PartysApi ────────────────────────────────────────────────────── + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/party") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("accounts", acc, "party").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "party").code should equal(401) + } + } + feature("UKOB v3.1 GET /party") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("party").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("party").code should equal(401) + } + } + + // ── ProductsApi ──────────────────────────────────────────────────── + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/product") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("accounts", acc, "product").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "product").code should equal(401) + } + } + feature("UKOB v3.1 GET /products") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("products").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("products").code should equal(401) + } + } + + // ── ScheduledPaymentsApi ─────────────────────────────────────────── + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/scheduled-payments") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("accounts", acc, "scheduled-payments").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "scheduled-payments").code should equal(401) + } + } + feature("UKOB v3.1 GET /scheduled-payments") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("scheduled-payments").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("scheduled-payments").code should equal(401) + } + } + + // ── StandingOrdersApi ────────────────────────────────────────────── + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/standing-orders") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("accounts", acc, "standing-orders").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "standing-orders").code should equal(401) + } + } + feature("UKOB v3.1 GET /standing-orders") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("standing-orders").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("standing-orders").code should equal(401) + } + } + + // ── StatementsApi ────────────────────────────────────────────────── + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/statements") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("accounts", acc, "statements").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "statements").code should equal(401) + } + } + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/statements/STATEMENT_ID") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("accounts", acc, "statements", "fake-statement-id").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "statements", "fake-statement-id").code should equal(401) + } + } + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/statements/STATEMENT_ID/file") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("accounts", acc, "statements", "fake-statement-id", "file").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "statements", "fake-statement-id", "file").code should equal(401) + } + } + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/statements/STATEMENT_ID/transactions") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("accounts", acc, "statements", "fake-statement-id", "transactions").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "statements", "fake-statement-id", "transactions").code should equal(401) + } + } + feature("UKOB v3.1 GET /statements") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("statements").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("statements").code should equal(401) + } + } + + // ── TransactionsApi ──────────────────────────────────────────────── + // Note: GET /accounts/ID/statements/ID/transactions is also registered by + // TransactionsApi (duplicate of StatementsApi route); Lift serves the first + // registered (Statements). Tested once above. + feature("UKOB v3.1 GET /accounts/ACCOUNT_ID/transactions") { + scenario("authenticated", UKOpenBankingV310) { + // DATA-DEPENDENT: checkUKConsent + passesPsd2Aisp + getAuthed("accounts", acc, "transactions").code should not equal (401) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("accounts", acc, "transactions").code should equal(401) + } + } + feature("UKOB v3.1 GET /transactions") { + scenario("authenticated -> 200", UKOpenBankingV310) { + getAuthed("transactions").code should equal(200) + } + scenario("unauthenticated -> 401", UKOpenBankingV310) { + getUnauthed("transactions").code should equal(401) + } + } + +} diff --git a/obp-api/src/test/scala/code/api/UKOpenBanking/v3_1_0/UKOpenBankingV310PisTests.scala b/obp-api/src/test/scala/code/api/UKOpenBanking/v3_1_0/UKOpenBankingV310PisTests.scala new file mode 100644 index 0000000000..aaa3fbb881 --- /dev/null +++ b/obp-api/src/test/scala/code/api/UKOpenBanking/v3_1_0/UKOpenBankingV310PisTests.scala @@ -0,0 +1,124 @@ +package code.api.UKOpenBanking.v3_1_0 + +import org.scalatest.Tag + +/** + * UK Open Banking v3.1 — PIS (Payment Initiation) + Funds Confirmation family. + * + * All of these are stubs: the Lift handler calls authenticatedAccess(cc) and + * returns a hard-coded mock JSON tuple (default 200). POST handlers ignore the + * body, so any valid JSON ("{}") matches Lift's JsonPost extractor. + * + * - authenticated -> 200 + * - unauthenticated -> 401 + * + * Any handler that turns out to return a different status (e.g. 201/204) is + * calibrated against the Lift baseline in Phase 1. + */ +class UKOpenBankingV310PisTests extends UKOpenBankingV310ServerSetup { + + object UKOpenBankingV310Pis extends Tag("UKOpenBankingV310Pis") + + private val emptyBody = "{}" + private val fakeId = "fake-id" + + // Helper: assert authed -> 200 and unauthed -> 401 for a GET path. + private def checkGet(segments: String*): Unit = { + scenario(s"GET /${segments.mkString("/")} authenticated -> 200", UKOpenBankingV310Pis) { + getAuthed(segments: _*).code should equal(200) + } + scenario(s"GET /${segments.mkString("/")} unauthenticated -> 401", UKOpenBankingV310Pis) { + getUnauthed(segments: _*).code should equal(401) + } + } + // Helper: assert authed -> 200 and unauthed -> 401 for a POST path. + private def checkPost(segments: String*): Unit = { + scenario(s"POST /${segments.mkString("/")} authenticated -> 200", UKOpenBankingV310Pis) { + postAuthed(emptyBody, segments: _*).code should equal(200) + } + scenario(s"POST /${segments.mkString("/")} unauthenticated -> 401", UKOpenBankingV310Pis) { + postUnauthed(emptyBody, segments: _*).code should equal(401) + } + } + // Helper: assert authed -> 204 and unauthed -> 401 for a DELETE path. + // (UK consent DELETE handlers return HttpCode.`204`.) + private def checkDelete(segments: String*): Unit = { + scenario(s"DELETE /${segments.mkString("/")} authenticated -> 204", UKOpenBankingV310Pis) { + deleteAuthed(segments: _*).code should equal(204) + } + scenario(s"DELETE /${segments.mkString("/")} unauthenticated -> 401", UKOpenBankingV310Pis) { + deleteUnauthed(segments: _*).code should equal(401) + } + } + + // ── DomesticPaymentsApi (5) ──────────────────────────────────────── + feature("UKOB v3.1 Domestic Payments") { + checkPost("domestic-payment-consents") + checkPost("domestic-payments") + checkGet("domestic-payment-consents", fakeId) + checkGet("domestic-payment-consents", fakeId, "funds-confirmation") + checkGet("domestic-payments", fakeId) + } + + // ── DomesticScheduledPaymentsApi (4) ─────────────────────────────── + feature("UKOB v3.1 Domestic Scheduled Payments") { + checkPost("domestic-scheduled-payment-consents") + checkPost("domestic-scheduled-payments") + checkGet("domestic-scheduled-payment-consents", fakeId) + checkGet("domestic-scheduled-payments", fakeId) + } + + // ── DomesticStandingOrdersApi (4) ────────────────────────────────── + feature("UKOB v3.1 Domestic Standing Orders") { + checkPost("domestic-standing-order-consents") + checkPost("domestic-standing-orders") + checkGet("domestic-standing-order-consents", fakeId) + checkGet("domestic-standing-orders", fakeId) + } + + // ── FilePaymentsApi (7) ──────────────────────────────────────────── + feature("UKOB v3.1 File Payments") { + checkPost("file-payment-consents") + checkPost("file-payment-consents", fakeId, "file") + checkPost("file-payments") + checkGet("file-payment-consents", fakeId) + checkGet("file-payment-consents", fakeId, "file") + checkGet("file-payments", fakeId) + checkGet("file-payments", fakeId, "report-file") + } + + // ── FundsConfirmationsApi (4) ────────────────────────────────────── + feature("UKOB v3.1 Funds Confirmations") { + checkPost("funds-confirmation-consents") + checkPost("funds-confirmations") + checkDelete("funds-confirmation-consents", fakeId) + checkGet("funds-confirmation-consents", fakeId) + } + + // ── InternationalPaymentsApi (5) ─────────────────────────────────── + feature("UKOB v3.1 International Payments") { + checkPost("international-payment-consents") + checkPost("international-payments") + checkGet("international-payment-consents", fakeId) + checkGet("international-payment-consents", fakeId, "funds-confirmation") + checkGet("international-payments", fakeId) + } + + // ── InternationalScheduledPaymentsApi (5) ────────────────────────── + feature("UKOB v3.1 International Scheduled Payments") { + checkPost("international-scheduled-payment-consents") + checkPost("international-scheduled-payments") + checkGet("international-scheduled-payment-consents", fakeId) + checkGet("international-scheduled-payment-consents", fakeId, "funds-confirmation") + checkGet("international-scheduled-payments", fakeId) + } + + // ── InternationalStandingOrdersApi (4) ───────────────────────────── + feature("UKOB v3.1 International Standing Orders") { + checkPost("international-standing-order-consents") + checkPost("international-standing-orders") + checkGet("international-standing-order-consents", fakeId) + checkGet("international-standing-orders", fakeId) + } + +} diff --git a/obp-api/src/test/scala/code/api/UKOpenBanking/v3_1_0/UKOpenBankingV310ServerSetup.scala b/obp-api/src/test/scala/code/api/UKOpenBanking/v3_1_0/UKOpenBankingV310ServerSetup.scala new file mode 100644 index 0000000000..68958ea776 --- /dev/null +++ b/obp-api/src/test/scala/code/api/UKOpenBanking/v3_1_0/UKOpenBankingV310ServerSetup.scala @@ -0,0 +1,30 @@ +package code.api.UKOpenBanking.v3_1_0 + +import code.api.util.APIUtil.OAuth._ +import code.setup.{APIResponse, DefaultUsers, ServerSetupWithTestData} +import dispatch.Req + +/** + * Shared setup + request helpers for the UK Open Banking v3.1 test suites. + * + * Base path is `/open-banking/v3.1` (derived from + * ScannedApiVersion("open-banking","UK","v3.1")). The `*Authed` helpers attach + * the OAuth credentials of `user1`; the `*Unauthed` helpers send no credentials + * so the endpoint's `authenticatedAccess` (or `applicationAccess`) check fires. + */ +trait UKOpenBankingV310ServerSetup extends ServerSetupWithTestData with DefaultUsers { + + def v31Request: Req = baseRequest / "open-banking" / "v3.1" + + // Build a request from path segments, e.g. v31("accounts", accountId, "balances"). + def v31(segments: String*): Req = segments.foldLeft(v31Request)((req, s) => req / s) + + def getAuthed(segments: String*): APIResponse = makeGetRequest(v31(segments: _*).GET <@ (user1)) + def getUnauthed(segments: String*): APIResponse = makeGetRequest(v31(segments: _*).GET) + + def postAuthed(body: String, segments: String*): APIResponse = makePostRequest(v31(segments: _*).POST <@ (user1), body) + def postUnauthed(body: String, segments: String*): APIResponse = makePostRequest(v31(segments: _*).POST, body) + + def deleteAuthed(segments: String*): APIResponse = makeDeleteRequest(v31(segments: _*).DELETE <@ (user1)) + def deleteUnauthed(segments: String*): APIResponse = makeDeleteRequest(v31(segments: _*).DELETE) +} diff --git a/obp-api/src/test/scala/code/util/APIUtilHeavyTest.scala b/obp-api/src/test/scala/code/util/APIUtilHeavyTest.scala index fe0a80bb99..080350d263 100644 --- a/obp-api/src/test/scala/code/util/APIUtilHeavyTest.scala +++ b/obp-api/src/test/scala/code/util/APIUtilHeavyTest.scala @@ -28,7 +28,7 @@ TESOBE (http://www.tesobe.com/) package code.util import code.api.Constant.SYSTEM_OWNER_VIEW_ID -import code.api.UKOpenBanking.v3_1_0.APIMethods_AccountAccessApi +import code.api.UKOpenBanking.v3_1_0.Http4sUKOBv310AccountAccess import code.api.berlin.group.ConstantsBG import code.api.builder.AccountInformationServiceAISApi.APIMethods_AccountInformationServiceAISApi import code.api.util._ @@ -143,16 +143,24 @@ class APIUtilHeavyTest extends V400ServerSetup with PropsReset { allowedOperationIds3 contains(s"BG${bgVersion}-createConsent") should be (false) allowedOperationIds3 contains(s"BG${bgVersion}-deleteConsent") should be (false) - val ukResourceDocsV31 = APIMethods_AccountAccessApi.resourceDocs - val ukEndpointsV31 = APIMethods_AccountAccessApi.endpoints + // UK v3.1 is fully on http4s; getAllowedResourceDocs needs non-null partialFunctions, + // so filter Http4sUKOBv310AccountAccess.resourceDocs directly by props instead. + val ukResourceDocsV31 = Http4sUKOBv310AccountAccess.resourceDocs + def filterUKv31Docs() = { + val disabledIds = APIUtil.getDisabledEndpointOperationIds().toSet + val enabledIds = APIUtil.getEnabledEndpointOperationIds().toSet + ukResourceDocsV31.filter(rd => + !disabledIds.contains(rd.operationId) && + (enabledIds.contains(rd.operationId) || enabledIds.isEmpty) + ).map(_.operationId).toList + } setPropsValues( "api_disabled_endpoints" -> "[UKv3.1-createAccountAccessConsents,UKv3.1-deleteConsent]", "api_enabled_endpoints" -> "[]" ) - val allowedEndpoints4: List[APIUtil.ResourceDoc] = APIUtil.getAllowedResourceDocs(ukEndpointsV31, ukResourceDocsV31).toList - val allowedOperationIds4 = allowedEndpoints4.map(_.operationId) + val allowedOperationIds4 = filterUKv31Docs() allowedOperationIds4 contains("UKv3.1-getAccountAccessConsentsConsentId") should be (true) allowedOperationIds4 contains("UKv3.1-createAccountAccessConsents") should be (false) @@ -163,8 +171,7 @@ class APIUtilHeavyTest extends V400ServerSetup with PropsReset { "api_enabled_endpoints" -> "[UKv3.1-createAccountAccessConsents]" ) - val allowedEndpoints5: List[APIUtil.ResourceDoc] = APIUtil.getAllowedResourceDocs(ukEndpointsV31, ukResourceDocsV31).toList - val allowedOperationIds5 = allowedEndpoints5.map(_.operationId) + val allowedOperationIds5 = filterUKv31Docs() allowedOperationIds5.length should be (1) allowedOperationIds5 contains("UKv3.1-createAccountAccessConsents") should be (true)