Merge pull request #1215 from hongwei1/develop

fixed the version
This commit is contained in:
Simon Redfern 2019-02-13 09:52:28 +01:00 committed by GitHub
commit 71aa545ce8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 6402 additions and 446 deletions

View File

@ -279,9 +279,6 @@ class Boot extends MdcLoggable {
enableVersionIfAllowed(ApiVersion.v2_2_0)
enableVersionIfAllowed(ApiVersion.v3_0_0)
enableVersionIfAllowed(ApiVersion.v3_1_0)
enableVersionIfAllowed(ApiVersion.berlinGroupV1)
enableVersionIfAllowed(ApiVersion.ukOpenBankingV200)
enableVersionIfAllowed(ApiVersion.ukOpenBankingV310)
enableVersionIfAllowed(ApiVersion.apiBuilder)
// TODO Wrap these with enableVersionIfAllowed as well

View File

@ -543,7 +543,7 @@ trait APIMethods_APIBuilder
val ImplementationsBuilderAPI = new Object()
{
val apiVersion: ApiVersion = ApiVersion.apiBuilder
val apiVersion = ApiVersion.apiBuilder
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)

View File

@ -0,0 +1,673 @@
package code.api.Polish.v2_1_1_1
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
import net.liftweb.json
import net.liftweb.json._
import code.api.util.APIUtil.{defaultBankId, _}
import code.api.util.{ApiVersion, NewStyle}
import code.api.util.ErrorMessages._
import code.api.util.ApiTag._
import code.api.util.NewStyle.HttpCode
import code.bankconnectors.Connector
import code.model._
import code.util.Helper
import code.views.Views
import net.liftweb.common.Full
import net.liftweb.http.rest.RestHelper
import com.github.dwickern.macros.NameOf.nameOf
import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.Polish.v2_1_1_1.OBP_PAPI_2_1_1_1
import code.api.util.ApiTag
object APIMethods_AISApi extends RestHelper {
val apiVersion = OBP_PAPI_2_1_1_1.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
deleteConsent ::
getAccount ::
getAccounts ::
getHolds ::
getTransactionDetail ::
getTransactionsCancelled ::
getTransactionsDone ::
getTransactionsPending ::
getTransactionsRejected ::
getTransactionsScheduled ::
Nil
resourceDocs += ResourceDoc(
deleteConsent,
apiVersion,
nameOf(deleteConsent),
"POST",
"/accounts/v2_1_1.1/deleteConsent",
"Removes consent",
s"""${mockedDataText(true)}
Removes consent""",
json.parse("""{
"consentId" : "consentId"
}"""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AIS") :: apiTagMockedData :: Nil
)
lazy val deleteConsent : OBPEndpoint = {
case "accounts":: "v2_1_1.1":: "deleteConsent" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse(""""""), callContext)
}
}
}
resourceDocs += ResourceDoc(
getAccount,
apiVersion,
nameOf(getAccount),
"POST",
"/accounts/v2_1_1.1/getAccount",
"Get detailed information about user payment account",
s"""${mockedDataText(true)}
User identification based on access token""",
json.parse("""{
"requestHeader" : "",
"accountNumber" : "accountNumber"
}"""),
json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"account" : {
"auxData" : { },
"bank" : {
"address" : "",
"bicOrSwift" : "bicOrSwift",
"name" : "name"
},
"bookingBalance" : "bookingBalance",
"accountType" : {
"code" : "code",
"description" : "description"
},
"accountTypeName" : "accountTypeName",
"currency" : "currency",
"nameAddress" : {
"value" : [ "value", "value", "value", "value" ]
},
"accountNumber" : "accountNumber",
"accountNameClient" : "accountNameClient",
"accountHolderType" : "individual",
"availableBalance" : "availableBalance"
}
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AIS") :: apiTagMockedData :: Nil
)
lazy val getAccount : OBPEndpoint = {
case "accounts":: "v2_1_1.1":: "getAccount" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"account" : {
"auxData" : { },
"bank" : {
"address" : "",
"bicOrSwift" : "bicOrSwift",
"name" : "name"
},
"bookingBalance" : "bookingBalance",
"accountType" : {
"code" : "code",
"description" : "description"
},
"accountTypeName" : "accountTypeName",
"currency" : "currency",
"nameAddress" : {
"value" : [ "value", "value", "value", "value" ]
},
"accountNumber" : "accountNumber",
"accountNameClient" : "accountNameClient",
"accountHolderType" : "individual",
"availableBalance" : "availableBalance"
}
}"""), callContext)
}
}
}
resourceDocs += ResourceDoc(
getAccounts,
apiVersion,
nameOf(getAccounts),
"POST",
"/accounts/v2_1_1.1/getAccounts",
"Get information about all user's payment account",
s"""${mockedDataText(true)}
User identification based on access token""",
json.parse("""{
"perPage" : 1,
"requestHeader" : "",
"pageId" : "pageId"
}"""),
json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"accounts" : [ {
"accountType" : {
"code" : "code",
"description" : "description"
},
"accountTypeName" : "accountTypeName",
"accountNumber" : "accountNumber"
}, {
"accountType" : {
"code" : "code",
"description" : "description"
},
"accountTypeName" : "accountTypeName",
"accountNumber" : "accountNumber"
} ]
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AIS") :: apiTagMockedData :: Nil
)
lazy val getAccounts : OBPEndpoint = {
case "accounts":: "v2_1_1.1":: "getAccounts" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"accounts" : [ {
"accountType" : {
"code" : "code",
"description" : "description"
},
"accountTypeName" : "accountTypeName",
"accountNumber" : "accountNumber"
}, {
"accountType" : {
"code" : "code",
"description" : "description"
},
"accountTypeName" : "accountTypeName",
"accountNumber" : "accountNumber"
} ]
}"""), callContext)
}
}
}
resourceDocs += ResourceDoc(
getHolds,
apiVersion,
nameOf(getHolds),
"POST",
"/accounts/v2_1_1.1/getHolds",
"Get list of user's holded operations",
s"""${mockedDataText(true)}
""",
json.parse(""""""""),
json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"holds" : [ "", "" ]
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AIS") :: apiTagMockedData :: Nil
)
lazy val getHolds : OBPEndpoint = {
case "accounts":: "v2_1_1.1":: "getHolds" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"holds" : [ "", "" ]
}"""), callContext)
}
}
}
resourceDocs += ResourceDoc(
getTransactionDetail,
apiVersion,
nameOf(getTransactionDetail),
"POST",
"/accounts/v2_1_1.1/getTransactionDetail",
"Get detailed information about user's single transaction",
s"""${mockedDataText(true)}
""",
json.parse("""{
"itemId" : "itemId",
"requestHeader" : "",
"bookingDate" : "2000-01-23T04:56:07.000+00:00",
"accountNumber" : "accountNumber"
}"""),
json.parse("""{
"baseInfo" : "",
"cardInfo" : {
"cardHolder" : "cardHolder",
"cardNumber" : "cardNumber"
},
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"baseCurrency" : "baseCurrency",
"usedPaymentInstrumentId" : "usedPaymentInstrumentId",
"holdExpirationDate" : "2000-01-23T04:56:07.000+00:00",
"zusInfo" : {
"contributionType" : "contributionType",
"contributionId" : "contributionId",
"paymentTypeId" : "paymentTypeId",
"payerInfo" : {
"nip" : "nip",
"additionalPayorId" : "additionalPayorId",
"additionalPayorIdType" : "P"
},
"contributionPeriod" : "contributionPeriod",
"obligationId" : "obligationId"
},
"usInfo" : {
"periodId" : "periodId",
"periodType" : "periodType",
"payerInfo" : {
"payorId" : "payorId",
"payorIdType" : "N"
},
"formCode" : "formCode",
"year" : 6026,
"obligationId" : "obligationId"
},
"tppTransactionId" : "tppTransactionId",
"transactionRate" : [ {
"rate" : 0.8008281904610115,
"toCurrency" : "toCurrency",
"fromCurrency" : "fromCurrency"
}, {
"rate" : 0.8008281904610115,
"toCurrency" : "toCurrency",
"fromCurrency" : "fromCurrency"
} ],
"currencyDate" : "2000-01-23T04:56:07.000+00:00",
"rejectionReason" : "rejectionReason",
"amountBaseCurrency" : "amountBaseCurrency",
"tppName" : "tppName"
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AIS") :: apiTagMockedData :: Nil
)
lazy val getTransactionDetail : OBPEndpoint = {
case "accounts":: "v2_1_1.1":: "getTransactionDetail" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse("""{
"baseInfo" : "",
"cardInfo" : {
"cardHolder" : "cardHolder",
"cardNumber" : "cardNumber"
},
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"baseCurrency" : "baseCurrency",
"usedPaymentInstrumentId" : "usedPaymentInstrumentId",
"holdExpirationDate" : "2000-01-23T04:56:07.000+00:00",
"zusInfo" : {
"contributionType" : "contributionType",
"contributionId" : "contributionId",
"paymentTypeId" : "paymentTypeId",
"payerInfo" : {
"nip" : "nip",
"additionalPayorId" : "additionalPayorId",
"additionalPayorIdType" : "P"
},
"contributionPeriod" : "contributionPeriod",
"obligationId" : "obligationId"
},
"usInfo" : {
"periodId" : "periodId",
"periodType" : "periodType",
"payerInfo" : {
"payorId" : "payorId",
"payorIdType" : "N"
},
"formCode" : "formCode",
"year" : 6026,
"obligationId" : "obligationId"
},
"tppTransactionId" : "tppTransactionId",
"transactionRate" : [ {
"rate" : 0.8008281904610115,
"toCurrency" : "toCurrency",
"fromCurrency" : "fromCurrency"
}, {
"rate" : 0.8008281904610115,
"toCurrency" : "toCurrency",
"fromCurrency" : "fromCurrency"
} ],
"currencyDate" : "2000-01-23T04:56:07.000+00:00",
"rejectionReason" : "rejectionReason",
"amountBaseCurrency" : "amountBaseCurrency",
"tppName" : "tppName"
}"""), callContext)
}
}
}
resourceDocs += ResourceDoc(
getTransactionsCancelled,
apiVersion,
nameOf(getTransactionsCancelled),
"POST",
"/accounts/v2_1_1.1/getTransactionsCancelled",
"Get list of user cancelled transactions",
s"""${mockedDataText(true)}
""",
json.parse(""""""""),
json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"transactions" : [ "", "" ]
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AIS") :: apiTagMockedData :: Nil
)
lazy val getTransactionsCancelled : OBPEndpoint = {
case "accounts":: "v2_1_1.1":: "getTransactionsCancelled" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"transactions" : [ "", "" ]
}"""), callContext)
}
}
}
resourceDocs += ResourceDoc(
getTransactionsDone,
apiVersion,
nameOf(getTransactionsDone),
"POST",
"/accounts/v2_1_1.1/getTransactionsDone",
"Get list of user done transactions",
s"""${mockedDataText(true)}
""",
json.parse(""""""""),
json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"transactions" : [ "", "" ]
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AIS") :: apiTagMockedData :: Nil
)
lazy val getTransactionsDone : OBPEndpoint = {
case "accounts":: "v2_1_1.1":: "getTransactionsDone" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"transactions" : [ "", "" ]
}"""), callContext)
}
}
}
resourceDocs += ResourceDoc(
getTransactionsPending,
apiVersion,
nameOf(getTransactionsPending),
"POST",
"/accounts/v2_1_1.1/getTransactionsPending",
"Get list of user's pending transactions",
s"""${mockedDataText(true)}
""",
json.parse(""""""""),
json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"transactions" : [ "", "" ]
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AIS") :: apiTagMockedData :: Nil
)
lazy val getTransactionsPending : OBPEndpoint = {
case "accounts":: "v2_1_1.1":: "getTransactionsPending" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"transactions" : [ "", "" ]
}"""), callContext)
}
}
}
resourceDocs += ResourceDoc(
getTransactionsRejected,
apiVersion,
nameOf(getTransactionsRejected),
"POST",
"/accounts/v2_1_1.1/getTransactionsRejected",
"Get list of user's rejected transactions",
s"""${mockedDataText(true)}
""",
json.parse(""""""""),
json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"transactions" : [ "", "" ]
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AIS") :: apiTagMockedData :: Nil
)
lazy val getTransactionsRejected : OBPEndpoint = {
case "accounts":: "v2_1_1.1":: "getTransactionsRejected" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"transactions" : [ "", "" ]
}"""), callContext)
}
}
}
resourceDocs += ResourceDoc(
getTransactionsScheduled,
apiVersion,
nameOf(getTransactionsScheduled),
"POST",
"/accounts/v2_1_1.1/getTransactionsScheduled",
"Get list of user scheduled transactions",
s"""${mockedDataText(true)}
""",
json.parse(""""""""),
json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"transactions" : [ "", "" ]
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AIS") :: apiTagMockedData :: Nil
)
lazy val getTransactionsScheduled : OBPEndpoint = {
case "accounts":: "v2_1_1.1":: "getTransactionsScheduled" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse("""{
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
},
"pageInfo" : {
"previousPage" : "previousPage",
"nextPage" : "nextPage"
},
"transactions" : [ "", "" ]
}"""), callContext)
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,92 @@
package code.api.Polish.v2_1_1_1
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
import net.liftweb.json
import net.liftweb.json._
import code.api.util.APIUtil.{defaultBankId, _}
import code.api.util.{ApiVersion, NewStyle}
import code.api.util.ErrorMessages._
import code.api.util.ApiTag._
import code.api.util.NewStyle.HttpCode
import code.bankconnectors.Connector
import code.model._
import code.util.Helper
import code.views.Views
import net.liftweb.common.Full
import net.liftweb.http.rest.RestHelper
import com.github.dwickern.macros.NameOf.nameOf
import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.Polish.v2_1_1_1.OBP_PAPI_2_1_1_1
import code.api.util.ApiTag
object APIMethods_CAFApi extends RestHelper {
val apiVersion = OBP_PAPI_2_1_1_1.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
getConfirmationOfFunds ::
Nil
resourceDocs += ResourceDoc(
getConfirmationOfFunds,
apiVersion,
nameOf(getConfirmationOfFunds),
"POST",
"/confirmation/v2_1_1.1/getConfirmationOfFunds",
"Confirmation of the availability of funds",
s"""${mockedDataText(true)}
Confirming the availability on the payers account of the amount necessary to execute the payment transaction, as defined in Art. 65 PSD2.""",
json.parse("""{
"amount" : "amount",
"requestHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ipAddress" : "ipAddress",
"tppId" : "tppId",
"userAgent" : "userAgent"
},
"currency" : "currency",
"accountNumber" : "accountNumber"
}"""),
json.parse("""{
"fundsAvailable" : true,
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
}
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("CAF") :: apiTagMockedData :: Nil
)
lazy val getConfirmationOfFunds : OBPEndpoint = {
case "confirmation":: "v2_1_1.1":: "getConfirmationOfFunds" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse("""{
"fundsAvailable" : true,
"responseHeader" : {
"sendDate" : "2000-01-23T04:56:07.000+00:00",
"requestId" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"isCallback" : true
}
}"""), callContext)
}
}
}
}

View File

@ -0,0 +1,82 @@
/**
* Open Bank Project - API
* Copyright (C) 2011-2018, TESOBE Ltd
**
*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 <http://www.gnu.org/licenses/>.
**
*Email: contact@tesobe.com
*TESOBE Ltd
*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.Polish.v2_1_1_1
import code.api.OBPRestHelper
import code.api.util.APIUtil.{OBPEndpoint, ResourceDoc, getAllowedEndpoints}
import code.api.util.{ScannedApiVersion, ScannedApis}
import code.util.Helper.MdcLoggable
import code.api.Polish.v2_1_1_1.APIMethods_AISApi
import code.api.Polish.v2_1_1_1.APIMethods_ASApi
import code.api.Polish.v2_1_1_1.APIMethods_CAFApi
import code.api.Polish.v2_1_1_1.APIMethods_PISApi
import scala.collection.mutable.ArrayBuffer
/*
This file defines which endpoints from all the versions are available in v1
*/
object OBP_PAPI_2_1_1_1 extends OBPRestHelper with MdcLoggable with ScannedApis {
//please modify these three parameter if it is not correct.
override val apiVersion = ScannedApiVersion("polish-api", "PAPI", "v2.1.1.1")
val versionStatus = "DRAFT"
private[this] val endpoints =
APIMethods_AISApi.endpoints ++
APIMethods_ASApi.endpoints ++
APIMethods_CAFApi.endpoints ++
APIMethods_PISApi.endpoints
override val allResourceDocs: ArrayBuffer[ResourceDoc] =
APIMethods_AISApi.resourceDocs ++
APIMethods_ASApi.resourceDocs ++
APIMethods_CAFApi.resourceDocs ++
APIMethods_PISApi.resourceDocs
private[this] def findResourceDoc(pf: OBPEndpoint): Option[ResourceDoc] = {
allResourceDocs.find(_.partialFunction==pf)
}
// 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!
routes.foreach(route => {
oauthServe((apiVersion.urlPrefix / version.vDottedApiVersion()).oPrefix{route}, findResourceDoc(route))
})
logger.info(s"version $version has been run! There are ${routes.length} routes.")
}

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,6 @@ import java.util.UUID.randomUUID
import code.api.builder.OBP_APIBuilder
import code.api.UKOpenBanking.v2_0_0.OBP_UKOpenBanking_200
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.berlin.group.v1.OBP_BERLIN_GROUP_1
import code.api.berlin.group.v1_3.OBP_BERLIN_GROUP_1_3
import code.api.cache.Caching
@ -56,7 +55,7 @@ trait ResourceDocsAPIMethods extends MdcLoggable with APIMethods220 with APIMeth
val emptyObjectJson = EmptyClassJson()
// val statedApiVersion : String = "1_4_0"
val implementedInApiVersion : ApiVersion = ApiVersion.v1_4_0
val implementedInApiVersion = ApiVersion.v1_4_0
implicit val formats = new Formats {
val dateFormat = net.liftweb.json.DefaultFormats.dateFormat
@ -115,9 +114,6 @@ trait ResourceDocsAPIMethods extends MdcLoggable with APIMethods220 with APIMeth
val resourceDocs = requestedApiVersion match {
case ApiVersion.`apiBuilder` => OBP_APIBuilder.allResourceDocs
case ApiVersion.`ukOpenBankingV200` => OBP_UKOpenBanking_200.allResourceDocs
case ApiVersion.`ukOpenBankingV310` => OBP_UKOpenBanking_310.allResourceDocs
case ApiVersion.`berlinGroupV1` => OBP_BERLIN_GROUP_1.allResourceDocs
case ApiVersion.v3_1_0 => OBPAPI3_1_0.allResourceDocs
case ApiVersion.v3_0_0 => OBPAPI3_0_0.allResourceDocs
case ApiVersion.v2_2_0 => OBPAPI2_2_0.allResourceDocs
@ -134,9 +130,6 @@ trait ResourceDocsAPIMethods extends MdcLoggable with APIMethods220 with APIMeth
val versionRoutes = requestedApiVersion match {
case ApiVersion.`apiBuilder` => OBP_APIBuilder.routes
case ApiVersion.`ukOpenBankingV200` => OBP_UKOpenBanking_200.routes
case ApiVersion.`ukOpenBankingV310` => OBP_UKOpenBanking_310.routes
case ApiVersion.`berlinGroupV1` => OBP_BERLIN_GROUP_1.routes
case ApiVersion.v3_1_0 => OBPAPI3_1_0.routes
case ApiVersion.v3_0_0 => OBPAPI3_0_0.routes
case ApiVersion.v2_2_0 => OBPAPI2_2_0.routes
@ -168,9 +161,6 @@ trait ResourceDocsAPIMethods extends MdcLoggable with APIMethods220 with APIMeth
requestedApiVersion match
{
case ApiVersion.`apiBuilder` => ;
case ApiVersion.`ukOpenBankingV200` => ;
case ApiVersion.`ukOpenBankingV310` => ;
case ApiVersion.`berlinGroupV1` => ;
case version: ScannedApiVersion => ;
case _ => activePlusLocalResourceDocs ++= localResourceDocs
}
@ -187,9 +177,6 @@ trait ResourceDocsAPIMethods extends MdcLoggable with APIMethods220 with APIMeth
x <- activePlusLocalResourceDocs
// This is the "implemented in" url
url = x.implementedInApiVersion match {
case ApiVersion.`berlinGroupV1` => s"/berlin-group/${x.implementedInApiVersion.vDottedApiVersion}${x.requestUrl}"
case ApiVersion.`ukOpenBankingV200` => s"/open-banking/${x.implementedInApiVersion.vDottedApiVersion}${x.requestUrl}"
case ApiVersion.`ukOpenBankingV310` => s"/open-banking/${x.implementedInApiVersion.vDottedApiVersion}${x.requestUrl}"
case ApiVersion.`apiBuilder` => s"/api-builder/${x.implementedInApiVersion.vDottedApiVersion}${x.requestUrl}"
// We add the /obp/vX prefix here
case version: ScannedApiVersion => s"/${version.urlPrefix}/${x.implementedInApiVersion.vDottedApiVersion}${x.requestUrl}"
@ -199,9 +186,6 @@ trait ResourceDocsAPIMethods extends MdcLoggable with APIMethods220 with APIMeth
specialInstructions = getSpecialInstructions(x.partialFunctionName),
requestUrl = url,
specifiedUrl = x.implementedInApiVersion match {
case ApiVersion.`berlinGroupV1` => Some(url)
case ApiVersion.`ukOpenBankingV200` => Some(url)
case ApiVersion.`ukOpenBankingV310` => Some(url)
case ApiVersion.`apiBuilder` => Some(url)
// We add the /obp/vX prefix here - but this is the requested API version by the resource docs endpoint. i.e. we know this endpoint
// is also available here as well as the requestUrl. See the resource doc for resource doc!

View File

@ -303,7 +303,7 @@ object SwaggerJSONFactory {
//No longer need this special case since all transaction request Resource Docs have explicit URL
//case "createTransactionRequest" => s"${rd.apiVersion.toString }-${rd.apiFunction.toString}-${UUID.randomUUID().toString}"
// Note: The operationId should not start with a number becuase Javascript constructors may use it to build variables.
case _ => s"v${rd.implementedInApiVersion.toString }-${rd.partialFunctionName.toString }"
case _ => s"${rd.implementedInApiVersion.fullyQualifiedVersion }-${rd.partialFunctionName.toString }"
},
//TODO, this is for Post Body
parameters =

View File

@ -0,0 +1,335 @@
package code.api.STET.v1_4
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
import net.liftweb.json
import net.liftweb.json._
import code.api.util.APIUtil.{defaultBankId, _}
import code.api.util.{ApiVersion, NewStyle}
import code.api.util.ErrorMessages._
import code.api.util.ApiTag._
import code.api.util.NewStyle.HttpCode
import code.bankconnectors.Connector
import code.model._
import code.util.Helper
import code.views.Views
import net.liftweb.common.Full
import net.liftweb.http.rest.RestHelper
import com.github.dwickern.macros.NameOf.nameOf
import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.STET.v1_4.OBP_STET_1_4
import code.api.util.ApiTag
object APIMethods_AISPApi extends RestHelper {
val apiVersion = OBP_STET_1_4.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
accountsBalancesGet ::
accountsGet ::
accountsTransactionsGet ::
consentsPut ::
endUserIdentityGet ::
trustedBeneficiariesGet ::
Nil
resourceDocs += ResourceDoc(
accountsBalancesGet,
apiVersion,
nameOf(accountsBalancesGet),
"GET",
"/accounts/ACCOUNTRESOURCEID/balances",
"Retrieval of an account balances report (AISP)",
s"""${mockedDataText(true)}
&lt;h3&gt;Description&lt;/h3&gt;
This call returns a set of balances for a given PSU account that is specified by the AISP through an account resource Identification
&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The TPP has been registered by the Registration Authority for the AISP role&lt;/li&gt;
&lt;li&gt;The TPP and the PSU have a contract that has been enrolled by the ASPSP
&lt;ul style&#x3D;&quot;list-style-type:circle;&quot;&gt;
&lt;li&gt;At this step, the ASPSP has delivered an OAUTH2 &amp;ldquo;Authorization Code&amp;rdquo; or &amp;ldquo;Resource Owner Password&amp;rdquo; access token to the TPP (cf. &amp;sect; 3.4.2).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The TPP and the ASPSP have successfully processed a mutual check and authentication&lt;/li&gt;
&lt;li&gt;The TPP has presented its OAUTH2 &amp;ldquo;Authorization Code&amp;rdquo; or &amp;ldquo;Resource Owner Password&amp;rdquo; access token which allows the ASPSP to identify the relevant PSU and retrieve the linked PSU context (cf. &amp;sect; 3.4.2) if any.&lt;/li&gt;
&lt;li&gt;The ASPSP takes into account the access token that establishes the link between the PSU and the AISP.&lt;/li&gt;
&lt;li&gt;The TPP has previously retrieved the list of available accounts for the PSU&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Business flow&lt;/h3&gt;
The AISP requests the ASPSP on one of the PSU&amp;rsquo;s accounts.&lt;br /&gt;
The ASPSP answers by providing a list of balances on this account.
&lt;ul&gt;
&lt;li&gt;The ASPSP must provide at least the accounting balance on the account.&lt;/li&gt;
&lt;li&gt;The ASPSP can provide other balance restitutions, e.g. instant balance, as well, if possible.&lt;/li&gt;
&lt;li&gt;Actually, from the PSD2 perspective, any other balances that are provided through the Web-Banking service of the ASPSP must also be provided by this ASPSP through the API.&lt;/li&gt;
&lt;/ul&gt;
""",
json.parse(""""""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AISP") :: apiTagMockedData :: Nil
)
lazy val accountsBalancesGet : OBPEndpoint = {
case "accounts" :: accountresourceid:: "balances" :: Nil JsonGet _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse(""""""), callContext)
}
}
}
resourceDocs += ResourceDoc(
accountsGet,
apiVersion,
nameOf(accountsGet),
"GET",
"/accounts",
"Retrieval of the PSU accounts (AISP)",
s"""${mockedDataText(true)}
&lt;h3&gt;Description&lt;/h3&gt;
This call returns all payment accounts that are relevant the PSU on behalf of whom the AISP is connected.
Thanks to HYPERMEDIA, each account is returned with the links aiming to ease access to the relevant transactions and balances.
The result may be subject to pagination (i.e. retrieving a partial result in case of having too many results) through a set of pages by the ASPSP. Thereafter, the AISP may ask for the first, next, previous or last page of results.
&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The TPP has been registered by the Registration Authority for the AISP role.&lt;/li&gt;
&lt;li&gt;The TPP and the PSU have a contract that has been enrolled by the ASPSP&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;At this step, the ASPSP has delivered an OAUTH2 &quot;Authorization Code&quot; or &quot;Resource Owner Password&quot; access token to the TPP (cf. § 3.4.2).&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The TPP and the ASPSP have successfully processed a mutual check and authentication&lt;/li&gt;
&lt;li&gt;The TPP has presented its OAUTH2 &quot;Authorization Code&quot; or &quot;Resource Owner Password&quot; access token which allows the ASPSP to identify the relevant PSU and retrieve the linked PSU context (cf. § 3.4.2) if any.&lt;/li&gt;
&lt;li&gt;The ASPSP takes into account the access token that establishes the link between the PSU and the AISP.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Business Flow&lt;/h3&gt;
The TPP sends a request to the ASPSP for retrieving the list of the PSU payment accounts.
The ASPSP computes the relevant PSU accounts and builds the answer as an accounts list.
The result may be subject to pagination in order to avoid an excessive result set.
Each payment account will be provided with its characteristics.
""",
json.parse(""""""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AISP") :: apiTagMockedData :: Nil
)
lazy val accountsGet : OBPEndpoint = {
case "accounts" :: Nil JsonGet _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse(""""""), callContext)
}
}
}
resourceDocs += ResourceDoc(
accountsTransactionsGet,
apiVersion,
nameOf(accountsTransactionsGet),
"GET",
"/accounts/ACCOUNTRESOURCEID/transactions",
"Retrieval of an account transaction set (AISP)",
s"""${mockedDataText(true)}
&lt;h3&gt;Description&lt;/h3&gt;
This call returns transactions for an account for a given PSU account that is specified by the AISP through an account resource identification.
The request may use some filter parameter in order to restrict the query
&lt;ul&gt;
&lt;li&gt;on a given imputation date range&lt;/li&gt;
&lt;li&gt;past a given incremental technical identification&lt;/li&gt;
&lt;/ul&gt;
The result may be subject to pagination (i.e. retrieving a partial result in case of having too many results) through a set of pages by the ASPSP. Thereafter, the AISP may ask for the first, next, previous or last page of results.
&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The TPP has been registered by the Registration Authority for the AISP role&lt;/li&gt;
&lt;li&gt;The TPP and the PSU have a contract that has been enrolled by the ASPSP&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;At this step, the ASPSP has delivered an OAUTH2 &quot;Authorization Code&quot; or &quot;Resource Owner Password&quot; access token to the TPP (cf. § 3.4.2).&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The TPP and the ASPSP have successfully processed a mutual check and authentication &lt;/li&gt;
&lt;li&gt;The TPP has presented its OAUTH2 &quot;Authorization Code&quot; or &quot;Resource Owner Password&quot; access token which allows the ASPSP to identify the relevant PSU and retrieve the linked PSU context (cf. § 3.4.2) is any.&lt;/li&gt;
&lt;li&gt;The ASPSP takes into account the access token that establishes the link between the PSU and the AISP.&lt;/li&gt;
&lt;li&gt;The TPP has previously retrieved the list of available accounts for the PSU&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Business flow&lt;/h3&gt;
The AISP requests the ASPSP on one of the PSUs accounts. It may specify some selection criteria.
The ASPSP answers by a set of transactions that matches the query. The result may be subject to pagination in order to avoid an excessive result set.
""",
json.parse(""""""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AISP") :: apiTagMockedData :: Nil
)
lazy val accountsTransactionsGet : OBPEndpoint = {
case "accounts" :: accountresourceid:: "transactions" :: Nil JsonGet _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse(""""""), callContext)
}
}
}
resourceDocs += ResourceDoc(
consentsPut,
apiVersion,
nameOf(consentsPut),
"PUT",
"/consents",
"Forwarding the PSU consent (AISP)",
s"""${mockedDataText(true)}
&lt;h3&gt;Description&lt;/h3&gt;
In the mixed detailed consent on accounts
&lt;ul&gt;
&lt;li&gt;the AISP captures the consent of the PSU&lt;/li&gt;
&lt;li&gt;then it forwards this consent to the ASPSP&lt;/li&gt;
&lt;/ul&gt;
This consent replaces any prior consent that was previously sent by the AISP.
&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The TPP has been registered by the Registration Authority for the AISP role.&lt;/li&gt;
&lt;li&gt;The TPP and the PSU have a contract that has been enrolled by the ASPSP&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;At this step, the ASPSP has delivered an OAUTH2 &quot;Authorization Code&quot; or &quot;Resource Owner Password&quot; access token to the TPP (cf. § 3.4.2).&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The TPP and the ASPSP have successfully processed a mutual check and authentication&lt;/li&gt;
&lt;li&gt;The TPP has presented its OAUTH2 &quot;Authorization Code&quot; or &quot;Resource Owner Password&quot; access token which allows the ASPSP to identify the relevant PSU and retrieve the linked PSU context (cf. § 3.4.2) if any.&lt;/li&gt;
&lt;li&gt;The ASPSP takes into account the access token that establishes the link between the PSU and the AISP.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Business Flow&lt;/h3&gt;
The PSU specifies to the AISP which of his/her accounts will be accessible and which functionalities should be available.
The AISP forwards these settings to the ASPSP.
The ASPSP answers by HTTP201 return code.
""",
json.parse("""{
"balances" : [ {
"iban" : "YY64COJH41059545330222956960771321"
} ],
"trustedBeneficiaries" : true,
"psuIdentity" : true
}"""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AISP") :: apiTagMockedData :: Nil
)
lazy val consentsPut : OBPEndpoint = {
case "consents" :: Nil JsonPut _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse(""""""), callContext)
}
}
}
resourceDocs += ResourceDoc(
endUserIdentityGet,
apiVersion,
nameOf(endUserIdentityGet),
"GET",
"/end-user-identity",
"Retrieval of the identity of the end-user (AISP)",
s"""${mockedDataText(true)}
&lt;h3&gt;Description&lt;/h3&gt;
This call returns the identity of the PSU (end-user).
&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The TPP has been registered by the Registration Authority for the AISP role.&lt;/li&gt;
&lt;li&gt;The TPP and the PSU have a contract that has been enrolled by the ASPSP&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;At this step, the ASPSP has delivered an OAUTH2 &quot;Authorization Code&quot; or &quot;Resource Owner Password&quot; access token to the TPP (cf. § 3.4.2).&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The TPP and the ASPSP have successfully processed a mutual check and authentication&lt;/li&gt;
&lt;li&gt;The TPP has presented its OAUTH2 &quot;Authorization Code&quot; or &quot;Resource Owner Password&quot; access token which allows the ASPSP to identify the relevant PSU and retrieve the linked PSU context (cf. § 3.4.2) if any.&lt;/li&gt;
&lt;li&gt;The ASPSP takes into account the access token that establishes the link between the PSU and the AISP.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Business Flow&lt;/h3&gt;
The AISP asks for the identity of the PSU.
The ASPSP answers with the identity, i.e. first and last names of the end-user.
""",
json.parse(""""""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AISP") :: apiTagMockedData :: Nil
)
lazy val endUserIdentityGet : OBPEndpoint = {
case "end-user-identity" :: Nil JsonGet _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse(""""""), callContext)
}
}
}
resourceDocs += ResourceDoc(
trustedBeneficiariesGet,
apiVersion,
nameOf(trustedBeneficiariesGet),
"GET",
"/trusted-beneficiaries",
"Retrieval of the trusted beneficiaries list (AISP)",
s"""${mockedDataText(true)}
&lt;h3&gt;Description&lt;/h3&gt;
This call returns all trusted beneficiaries that have been set by the PSU.
Those beneficiaries can benefit from an SCA exemption during payment initiation.
The result may be subject to pagination (i.e. retrieving a partial result in case of having too many results) through a set of pages by the ASPSP. Thereafter, the AISP may ask for the first, next, previous or last page of results.
&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The TPP has been registered by the Registration Authority for the AISP role.&lt;/li&gt;
&lt;li&gt;The TPP and the PSU have a contract that has been enrolled by the ASPSP&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;At this step, the ASPSP has delivered an OAUTH2 &quot;Authorization Code&quot; or &quot;Resource Owner Password&quot; access token to the TPP (cf. § 3.4.2).&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The TPP and the ASPSP have successfully processed a mutual check and authentication&lt;/li&gt;
&lt;li&gt;The TPP has presented its OAUTH2 &quot;Authorization Code&quot; or &quot;Resource Owner Password&quot; access token which allows the ASPSP to identify the relevant PSU and retrieve the linked PSU context (cf. § 3.4.2) if any.&lt;/li&gt;
&lt;li&gt;The ASPSP takes into account the access token that establishes the link between the PSU and the AISP.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Business Flow&lt;/h3&gt;
The AISP asks for the trusted beneficiaries list.
The ASPSP answers with a list of beneficiary details structure.
""",
json.parse(""""""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("AISP") :: apiTagMockedData :: Nil
)
lazy val trustedBeneficiariesGet : OBPEndpoint = {
case "trusted-beneficiaries" :: Nil JsonGet _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse(""""""), callContext)
}
}
}
}

View File

@ -0,0 +1,93 @@
package code.api.STET.v1_4
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
import net.liftweb.json
import net.liftweb.json._
import code.api.util.APIUtil.{defaultBankId, _}
import code.api.util.{ApiVersion, NewStyle}
import code.api.util.ErrorMessages._
import code.api.util.ApiTag._
import code.api.util.NewStyle.HttpCode
import code.bankconnectors.Connector
import code.model._
import code.util.Helper
import code.views.Views
import net.liftweb.common.Full
import net.liftweb.http.rest.RestHelper
import com.github.dwickern.macros.NameOf.nameOf
import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.STET.v1_4.OBP_STET_1_4
import code.api.util.ApiTag
object APIMethods_CBPIIApi extends RestHelper {
val apiVersion = OBP_STET_1_4.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
fundsConfirmationsPost ::
Nil
resourceDocs += ResourceDoc(
fundsConfirmationsPost,
apiVersion,
nameOf(fundsConfirmationsPost),
"POST",
"/funds-confirmations",
"Payment coverage check request (CBPII)",
s"""${mockedDataText(true)}
&lt;h3&gt;Description&lt;/h3&gt;
The CBPII can ask an ASPSP to check if a given amount can be covered by the liquidity that is available on a PSU cash account or payment card.
&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The TPP has been registered by the Registration Authority for the CBPII role&lt;/li&gt;
&lt;li&gt;The TPP and the PSU have a contract that has been registered by the ASPSP&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;At this step, the ASPSP has delivered an &quot;Authorization Code&quot;, a &quot;Resource Owner Password&quot; or a &quot;Client Credential&quot; OAUTH2 access token to the TPP (cf. § 3.4.2).&lt;/li&gt;
&lt;li&gt;Each ASPSP has to implement either the &quot;Authorization Code&quot;/&quot;Resource Owner Password&quot; or the &quot;Client Credential&quot; OAUTH2 access token model.&lt;/li&gt;
&lt;li&gt;Doing this, it will edit the [security] section on this path in order to specify which model it has chosen&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The TPP and the ASPSP have successfully processed a mutual check and authentication &lt;/li&gt;
&lt;li&gt;The TPP has presented its OAUTH2 &quot;Authorization Code&quot;, &quot;Resource Owner Password&quot; or &quot;Client Credential&quot; access token which allows the ASPSP to identify the relevant PSU.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Business flow&lt;/h3&gt;
The CBPII requests the ASPSP for a payment coverage check against either a bank account or a card primary identifier.
The ASPSP answers with a structure embedding the original request and the result as a Boolean.
""",
json.parse("""{
"paymentCoverageRequestId" : "MyCoverage123456",
"instructedAmount" : {
"currency" : "EUR",
"amount" : "12345"
},
"accountId" : {
"iban" : "YY13RDHN98392489481620896668799742"
}
}"""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("CBPII") :: apiTagMockedData :: Nil
)
lazy val fundsConfirmationsPost : OBPEndpoint = {
case "funds-confirmations" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse(""""""), callContext)
}
}
}
}

View File

@ -0,0 +1,79 @@
/**
* Open Bank Project - API
* Copyright (C) 2011-2018, TESOBE Ltd
**
*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 <http://www.gnu.org/licenses/>.
**
*Email: contact@tesobe.com
*TESOBE Ltd
*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.STET.v1_4
import code.api.OBPRestHelper
import code.api.util.APIUtil.{OBPEndpoint, ResourceDoc, getAllowedEndpoints}
import code.api.util.{ScannedApiVersion, ScannedApis}
import code.util.Helper.MdcLoggable
import code.api.STET.v1_4.APIMethods_AISPApi
import code.api.STET.v1_4.APIMethods_CBPIIApi
import code.api.STET.v1_4.APIMethods_PISPApi
import scala.collection.mutable.ArrayBuffer
/*
This file defines which endpoints from all the versions are available in v1
*/
object OBP_STET_1_4 extends OBPRestHelper with MdcLoggable with ScannedApis {
//please modify these three parameter if it is not correct.
override val apiVersion = ScannedApiVersion("stet", "STET", "v1.4")
val versionStatus = "DRAFT"
private[this] val endpoints =
APIMethods_AISPApi.endpoints ++
APIMethods_CBPIIApi.endpoints ++
APIMethods_PISPApi.endpoints
override val allResourceDocs: ArrayBuffer[ResourceDoc] =
APIMethods_AISPApi.resourceDocs ++
APIMethods_CBPIIApi.resourceDocs ++
APIMethods_PISPApi.resourceDocs
private[this] def findResourceDoc(pf: OBPEndpoint): Option[ResourceDoc] = {
allResourceDocs.find(_.partialFunction==pf)
}
// 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!
routes.foreach(route => {
oauthServe((apiVersion.urlPrefix / version.vDottedApiVersion()).oPrefix{route}, findResourceDoc(route))
})
logger.info(s"version $version has been run! There are ${routes.length} routes.")
}

View File

@ -0,0 +1,706 @@
package code.api.STET.v1_4
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
import net.liftweb.json
import net.liftweb.json._
import code.api.util.APIUtil.{defaultBankId, _}
import code.api.util.{ApiVersion, NewStyle}
import code.api.util.ErrorMessages._
import code.api.util.ApiTag._
import code.api.util.NewStyle.HttpCode
import code.bankconnectors.Connector
import code.model._
import code.util.Helper
import code.views.Views
import net.liftweb.common.Full
import net.liftweb.http.rest.RestHelper
import com.github.dwickern.macros.NameOf.nameOf
import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.STET.v1_4.OBP_STET_1_4
import code.api.util.ApiTag
object APIMethods_PISPApi extends RestHelper {
val apiVersion = OBP_STET_1_4.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
paymentRequestConfirmationPost ::
paymentRequestPut ::
paymentRequestsGet ::
paymentRequestsPost ::
Nil
resourceDocs += ResourceDoc(
paymentRequestConfirmationPost,
apiVersion,
nameOf(paymentRequestConfirmationPost),
"POST",
"/payment-requests/PAYMENTREQUESTRESOURCEID/confirmation",
"Confirmation of a payment request or a modification request (PISP)",
s"""${mockedDataText(true)}
&lt;h3&gt;Description&lt;/h3&gt;
The PISP confirms one of the following requests&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;payment request on behalf of a merchant&lt;/li&gt;
&lt;li&gt;transfer request on behalf of the account&#39;s owner&lt;/li&gt;
&lt;li&gt;standing-order request on behalf of the account&#39;s owner&lt;/li&gt;
&lt;/ul&gt;
The ASPSP answers with a status of the relevant request and the subsequent Credit Transfer.
&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt; The TPP has been registered by the Registration Authority for the PISP role&lt;/li&gt;
&lt;li&gt; The TPP was provided with an OAUTH2 &quot;Client Credential&quot; access token by the ASPSP (cf. § 3.4.3).&lt;/li&gt;
&lt;li&gt; The TPP has previously posted a Request which has been saved by the ASPSP (cf. § 4.5.3)&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;The ASPSP has answered with a location link to the saved Payment Request (cf. § 4.5.4)&lt;/li&gt;
&lt;li&gt; The TPP has retrieved the saved request in order to get the relevant resource Ids (cf. § 4.6).&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt; The TPP and the ASPSP have successfully processed a mutual check and authentication &lt;/li&gt;
&lt;li&gt; The TPP has presented its &quot;OAUTH2 Client Credential&quot; access token &lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Business flow&lt;/h3&gt;
Once the PSU has been authenticated, it is the due to the PISP to confirm the Request to the ASPSP in order to complete the process flow.&lt;br&gt;
In REDIRECT and DECOUPLED approach, this confirmation is not a prerequisite to the execution of the Credit Transfer.&lt;br&gt;
""",
json.parse("""{
"psuAuthenticationFactor" : "JJKJKJ788GKJKJBK"
}"""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("PISP") :: apiTagMockedData :: Nil
)
lazy val paymentRequestConfirmationPost : OBPEndpoint = {
case "payment-requests" :: paymentrequestresourceid:: "confirmation" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse(""""""), callContext)
}
}
}
resourceDocs += ResourceDoc(
paymentRequestPut,
apiVersion,
nameOf(paymentRequestPut),
"PUT",
"/payment-requests/PAYMENTREQUESTRESOURCEID",
"Modification of a Payment/Transfer Request (PISP)",
s"""${mockedDataText(true)}
&lt;h3&gt;Description&lt;/h3&gt;
The PISP sent a Payment/Transfer Request through a POST command.&lt;br&gt;
The ASPSP registered the Payment/Transfer Request, updated if necessary the relevant identifiers in order to avoid duplicates and returned the location of the updated Request.&lt;br&gt;
The PISP got the Payment/Transfer Request that has been updated with the resource identifiers, and eventually the status of the Payment/Transfer Request and the status of the subsequent credit transfer.&lt;br&gt;
The PISP request for the payment cancellation (global cancellation) or for some payment instructions cancellation (partial cancellation)&lt;br&gt;
No other modification of the Payment/Transfer Request is allowed.&lt;br/&gt;
&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The TPP was registered by the Registration Authority for the PISP role&lt;/li&gt;
&lt;li&gt;The TPP was provided with an OAUTH2 &quot;Client Credential&quot; access token by the ASPSP (cf. § 3.4.3).&lt;/li&gt;
&lt;li&gt;The TPP previously posted a Payment/Transfer Request which was saved by the ASPSP (cf. § 4.5.3)&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;The ASPSP answered with a location link to the saved Payment/Transfer Request (cf. § 4.5.4)&lt;/li&gt;
&lt;li&gt;The PISP retrieved the saved Payment/Transfer Request (cf. § 4.5.4)&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The TPP and the ASPSP successfully processed a mutual check and authentication &lt;/li&gt;
&lt;li&gt;The TPP presented its &quot;OAUTH2 Client Credential&quot; access token.&lt;/li&gt;
&lt;li&gt;The TPP presented the payment/transfer request.&lt;/li&gt;
&lt;li&gt;The PSU was successfully authenticated.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Business flow&lt;/h3&gt;
the following cases can be applied:
&lt;ul&gt;
&lt;li&gt;Case of a payment with multiple instructions or a standing order, the PISP asks to cancel the whole Payment/Transfer or Standing Order Request including all non-executed payment instructions by setting the [paymentInformationStatus] to &quot;RJCT&quot; and the relevant [statusReasonInformation] to &quot;DS02&quot; at payment level.&lt;/li&gt;
&lt;li&gt;Case of a payment with multiple instructions, the PISP asks to cancel one or several payment instructions by setting the [transactionStatus] to &quot;RJCT&quot; and the relevant [statusReasonInformation] to &quot;DS02&quot; at each relevant instruction level.&lt;/li&gt;
&lt;/ul&gt;
Since the modification request needs a PSU authentication before committing, the modification request includes:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;The specification of the authentication approaches that are supported by the PISP (any combination of &quot;REDIRECT&quot;, &quot;EMBEDDED&quot; and &quot;DECOUPLED&quot; values).&lt;/li&gt;
&lt;li&gt;In case of possible REDIRECT or DECOUPLED authentication approach, one or two call-back URLs to be used by the ASPSP at the finalisation of the authentication and consent process :&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;The first call-back URL will be called by the ASPSP if the Transfer Request is processed without any error or rejection by the PSU&lt;/li&gt;
&lt;li&gt;The second call-back URL is to be used by the ASPSP in case of processing error or rejection by the PSU. Since this second URL is optional, the PISP might not provide it. In this case, the ASPSP will use the same URL for any processing result.&lt;/li&gt;
&lt;li&gt;Both call-back URLS must be used in a TLS-secured request.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;In case of possible &quot;EMBEDDED&quot; or &quot;DECOUPLED&quot; approaches, a PSU identifier that can be processed by the ASPSP for PSU recognition.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The ASPSP saves the updated Payment/Transfer Request and answers to the PISP. The answer embeds &lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;The specification of the chosen authentication approach taking into account both the PISP and the PSU capabilities.&lt;/li&gt;
&lt;li&gt;In case of chosen REDIRECT authentication approach, the URL to be used by the PISP for redirecting the PSU in order to perform an authentication.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;h3&gt;Authentication flows for both use cases&lt;/h3&gt;
&lt;h4&gt;Redirect authentication approach &lt;/h4&gt;
When the chosen authentication approach within the ASPSP answers is set to &quot;REDIRECT&quot;:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;The PISP redirects the PSU to the ASPSP which authenticates the PSU &lt;/li&gt;
&lt;li&gt;The ASPSP asks the PSU to give (or deny) his/her consent to the Payment Request global or partial Cancellation&lt;/li&gt;
&lt;li&gt;The ASPSP is then able to initiate the subsequent cancellation&lt;/li&gt;
&lt;li&gt;The ASPSP redirects the PSU to the PISP using one of the call-back URLs provided within the posted Payment Request cancellation&lt;/li&gt;
&lt;/ul&gt;
If the PSU neither gives nor denies his/her consent, the Cancellation Request shall expire and is then rejected to the PISP. The expiration delay is specified by each ASPSP.&lt;br&gt;
&lt;h4&gt;Decoupled authentication approach&lt;/h4&gt;
When the chosen authentication approach is &quot;DECOUPLED&quot;:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;Based on the PSU identifier provided within the Payment Request by the PISP, the ASPSP provides the PSU with the Cancellation Request details and challenges the PSU for a Strong Customer Authentication on a decoupled device or application.&lt;/li&gt;
&lt;li&gt;The PSU confirms or not the Payment Request global or partial Cancellation&lt;/li&gt;
&lt;li&gt;The ASPSP is then able to initiate the subsequent cancellation&lt;/li&gt;
&lt;li&gt;The ASPSP notifies the PISP about the finalisation of the authentication and cancellation process by using one of the call-back URLs provided within the posted Payment Request&lt;/li&gt;
&lt;/ul&gt;
If the PSU neither gives nor denies his/her consent, the Cancellation Request shall expire and is then rejected to the PISP. The expiration delay is specified by each ASPSP.&lt;br&gt;
&lt;h4&gt;Embedded authentication approach&lt;/h4&gt;
When the chosen authentication approach within the ASPSP answers is set to &quot;EMBEDDED&quot;:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;The TPP informs the PSU that a challenge is needed for completing the Payment Request cancellation processing. This challenge will be one of the following:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;A One-Time-Password sent by the ASPSP to the PSU on a separate device or application.&lt;/li&gt;
&lt;li&gt;A response computed by a specific device on base of a challenge sent by the ASPSP to the PSU on a separate device or application.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The PSU unlock the device or application through a &quot;knowledge factor&quot; and/or an &quot;inherence factor&quot; (biometric), retrieves the cancellation details.&lt;/li&gt;
&lt;li&gt;The PSU confirms or not the Payment Request global or partial Cancellation&lt;/li&gt;
&lt;li&gt;When agreeing the Payment Request cancellation, the PSU enters the resulting authentication factor through the PISP interface which will forward it to the ASPSP through a confirmation request (cf. § 4.7)&lt;/li&gt;
&lt;/ul&gt;
Case of the PSU neither gives nor denies his/her consent, the Cancellation Request shall expire and is then rejected to the PISP. The expiration delay is specified by each ASPSP.&lt;br&gt;
""",
json.parse("""{
"paymentInformationId" : "MyPmtInfId",
"creationDateTime" : "2018-03-31T13:25:22.527+02:00",
"numberOfTransactions" : 1,
"initiatingParty" : {
"name" : "MyPreferedPisp",
"postalAddress" : {
"country" : "FR",
"addressLine" : [ "18 rue de la DSP2", "75008 PARIS" ]
},
"organisationId" : {
"identification" : "12FR5",
"schemeName" : "COID",
"issuer" : "ACPR"
}
},
"paymentTypeInformation" : {
"serviceLevel" : "SEPA",
"localInstrument" : "INST",
"categoryPurpose" : "DVPM"
},
"debtor" : {
"name" : "MyCustomer",
"postalAddress" : {
"country" : "FR",
"addressLine" : [ "18 rue de la DSP2", "75008 PARIS" ]
},
"privateId" : {
"identification" : "FD37G",
"schemeName" : "BANK",
"issuer" : "BICXYYTTZZZ"
}
},
"creditor" : {
"name" : "myMerchant",
"postalAddress" : {
"country" : "FR",
"addressLine" : [ "18 rue de la DSP2", "75008 PARIS" ]
},
"organisationId" : {
"identification" : "852126789",
"schemeName" : "SIREN",
"issuer" : "FR"
}
},
"creditorAccount" : {
"iban" : "YY64COJH41059545330222956960771321"
},
"ultimateCreditor" : {
"name" : "myPreferedUltimateMerchant",
"postalAddress" : {
"country" : "FR",
"addressLine" : [ "18 rue de la DSP2", "75008 PARIS" ]
},
"organisationId" : {
"identification" : "85212678900025",
"schemeName" : "SIRET",
"issuer" : "FR"
}
},
"purpose" : "COMC",
"chargeBearer" : "SLEV",
"creditTransferTransaction" : [ {
"paymentId" : {
"instructionId" : "MyInstrId",
"endToEndId" : "MyEndToEndId"
},
"requestedExecutionDate" : "2016-12-31T00:00:00.000+01:00",
"instructedAmount" : {
"currency" : "EUR",
"amount" : "124.35"
},
"remittanceInformation" : [ "MyRemittanceInformation" ]
} ],
"supplementaryData" : {
"acceptedAuthenticationApproach" : [ "REDIRECT", "DECOUPLED" ],
"successfulReportUrl" : "http://myPisp/PaymentSuccess",
"unsuccessfulReportUrl" : "http://myPisp/PaymentFailure"
}
}"""),
json.parse("""{
"appliedAuthenticationApproach" : {
"appliedAuthenticationApproach" : "REDIRECT"
},
"_links" : {
"consentApproval" : {
"href" : "https://psd2.aspsp/consent-approval"
}
}
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("PISP") :: apiTagMockedData :: Nil
)
lazy val paymentRequestPut : OBPEndpoint = {
case "payment-requests" :: paymentrequestresourceid :: Nil JsonPut _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse("""{
"appliedAuthenticationApproach" : {
"appliedAuthenticationApproach" : "REDIRECT"
},
"_links" : {
"consentApproval" : {
"href" : "https://psd2.aspsp/consent-approval"
}
}
}"""), callContext)
}
}
}
resourceDocs += ResourceDoc(
paymentRequestsGet,
apiVersion,
nameOf(paymentRequestsGet),
"GET",
"/payment-requests/PAYMENTREQUESTRESOURCEID",
"Retrieval of a payment request (PISP)",
s"""${mockedDataText(true)}
&lt;h3&gt;Description&lt;/h3&gt;
The following use cases can be applied:
&lt;ul&gt;
&lt;li&gt;retrieval of a payment request on behalf of a merchant&lt;/li&gt;
&lt;li&gt;retrieval of a transfer request on behalf of the account&#39;s owner&lt;/li&gt;
&lt;li&gt;retrieval of a standing-order request on behalf of the account&#39;s owner&lt;/li&gt;
&lt;/ul&gt;
The PISP has sent a Request through a POST command. &lt;br&gt;
The ASPSP has registered the Request, updated if necessary the relevant identifiers in order to avoid duplicates and returned the location of the updated Request.&lt;br&gt;
The PISP gets the Request that has been updated with the resource identifiers, and eventually the status of the Payment/Transfer Request and the status of the subsequent credit transfer.&lt;br&gt;
&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The TPP has been registered by the Registration Authority for the PISP role&lt;/li&gt;
&lt;li&gt;The TPP was provided with an OAUTH2 &quot;Client Credential&quot; access token by the ASPSP (cf. § 3.4.3).&lt;/li&gt;
&lt;li&gt;The TPP has previously posted a Request which has been saved by the ASPSP (cf. § 4.5.3)&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;The ASPSP has answered with a location link to the saved Payment/Transfer Request (cf. § 4.5.4)&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The TPP and the ASPSP have successfully processed a mutual check and authentication &lt;/li&gt;
&lt;li&gt;The TPP has presented its &quot;OAUTH2 Client Credential&quot; access token&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Business flow&lt;/h3&gt;
The PISP asks to retrieve the Payment/Transfer Request that has been saved by the ASPSP. The PISP uses the location link provided by the ASPSP in response of the posting of this request.&lt;br&gt;
The ASPSP returns the previously posted Payment/Transfer Request which is enriched with:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;The resource identifiers given by the ASPSP&lt;/li&gt;
&lt;li&gt;The status information of the Payment Request and of the subsequent credit transfer&lt;/li&gt;
&lt;/ul&gt;
The status information must be available during at least 30 calendar days after the posting of the Payment Request. However, the ASPSP may increase this availability duration, based on its own rules.&lt;br&gt;
""",
json.parse(""""""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("PISP") :: apiTagMockedData :: Nil
)
lazy val paymentRequestsGet : OBPEndpoint = {
case "payment-requests" :: paymentrequestresourceid :: Nil JsonGet _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse(""""""), callContext)
}
}
}
resourceDocs += ResourceDoc(
paymentRequestsPost,
apiVersion,
nameOf(paymentRequestsPost),
"POST",
"/payment-requests",
"Payment request initiation (PISP)",
s"""${mockedDataText(true)}
&lt;h3&gt;Description&lt;/h3&gt;
The following use cases can be applied:
&lt;ul&gt;
&lt;li&gt;payment request on behalf of a merchant&lt;/li&gt;
&lt;li&gt;transfer request on behalf of the account&#39;s owner&lt;/li&gt;
&lt;li&gt;standing-order request on behalf of the account&#39;s owner&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Data content&lt;/h4&gt;
A payment request or a transfer request might embed several payment instructions having
&lt;ul&gt;
&lt;li&gt;one single execution date or multiple execution dates&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;case of one single execution date, this date must be set at the payment level&lt;/li&gt;
&lt;li&gt;case of multiple execution dates, those dates must be set at each payment instruction level&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;one single beneficiary or multiple beneficiaries&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;case of one single beneficiary, this beneficiary must be set at the payment level&lt;/li&gt;
&lt;li&gt;case of multiple beneficiaries, those beneficiaries must be set at each payment instruction level&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
Having at the same time multiple beneficiaries and multiple execution date might not be a relevant business case, although it is technically allowed.&lt;br/&gt;
Each implementation will have to specify which business use cases are actually supported.&lt;br/&gt;
A standing order request must embed one single payment instruction and must address one single beneficiary.
&lt;ul&gt;
&lt;li&gt;The beneficiary must be set at the payment level&lt;/li&gt;
&lt;li&gt;The standing order specific characteristics (start date, periodicity...) must be set at the instruction level&lt;/li&gt;
&lt;/ul&gt;
Payment request can rely for execution on different payment instruments:
- SEPA Credit Transfer (SCT)
- Domestic Credit Transfer in a non Euro-currency
- International payment
The following table indicates how to use the different fields, depending on the payment instrument:
&lt;table border&#x3D;&quot;1&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;td&gt;Structure&lt;/td&gt;
&lt;td&gt;SEPA payments&lt;/td&gt;
&lt;td&gt;Domestic payments in non-euro currency&lt;/td&gt;
&lt;td&gt;International payments&lt;/td&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PaymentTypeInformation/ InstructionPriority (payment
level)&lt;/td&gt;
&lt;td&gt;&quot;HIGH&quot; for high-priority SCT&lt;br /&gt;&quot;NORM&quot; for other SCT&lt;br /&gt;Ignored
for SCTInst
&lt;/td&gt;
&lt;td&gt;&quot;HIGH&quot; for high-priority CT&lt;br /&gt;&quot;NORM&quot; or ignored for
other CT&lt;br&gt;
&lt;/td&gt;
&lt;td&gt;&quot;HIGH&quot; for high-priority payments&lt;br /&gt;&quot;NORM&quot; or ignored
for other payments&lt;br&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PaymentTypeInformation/ ServiceLevel (payment level)&lt;/td&gt;
&lt;td&gt;&quot;SEPA&quot; for SCT and SCTInst&lt;/td&gt;
&lt;td&gt;ignored&lt;/td&gt;
&lt;td&gt;ignored&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PaymentTypeInformation/ CategoryPurpose (payment level)&lt;/td&gt;
&lt;td colspan&#x3D;&quot;2&quot;&gt;&quot;CASH&quot; for transfer request&lt;br /&gt;&quot;DVPM&quot; for
payment request on behalf of a merchant
&lt;/td&gt;
&lt;td&gt;&quot;CORT&quot; for generic international payments&lt;br /&gt;&quot;INTC&quot; for
transfers between two branches within the same company&lt;br /&gt;&quot;TREA&quot;
for treasury transfers
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PaymentTypeInformation/ LocalInstrument (payment level)&lt;/td&gt;
&lt;td&gt;&quot;INST&quot; pour les SCTInst&lt;br /&gt;Otherwise ignored
&lt;/td&gt;
&lt;td colspan&#x3D;&quot;2&quot;&gt;ignored or valued with ISO20022 external code
list values&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RequestedExecutionDate (either at payment or transaction
level)&lt;/td&gt;
&lt;td colspan&#x3D;&quot;3&quot;&gt;Mandatory (indicates the date on debit on the
ordering party account)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;InstructedAmount (at each transaction level)&lt;/td&gt;
&lt;td colspan&#x3D;&quot;3&quot;&gt;Mandatory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ChargeBearer (at each transaction level)&lt;/td&gt;
&lt;td&gt;&quot;SLEV&quot; for SCT and SCTInst&lt;/td&gt;
&lt;td&gt;&quot;SLEV&quot; or &quot;SHAR&quot;&lt;/td&gt;
&lt;td&gt;&quot;CRED&quot;, &quot;DEBT&quot; or &quot;SHAR&quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Purpose (at payment level)&lt;/td&gt;
&lt;td colspan&#x3D;&quot;3&quot;&gt;Optional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RegulatoryReportingCode (at each transaction level)&lt;/td&gt;
&lt;td colspan&#x3D;&quot;2&quot;&gt;Not used&lt;/td&gt;
&lt;td&gt;Mandatory (possibly multiple values)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RemittanceInformation&lt;/td&gt;
&lt;td colspan&#x3D;&quot;3&quot;&gt;Optional&lt;br /&gt;Unstructured&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Debtor (at payment level)&lt;/td&gt;
&lt;td&gt;Mandatory&lt;br /&gt;2 address lines only
&lt;/td&gt;
&lt;td colspan&#x3D;&quot;2&quot;&gt;Mandatory&lt;br /&gt;4 address lines only
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DebtorAccount (at payment level)&lt;/td&gt;
&lt;td&gt;Optional&lt;/td&gt;
&lt;td colspan&#x3D;&quot;2&quot;&gt;Optional&lt;br /&gt;Account currency may be
specified
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DebtorAgent (at payment level)&lt;/td&gt;
&lt;td colspan&#x3D;&quot;3&quot;&gt;Optional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Creditor (either at payment or transaction level)&lt;/td&gt;
&lt;td colspan&#x3D;&quot;3&quot;&gt;Mandatory&lt;br /&gt;2 address lines only
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CreditorAccount (either at payment or transaction level)&lt;/td&gt;
&lt;td&gt;Mandatory&lt;/td&gt;
&lt;td colspan&#x3D;&quot;2&quot;&gt;Mandatory&lt;br /&gt;Account currency may be
specified
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CreditorAgent (either at payment or transaction level)&lt;/td&gt;
&lt;td colspan&#x3D;&quot;3&quot;&gt;Optional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UltimateCreditor (either at payment or transaction level)&lt;/td&gt;
&lt;td colspan&#x3D;&quot;3&quot;&gt;Optional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ClearingSystemId et ClearingSystemMemberId (either at
payment or transaction level)&lt;/td&gt;
&lt;td colspan&#x3D;&quot;2&quot;&gt;Not used&lt;/td&gt;
&lt;td&gt;Optional&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br/&gt;
&lt;h4&gt;Prerequisites for all use cases&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;The TPP has been registered by the Registration Authority for the PISP role&lt;/li&gt;
&lt;li&gt;The TPP was provided with an OAUTH2 &quot;Client Credential&quot; access token by the ASPSP (cf. § 3.4.3).&lt;/li&gt;
&lt;li&gt;The TPP and the ASPSP have successfully processed a mutual check and authentication &lt;/li&gt;
&lt;li&gt;The TPP has presented its &quot;OAUTH2 Client Credential&quot; access token&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Business flow&lt;/h4&gt;
&lt;h5&gt;Payment Request use case&lt;/h5&gt;
The PISP forwards a payment request on behalf of a merchant.&lt;br&gt;
The PSU buys some goods or services on an e-commerce website held by a merchant. Among other payment method, the merchant suggests the use of a PISP service. As there is obviously a contract between the merchant and the PISP, there is no need of such a contract between the PSU and this PISP to initiate the process.&lt;br&gt;
Case of the PSU that chooses to use the PISP service:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;The merchant forwards the requested payment characteristics to the PISP and redirects the PSU to the PISP portal.&lt;/li&gt;
&lt;li&gt;The PISP requests from the PSU which ASPSP will be used.&lt;/li&gt;
&lt;li&gt;The PISP prepares the Payment Request and sends this request to the ASPSP.&lt;/li&gt;
&lt;li&gt;The Request can embed several payment instructions having different requested execution date.&lt;/li&gt;
&lt;li&gt;The beneficiary, as being the merchant, is set at the payment level.&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;Transfer Request use case&lt;/h5&gt;
The PISP forwards a transfer request on behalf of the owner of the account.
&lt;ul&gt;
&lt;li&gt;The PSU provides the PISP with all information needed for the transfer.&lt;/li&gt;
&lt;li&gt;The PISP prepares the Transfer Request and sends this request to the relevant ASPSP that holds the debtor account.&lt;/li&gt;
&lt;li&gt;The Request can embed several payment instructions having different beneficiaries.&lt;/li&gt;
&lt;li&gt;The requested execution date, as being the same for all instructions, is set at the payment level.&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;Standing Order Request use case&lt;/h5&gt;
The PISP forwards a Standing Order request on behalf of the owner of the account.
&lt;ul&gt;
&lt;li&gt;The PSU provides the PISP with all information needed for the Standing Order.&lt;/li&gt;
&lt;li&gt;The PISP prepares the Standing Order Request and sends this request to the relevant ASPSP that holds the debtor account.&lt;/li&gt;
&lt;li&gt;The Request embeds one single payment instruction with&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;The requested execution date of the first occurrence&lt;/li&gt;
&lt;li&gt;The requested execution frequency of the payment in order to compute further execution dates&lt;/li&gt;
&lt;li&gt;An execution rule to handle cases when the computed execution dates cannot be processed (e.g. bank holydays)&lt;/li&gt;
&lt;li&gt;An optional end date for closing the standing Order&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;h4&gt;Authentication flows for all use cases&lt;/h4&gt;
As the request posted by the PISP to the ASPSP needs a PSU authentication before execution, this request will include:
&lt;ul&gt;
&lt;li&gt;The specification of the authentication approaches that are supported by the PISP (any combination of &quot;REDIRECT&quot;, &quot;EMBEDDED&quot; and &quot;DECOUPLED&quot; values).&lt;/li&gt;
&lt;li&gt;In case of possible REDIRECT or DECOUPLED authentication approach, one or two call-back URLs to be used by the ASPSP at the finalisation of the authentication and consent process :&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;The first call-back URL will be called by the ASPSP if the Payment Request is processed without any error or rejection by the PSU&lt;/li&gt;
&lt;li&gt;The second call-back URL is to be used by the ASPSP in case of processing error or rejection by the PSU. Since this second URL is optional, the PISP might not provide it. In this case, the ASPSP will use the same URL for any processing result.&lt;/li&gt;
&lt;li&gt;Both call-back URLS must be used in a TLS-secured request.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;In case of possible &quot;EMBEDDED&quot; or &quot;DECOUPLED&quot; approaches, the PSU identifier that can be processed by the ASPSP for PSU recognition must have been set within the request body [debtor] structure.&lt;/li&gt;
&lt;/ul&gt;
The ASPSP saves the request and answers to the PISP. The answer embeds:
&lt;ul&gt;
&lt;li&gt;A location link of the saved Request that will be further used to retrieve the Request and its status information.&lt;/li&gt;
&lt;li&gt;The specification of the chosen authentication approach taking into account both the PISP and the PSU capabilities.&lt;/li&gt;
&lt;li&gt;In case of chosen REDIRECT authentication approach, the URL to be used by the PISP for redirecting the PSU in order to perform a authentication.&lt;/li&gt;
&lt;/ul&gt;
Case of the PSU neither gives nor denies his/her consent, the Request shall expire and is then rejected to the PISP. The expiration delay is specified by each ASPSP.&lt;br&gt;
&lt;h5&gt;Redirect authentication approach &lt;/h5&gt;
When the chosen authentication approach within the ASPSP answers is set to &quot;REDIRECT&quot;:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;The PISP redirects the PSU to the ASPSP which authenticates the PSU &lt;/li&gt;
&lt;li&gt;The ASPSP asks the PSU to give (or deny) his/her consent to the Payment Request&lt;/li&gt;
&lt;li&gt;The PSU chooses or confirms which of his/her accounts shall be used by the ASPSP for the future Credit Transfer.&lt;/li&gt;
&lt;li&gt;The ASPSP is then able to initiate the subsequent Credit Transfer&lt;/li&gt;
&lt;li&gt;The ASPSP redirects the PSU to the PISP using one of the call-back URLs provided within the posted Payment Request&lt;/li&gt;
&lt;/ul&gt;
&lt;img src&#x3D;&quot;https://www.stet.eu//assets/files/documents-api/pisp-redirect-authentication.png&quot; /&gt;
&lt;img src&#x3D;&quot;https://www.stet.eu//assets/files/documents-api/pisp-redirect-authentication2.png&quot; /&gt;
&lt;h5&gt;Decoupled authentication approach&lt;/h5&gt;
When the chosen authentication approach is &quot;DECOUPLED&quot;:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;Based on the PSU identifier provided within the Payment Request by the PISP, the ASPSP gives the PSU with the Payment Request details and challenges the PSU for a Strong Customer Authentication on a decoupled device or application.&lt;/li&gt;
&lt;li&gt;The PSU chooses or confirms which of his/her accounts shall be used by the ASPSP for the future Credit Transfer.&lt;/li&gt;
&lt;li&gt;The ASPSP is then able to initiate the subsequent Credit Transfer&lt;/li&gt;
&lt;li&gt;The ASPSP notifies the PISP about the finalisation of the authentication and consent process by using one of the call-back URLs provided within the posted Payment Request&lt;/li&gt;
&lt;/ul&gt;
&lt;img src&#x3D;&quot;https://www.stet.eu//assets/files/documents-api/pisp-decoupled-authentication.png&quot; /&gt;
&lt;img src&#x3D;&quot;https://www.stet.eu//assets/files/documents-api/pisp-decoupled-authentication2.png&quot; /&gt;
&lt;h5&gt;Embedded authentication approach&lt;/h5&gt;
When the chosen authentication approach within the ASPSP answers is set to &quot;EMBEDDED&quot;:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;The TPP informs the PSU that a challenge is needed for completing the Payment Request processing. This challenge will be one of the following:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;A One-Time-Password sent by the ASPSP to the PSU on a separate device or application.&lt;/li&gt;
&lt;li&gt;A response computed by a specific device on base of a challenge sent by the ASPSP to the PSU on a separate device or application.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The PSU unlock the device or application through a &quot;knowledge factor&quot; and/or an &quot;inherence factor&quot; (biometric), retrieves the Payment Request details and processes the data sent by the ASPSP; &lt;/li&gt;
&lt;li&gt;The PSU might choose or confirm which of his/her accounts shall be used by the ASPSP for the future Credit Transfer when the device or application allows it.&lt;/li&gt;
&lt;li&gt;When agreeing the Payment Request, the PSU enters the resulting authentication factor through the PISP interface which will forward it to the ASPSP through a confirmation request (cf. § 4.7)&lt;/li&gt;
&lt;/ul&gt;
&lt;img src&#x3D;&quot;https://www.stet.eu//assets/files/documents-api/pisp-embedded-authentication.png&quot; /&gt;
&lt;img src&#x3D;&quot;https://www.stet.eu//assets/files/documents-api/pisp-embedded-authentication2.png&quot; /&gt;
""",
json.parse("""{
"paymentInformationId" : "MyPmtInfId",
"creationDateTime" : "2018-03-31T13:25:22.527+02:00",
"numberOfTransactions" : 1,
"initiatingParty" : {
"name" : "MyPreferedPisp",
"postalAddress" : {
"country" : "FR",
"addressLine" : [ "18 rue de la DSP2", "75008 PARIS" ]
},
"organisationId" : {
"identification" : "12FR5",
"schemeName" : "COID",
"issuer" : "ACPR"
}
},
"paymentTypeInformation" : {
"serviceLevel" : "SEPA",
"localInstrument" : "INST",
"categoryPurpose" : "DVPM"
},
"debtor" : {
"name" : "MyCustomer",
"postalAddress" : {
"country" : "FR",
"addressLine" : [ "18 rue de la DSP2", "75008 PARIS" ]
},
"privateId" : {
"identification" : "FD37G",
"schemeName" : "BANK",
"issuer" : "BICXYYTTZZZ"
}
},
"creditor" : {
"name" : "myMerchant",
"postalAddress" : {
"country" : "FR",
"addressLine" : [ "18 rue de la DSP2", "75008 PARIS" ]
},
"organisationId" : {
"identification" : "852126789",
"schemeName" : "SIREN",
"issuer" : "FR"
}
},
"creditorAccount" : {
"iban" : "YY64COJH41059545330222956960771321"
},
"ultimateCreditor" : {
"name" : "myPreferedUltimateMerchant",
"postalAddress" : {
"country" : "FR",
"addressLine" : [ "18 rue de la DSP2", "75008 PARIS" ]
},
"organisationId" : {
"identification" : "85212678900025",
"schemeName" : "SIRET",
"issuer" : "FR"
}
},
"purpose" : "COMC",
"chargeBearer" : "SLEV",
"creditTransferTransaction" : [ {
"paymentId" : {
"instructionId" : "MyInstrId",
"endToEndId" : "MyEndToEndId"
},
"requestedExecutionDate" : "2016-12-31T00:00:00.000+01:00",
"instructedAmount" : {
"currency" : "EUR",
"amount" : "124.35"
},
"remittanceInformation" : [ "MyRemittanceInformation" ]
} ],
"supplementaryData" : {
"acceptedAuthenticationApproach" : [ "REDIRECT", "DECOUPLED" ],
"successfulReportUrl" : "http://myPisp/PaymentSuccess",
"unsuccessfulReportUrl" : "http://myPisp/PaymentFailure"
}
}"""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("PISP") :: apiTagMockedData :: Nil
)
lazy val paymentRequestsPost : OBPEndpoint = {
case "payment-requests" :: Nil JsonPost _ => {
cc =>
for {
(Full(u), callContext) <- authorizeEndpoint(UserNotLoggedIn, cc)
} yield {
(json.parse(""""""), callContext)
}
}
}
}

View File

@ -18,12 +18,9 @@ import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
trait APIMethods_UKOpenBanking_200 {
//needs to be a RestHelper to get access to JsonGet, JsonPost, etc.
self: RestHelper =>
object APIMethods_UKOpenBanking_200 extends RestHelper{
val ImplementationsUKOpenBanking200 = new Object() {
val implementedInApiVersion: ApiVersion = ApiVersion.ukOpenBankingV200 // was noV
val implementedInApiVersion = OBP_UKOpenBanking_200.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
@ -238,9 +235,6 @@ trait APIMethods_UKOpenBanking_200 {
}
}
}
}
}

View File

@ -28,11 +28,11 @@ package code.api.UKOpenBanking.v2_0_0
import code.api.OBPRestHelper
import code.api.util.APIUtil.{OBPEndpoint, ResourceDoc, getAllowedEndpoints}
import code.api.util.ApiVersion
import code.api.util.{ScannedApiVersion, ScannedApis}
import code.util.Helper.MdcLoggable
import scala.collection.immutable.Nil
import code.api.UKOpenBanking.v2_0_0.APIMethods_UKOpenBanking_200._
/*
@ -40,32 +40,32 @@ This file defines which endpoints from all the versions are available in v1
*/
object OBP_UKOpenBanking_200 extends OBPRestHelper with APIMethods_UKOpenBanking_200 with MdcLoggable {
object OBP_UKOpenBanking_200 extends OBPRestHelper with MdcLoggable with ScannedApis{
val version = ApiVersion.ukOpenBankingV200
override val apiVersion = ScannedApiVersion("open-banking", "UK", "v2.0")
val versionStatus = "DRAFT"
val endpointsOf200 =
ImplementationsUKOpenBanking200.getAccountList ::
ImplementationsUKOpenBanking200.getAccountTransactions ::
ImplementationsUKOpenBanking200.getAccount ::
ImplementationsUKOpenBanking200.getAccountBalances ::
ImplementationsUKOpenBanking200.getBalances ::
Nil
val allEndpoints =
getAccountList ::
getAccountTransactions ::
getAccount ::
getAccountBalances ::
getBalances ::
Nil
val allResourceDocs = ImplementationsUKOpenBanking200.resourceDocs
override val allResourceDocs = resourceDocs
def findResourceDoc(pf: OBPEndpoint): Option[ResourceDoc] = {
allResourceDocs.find(_.partialFunction==pf)
}
// Filter the possible endpoints by the disabled / enabled Props settings and add them together
val routes : List[OBPEndpoint] = getAllowedEndpoints(endpointsOf200, ImplementationsUKOpenBanking200.resourceDocs)
override val routes : List[OBPEndpoint] = getAllowedEndpoints(allEndpoints,resourceDocs)
// Make them available for use!
routes.foreach(route => {
oauthServe(("open-banking" / version.vDottedApiVersion()).oPrefix{route}, findResourceDoc(route))
oauthServe((apiVersion.urlPrefix / version.vDottedApiVersion()).oPrefix{route}, findResourceDoc(route))
})
logger.info(s"version $version has been run! There are ${routes.length} routes.")

View File

@ -1,27 +1,33 @@
package code.api.UKOpenBanking.v3_1_0
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
import code.api.util.APIUtil._
import code.api.util.ApiTag._
import code.api.util.ApiVersion
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 code.api.berlin.group.v1_3.JSONFactory_BERLIN_GROUP_1_3
import code.api.util.APIUtil.{defaultBankId, _}
import code.api.util.{ApiVersion, NewStyle}
import code.api.util.ErrorMessages._
import code.api.util.ApiTag._
import code.api.util.NewStyle.HttpCode
import code.bankconnectors.Connector
import code.model._
import code.util.Helper
import code.views.Views
import net.liftweb.common.Full
import net.liftweb.http.rest.RestHelper
import com.github.dwickern.macros.NameOf.nameOf
import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_AccountAccessApi { self: RestHelper =>
val ImplementationsAccountAccessApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_AccountAccessApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -67,7 +73,7 @@ trait APIMethods_AccountAccessApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagAccountAccess :: apiTagMockedData :: Nil
ApiTag("Account Access") :: apiTagMockedData :: Nil
)
lazy val createAccountAccessConsents : OBPEndpoint = {
@ -117,7 +123,7 @@ trait APIMethods_AccountAccessApi { self: RestHelper =>
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagAccountAccess :: apiTagMockedData :: Nil
ApiTag("Account Access") :: apiTagMockedData :: Nil
)
lazy val deleteAccountAccessConsentsConsentId : OBPEndpoint = {
@ -167,7 +173,7 @@ trait APIMethods_AccountAccessApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagAccountAccess :: apiTagMockedData :: Nil
ApiTag("Account Access") :: apiTagMockedData :: Nil
)
lazy val getAccountAccessConsentsConsentId : OBPEndpoint = {
@ -204,7 +210,6 @@ trait APIMethods_AccountAccessApi { self: RestHelper =>
}
}
}
}

View File

@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_AccountsApi { self: RestHelper =>
val ImplementationsAccountsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_AccountsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -109,7 +108,7 @@ trait APIMethods_AccountsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagAccounts :: apiTagMockedData :: Nil
ApiTag("Accounts") :: apiTagMockedData :: Nil
)
lazy val getAccounts : OBPEndpoint = {
@ -254,7 +253,7 @@ trait APIMethods_AccountsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagAccounts :: apiTagMockedData :: Nil
ApiTag("Accounts") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountId : OBPEndpoint = {
@ -327,7 +326,6 @@ trait APIMethods_AccountsApi { self: RestHelper =>
}
}
}
}

View File

@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_BalancesApi { self: RestHelper =>
val ImplementationsBalancesApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_BalancesApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -113,7 +112,7 @@ trait APIMethods_BalancesApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagBalances :: apiTagMockedData :: Nil
ApiTag("Balances") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdBalances : OBPEndpoint = {
@ -266,7 +265,7 @@ trait APIMethods_BalancesApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagBalances :: apiTagMockedData :: Nil
ApiTag("Balances") :: apiTagMockedData :: Nil
)
lazy val getBalances : OBPEndpoint = {
@ -343,7 +342,6 @@ trait APIMethods_BalancesApi { self: RestHelper =>
}
}
}
}

View File

@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_BeneficiariesApi { self: RestHelper =>
val ImplementationsBeneficiariesApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_BeneficiariesApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -119,7 +118,7 @@ trait APIMethods_BeneficiariesApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagBeneficiaries :: apiTagMockedData :: Nil
ApiTag("Beneficiaries") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdBeneficiaries : OBPEndpoint = {
@ -284,7 +283,7 @@ trait APIMethods_BeneficiariesApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagBeneficiaries :: apiTagMockedData :: Nil
ApiTag("Beneficiaries") :: apiTagMockedData :: Nil
)
lazy val getBeneficiaries : OBPEndpoint = {
@ -367,7 +366,6 @@ trait APIMethods_BeneficiariesApi { self: RestHelper =>
}
}
}
}

View File

@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_DirectDebitsApi { self: RestHelper =>
val ImplementationsDirectDebitsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_DirectDebitsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -87,7 +86,7 @@ trait APIMethods_DirectDebitsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDirectDebits :: apiTagMockedData :: Nil
ApiTag("Direct Debits") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdDirectDebits : OBPEndpoint = {
@ -188,7 +187,7 @@ trait APIMethods_DirectDebitsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDirectDebits :: apiTagMockedData :: Nil
ApiTag("Direct Debits") :: apiTagMockedData :: Nil
)
lazy val getDirectDebits : OBPEndpoint = {
@ -239,7 +238,6 @@ trait APIMethods_DirectDebitsApi { self: RestHelper =>
}
}
}
}

View File

@ -1,9 +1,10 @@
package code.api.builder.DomesticPaymentsApi
package code.api.UKOpenBanking.v3_1_0
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
import net.liftweb.json
import net.liftweb.json._
import code.api.berlin.group.v1_3.JSONFactory_BERLIN_GROUP_1_3
import code.api.util.APIUtil.{defaultBankId, _}
import code.api.util.{ApiVersion, NewStyle}
import code.api.util.ErrorMessages._
@ -20,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_DomesticPaymentsApi { self: RestHelper =>
val ImplementationsDomesticPaymentsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_DomesticPaymentsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -143,7 +143,7 @@ trait APIMethods_DomesticPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticPayments :: apiTagMockedData :: Nil
ApiTag("Domestic Payments") :: apiTagMockedData :: Nil
)
lazy val createDomesticPaymentConsents : OBPEndpoint = {
@ -341,7 +341,7 @@ trait APIMethods_DomesticPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticPayments :: apiTagMockedData :: Nil
ApiTag("Domestic Payments") :: apiTagMockedData :: Nil
)
lazy val createDomesticPayments : OBPEndpoint = {
@ -539,7 +539,7 @@ trait APIMethods_DomesticPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticPayments :: apiTagMockedData :: Nil
ApiTag("Domestic Payments") :: apiTagMockedData :: Nil
)
lazy val getDomesticPaymentConsentsConsentId : OBPEndpoint = {
@ -676,7 +676,7 @@ trait APIMethods_DomesticPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticPayments :: apiTagMockedData :: Nil
ApiTag("Domestic Payments") :: apiTagMockedData :: Nil
)
lazy val getDomesticPaymentConsentsConsentIdFundsConfirmation : OBPEndpoint = {
@ -802,7 +802,7 @@ trait APIMethods_DomesticPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticPayments :: apiTagMockedData :: Nil
ApiTag("Domestic Payments") :: apiTagMockedData :: Nil
)
lazy val getDomesticPaymentsDomesticPaymentId : OBPEndpoint = {
@ -896,7 +896,6 @@ trait APIMethods_DomesticPaymentsApi { self: RestHelper =>
}
}
}
}

View File

@ -1,27 +1,33 @@
package code.api.builder.DomesticScheduledPaymentsApi
package code.api.UKOpenBanking.v3_1_0
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
import code.api.util.APIUtil._
import code.api.util.ApiTag._
import code.api.util.ApiVersion
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 code.api.berlin.group.v1_3.JSONFactory_BERLIN_GROUP_1_3
import code.api.util.APIUtil.{defaultBankId, _}
import code.api.util.{ApiVersion, NewStyle}
import code.api.util.ErrorMessages._
import code.api.util.ApiTag._
import code.api.util.NewStyle.HttpCode
import code.bankconnectors.Connector
import code.model._
import code.util.Helper
import code.views.Views
import net.liftweb.common.Full
import net.liftweb.http.rest.RestHelper
import com.github.dwickern.macros.NameOf.nameOf
import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_DomesticScheduledPaymentsApi { self: RestHelper =>
val ImplementationsDomesticScheduledPaymentsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_DomesticScheduledPaymentsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -138,7 +144,7 @@ trait APIMethods_DomesticScheduledPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticScheduledPayments :: apiTagMockedData :: Nil
ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil
)
lazy val createDomesticScheduledPaymentConsents : OBPEndpoint = {
@ -339,7 +345,7 @@ trait APIMethods_DomesticScheduledPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticScheduledPayments :: apiTagMockedData :: Nil
ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil
)
lazy val createDomesticScheduledPayments : OBPEndpoint = {
@ -540,7 +546,7 @@ trait APIMethods_DomesticScheduledPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticScheduledPayments :: apiTagMockedData :: Nil
ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil
)
lazy val getDomesticScheduledPaymentConsentsConsentId : OBPEndpoint = {
@ -741,7 +747,7 @@ trait APIMethods_DomesticScheduledPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticScheduledPayments :: apiTagMockedData :: Nil
ApiTag("Domestic Scheduled Payments") :: apiTagMockedData :: Nil
)
lazy val getDomesticScheduledPaymentsDomesticScheduledPaymentId : OBPEndpoint = {
@ -836,7 +842,6 @@ trait APIMethods_DomesticScheduledPaymentsApi { self: RestHelper =>
}
}
}
}

View File

@ -1,9 +1,10 @@
package code.api.builder.DomesticStandingOrdersApi
package code.api.UKOpenBanking.v3_1_0
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
import net.liftweb.json
import net.liftweb.json._
import code.api.berlin.group.v1_3.JSONFactory_BERLIN_GROUP_1_3
import code.api.util.APIUtil.{defaultBankId, _}
import code.api.util.{ApiVersion, NewStyle}
import code.api.util.ErrorMessages._
@ -20,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_DomesticStandingOrdersApi { self: RestHelper =>
val ImplementationsDomesticStandingOrdersApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_DomesticStandingOrdersApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -135,7 +135,7 @@ trait APIMethods_DomesticStandingOrdersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticStandingOrders :: apiTagMockedData :: Nil
ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil
)
lazy val createDomesticStandingOrderConsents : OBPEndpoint = {
@ -318,7 +318,7 @@ trait APIMethods_DomesticStandingOrdersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticStandingOrders :: apiTagMockedData :: Nil
ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil
)
lazy val createDomesticStandingOrders : OBPEndpoint = {
@ -501,7 +501,7 @@ trait APIMethods_DomesticStandingOrdersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticStandingOrders :: apiTagMockedData :: Nil
ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil
)
lazy val getDomesticStandingOrderConsentsConsentId : OBPEndpoint = {
@ -684,7 +684,7 @@ trait APIMethods_DomesticStandingOrdersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagDomesticStandingOrders :: apiTagMockedData :: Nil
ApiTag("Domestic Standing Orders") :: apiTagMockedData :: Nil
)
lazy val getDomesticStandingOrdersDomesticStandingOrderId : OBPEndpoint = {
@ -770,7 +770,6 @@ trait APIMethods_DomesticStandingOrdersApi { self: RestHelper =>
}
}
}
}

View File

@ -1,9 +1,10 @@
package code.api.builder.FilePaymentsApi
package code.api.UKOpenBanking.v3_1_0
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
import net.liftweb.json
import net.liftweb.json._
import code.api.berlin.group.v1_3.JSONFactory_BERLIN_GROUP_1_3
import code.api.util.APIUtil.{defaultBankId, _}
import code.api.util.{ApiVersion, NewStyle}
import code.api.util.ErrorMessages._
@ -20,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_FilePaymentsApi { self: RestHelper =>
val ImplementationsFilePaymentsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_FilePaymentsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -112,7 +112,7 @@ trait APIMethods_FilePaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagFilePayments :: apiTagMockedData :: Nil
ApiTag("File Payments") :: apiTagMockedData :: Nil
)
lazy val createFilePaymentConsents : OBPEndpoint = {
@ -197,7 +197,7 @@ trait APIMethods_FilePaymentsApi { self: RestHelper =>
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagFilePayments :: apiTagMockedData :: Nil
ApiTag("File Payments") :: apiTagMockedData :: Nil
)
lazy val createFilePaymentConsentsConsentIdFile : OBPEndpoint = {
@ -285,7 +285,7 @@ trait APIMethods_FilePaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagFilePayments :: apiTagMockedData :: Nil
ApiTag("File Payments") :: apiTagMockedData :: Nil
)
lazy val createFilePayments : OBPEndpoint = {
@ -431,7 +431,7 @@ trait APIMethods_FilePaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagFilePayments :: apiTagMockedData :: Nil
ApiTag("File Payments") :: apiTagMockedData :: Nil
)
lazy val getFilePaymentConsentsConsentId : OBPEndpoint = {
@ -516,7 +516,7 @@ trait APIMethods_FilePaymentsApi { self: RestHelper =>
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagFilePayments :: apiTagMockedData :: Nil
ApiTag("File Payments") :: apiTagMockedData :: Nil
)
lazy val getFilePaymentConsentsConsentIdFile : OBPEndpoint = {
@ -604,7 +604,7 @@ trait APIMethods_FilePaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagFilePayments :: apiTagMockedData :: Nil
ApiTag("File Payments") :: apiTagMockedData :: Nil
)
lazy val getFilePaymentsFilePaymentId : OBPEndpoint = {
@ -692,7 +692,7 @@ trait APIMethods_FilePaymentsApi { self: RestHelper =>
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagFilePayments :: apiTagMockedData :: Nil
ApiTag("File Payments") :: apiTagMockedData :: Nil
)
lazy val getFilePaymentsFilePaymentIdReportFile : OBPEndpoint = {
@ -706,7 +706,6 @@ trait APIMethods_FilePaymentsApi { self: RestHelper =>
}
}
}
}

View File

@ -1,9 +1,10 @@
package code.api.builder.FundsConfirmationsApi
package code.api.UKOpenBanking.v3_1_0
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
import net.liftweb.json
import net.liftweb.json._
import code.api.berlin.group.v1_3.JSONFactory_BERLIN_GROUP_1_3
import code.api.util.APIUtil.{defaultBankId, _}
import code.api.util.{ApiVersion, NewStyle}
import code.api.util.ErrorMessages._
@ -20,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_FundsConfirmationsApi { self: RestHelper =>
val ImplementationsFundsConfirmationsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_FundsConfirmationsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -76,7 +76,7 @@ trait APIMethods_FundsConfirmationsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagFundsConfirmations :: apiTagMockedData :: Nil
ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil
)
lazy val createFundsConfirmationConsents : OBPEndpoint = {
@ -151,7 +151,7 @@ trait APIMethods_FundsConfirmationsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagFundsConfirmations :: apiTagMockedData :: Nil
ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil
)
lazy val createFundsConfirmations : OBPEndpoint = {
@ -201,7 +201,7 @@ trait APIMethods_FundsConfirmationsApi { self: RestHelper =>
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagFundsConfirmations :: apiTagMockedData :: Nil
ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil
)
lazy val deleteFundsConfirmationConsentsConsentId : OBPEndpoint = {
@ -253,7 +253,7 @@ trait APIMethods_FundsConfirmationsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagFundsConfirmations :: apiTagMockedData :: Nil
ApiTag("Funds Confirmations") :: apiTagMockedData :: Nil
)
lazy val getFundsConfirmationConsentsConsentId : OBPEndpoint = {
@ -292,7 +292,6 @@ trait APIMethods_FundsConfirmationsApi { self: RestHelper =>
}
}
}
}

View File

@ -1,4 +1,4 @@
package code.api.builder.InternationalPaymentsApi
package code.api.UKOpenBanking.v3_1_0
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_InternationalPaymentsApi { self: RestHelper =>
val ImplementationsInternationalPaymentsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_InternationalPaymentsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -180,7 +179,7 @@ trait APIMethods_InternationalPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalPayments :: apiTagMockedData :: Nil
ApiTag("International Payments") :: apiTagMockedData :: Nil
)
lazy val createInternationalPaymentConsents : OBPEndpoint = {
@ -450,7 +449,7 @@ trait APIMethods_InternationalPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalPayments :: apiTagMockedData :: Nil
ApiTag("International Payments") :: apiTagMockedData :: Nil
)
lazy val createInternationalPayments : OBPEndpoint = {
@ -720,7 +719,7 @@ trait APIMethods_InternationalPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalPayments :: apiTagMockedData :: Nil
ApiTag("International Payments") :: apiTagMockedData :: Nil
)
lazy val getInternationalPaymentConsentsConsentId : OBPEndpoint = {
@ -893,7 +892,7 @@ trait APIMethods_InternationalPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalPayments :: apiTagMockedData :: Nil
ApiTag("International Payments") :: apiTagMockedData :: Nil
)
lazy val getInternationalPaymentConsentsConsentIdFundsConfirmation : OBPEndpoint = {
@ -1055,7 +1054,7 @@ trait APIMethods_InternationalPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalPayments :: apiTagMockedData :: Nil
ApiTag("International Payments") :: apiTagMockedData :: Nil
)
lazy val getInternationalPaymentsInternationalPaymentId : OBPEndpoint = {
@ -1185,7 +1184,6 @@ trait APIMethods_InternationalPaymentsApi { self: RestHelper =>
}
}
}
}

View File

@ -1,4 +1,4 @@
package code.api.builder.InternationalScheduledPaymentsApi
package code.api.UKOpenBanking.v3_1_0
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_InternationalScheduledPaymentsApi { self: RestHelper =>
val ImplementationsInternationalScheduledPaymentsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_InternationalScheduledPaymentsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -182,7 +181,7 @@ trait APIMethods_InternationalScheduledPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalScheduledPayments :: apiTagMockedData :: Nil
ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil
)
lazy val createInternationalScheduledPaymentConsents : OBPEndpoint = {
@ -455,7 +454,7 @@ trait APIMethods_InternationalScheduledPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalScheduledPayments :: apiTagMockedData :: Nil
ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil
)
lazy val createInternationalScheduledPayments : OBPEndpoint = {
@ -728,7 +727,7 @@ trait APIMethods_InternationalScheduledPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalScheduledPayments :: apiTagMockedData :: Nil
ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil
)
lazy val getInternationalScheduledPaymentConsentsConsentId : OBPEndpoint = {
@ -903,7 +902,7 @@ trait APIMethods_InternationalScheduledPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalScheduledPayments :: apiTagMockedData :: Nil
ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil
)
lazy val getInternationalScheduledPaymentConsentsConsentIdFundsConfirmation : OBPEndpoint = {
@ -1066,7 +1065,7 @@ trait APIMethods_InternationalScheduledPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalScheduledPayments :: apiTagMockedData :: Nil
ApiTag("International Scheduled Payments") :: apiTagMockedData :: Nil
)
lazy val getInternationalScheduledPaymentsInternationalScheduledPaymentId : OBPEndpoint = {
@ -1197,7 +1196,6 @@ trait APIMethods_InternationalScheduledPaymentsApi { self: RestHelper =>
}
}
}
}

View File

@ -1,4 +1,4 @@
package code.api.builder.InternationalStandingOrdersApi
package code.api.UKOpenBanking.v3_1_0
import code.api.APIFailureNewStyle
import code.api.berlin.group.v1_3.JvalueCaseClass
@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_InternationalStandingOrdersApi { self: RestHelper =>
val ImplementationsInternationalStandingOrdersApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_InternationalStandingOrdersApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -163,7 +162,7 @@ trait APIMethods_InternationalStandingOrdersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalStandingOrders :: apiTagMockedData :: Nil
ApiTag("International Standing Orders") :: apiTagMockedData :: Nil
)
lazy val createInternationalStandingOrderConsents : OBPEndpoint = {
@ -400,7 +399,7 @@ trait APIMethods_InternationalStandingOrdersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalStandingOrders :: apiTagMockedData :: Nil
ApiTag("International Standing Orders") :: apiTagMockedData :: Nil
)
lazy val createInternationalStandingOrders : OBPEndpoint = {
@ -637,7 +636,7 @@ trait APIMethods_InternationalStandingOrdersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalStandingOrders :: apiTagMockedData :: Nil
ApiTag("International Standing Orders") :: apiTagMockedData :: Nil
)
lazy val getInternationalStandingOrderConsentsConsentId : OBPEndpoint = {
@ -874,7 +873,7 @@ trait APIMethods_InternationalStandingOrdersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagInternationalStandingOrders :: apiTagMockedData :: Nil
ApiTag("International Standing Orders") :: apiTagMockedData :: Nil
)
lazy val getInternationalStandingOrdersInternationalStandingOrderPaymentId : OBPEndpoint = {
@ -987,7 +986,6 @@ trait APIMethods_InternationalStandingOrdersApi { self: RestHelper =>
}
}
}
}

View File

@ -32,101 +32,85 @@
package code.api.UKOpenBanking.v3_1_0
import code.api.OBPRestHelper
import code.api.builder.DomesticPaymentsApi.APIMethods_DomesticPaymentsApi
import code.api.builder.DomesticScheduledPaymentsApi.APIMethods_DomesticScheduledPaymentsApi
import code.api.builder.DomesticStandingOrdersApi.APIMethods_DomesticStandingOrdersApi
import code.api.builder.FilePaymentsApi.APIMethods_FilePaymentsApi
import code.api.builder.FundsConfirmationsApi.APIMethods_FundsConfirmationsApi
import code.api.builder.InternationalPaymentsApi.APIMethods_InternationalPaymentsApi
import code.api.builder.InternationalScheduledPaymentsApi.APIMethods_InternationalScheduledPaymentsApi
import code.api.builder.InternationalStandingOrdersApi.APIMethods_InternationalStandingOrdersApi
import code.api.builder.AccountInformationServiceAISApi.APIMethods_AccountInformationServiceAISApi
import code.api.builder.CommonServicesApi.APIMethods_CommonServicesApi
import code.api.builder.ConfirmationOfFundsServicePIISApi.APIMethods_ConfirmationOfFundsServicePIISApi
import code.api.builder.PaymentInitiationServicePISApi.APIMethods_PaymentInitiationServicePISApi
import code.api.builder.SigningBasketsApi.APIMethods_SigningBasketsApi
import code.api.util.APIUtil.{OBPEndpoint, ResourceDoc, getAllowedEndpoints}
import code.api.util.ApiVersion
import code.api.util.{APIUtil, ApiVersion, ScannedApiVersion, ScannedApis}
import code.util.Helper.MdcLoggable
import scala.collection.immutable.Nil
import code.api.UKOpenBanking.v3_1_0.APIMethods_FundsConfirmationsApi
import scala.collection.mutable.ArrayBuffer
/*
This file defines which endpoints from all the versions are available in v1
*/
object OBP_UKOpenBanking_310 extends OBPRestHelper with MdcLoggable
with APIMethods_AccountAccessApi
with APIMethods_AccountsApi
with APIMethods_BalancesApi
with APIMethods_BeneficiariesApi
with APIMethods_DirectDebitsApi
with APIMethods_OffersApi
with APIMethods_PartysApi
with APIMethods_ProductsApi
with APIMethods_ScheduledPaymentsApi
with APIMethods_StandingOrdersApi
with APIMethods_StatementsApi
with APIMethods_TransactionsApi
with APIMethods_DomesticPaymentsApi
with APIMethods_DomesticScheduledPaymentsApi
with APIMethods_DomesticStandingOrdersApi
with APIMethods_FilePaymentsApi
with APIMethods_InternationalPaymentsApi
with APIMethods_InternationalScheduledPaymentsApi
with APIMethods_InternationalStandingOrdersApi
with APIMethods_FundsConfirmationsApi{
val version = ApiVersion.ukOpenBankingV310
object OBP_UKOpenBanking_310 extends OBPRestHelper with MdcLoggable with ScannedApis {
//please modify these three parameter if it is not correct.
override val apiVersion = ScannedApiVersion("open-banking", "UK", "v3.1")
val versionStatus = "DRAFT"
val endpointsOf1_3 =
ImplementationsAccountAccessApi.endpoints ++
ImplementationsAccountsApi.endpoints ++
ImplementationsBalancesApi.endpoints ++
ImplementationsBeneficiariesApi.endpoints ++
ImplementationsDirectDebitsApi.endpoints ++
ImplementationsOffersApi.endpoints ++
ImplementationsPartysApi.endpoints ++
ImplementationsProductsApi.endpoints ++
ImplementationsDomesticPaymentsApi.endpoints ++
ImplementationsDomesticScheduledPaymentsApi.endpoints ++
ImplementationsDomesticStandingOrdersApi.endpoints ++
ImplementationsFilePaymentsApi.endpoints ++
ImplementationsInternationalPaymentsApi.endpoints ++
ImplementationsInternationalScheduledPaymentsApi.endpoints ++
ImplementationsInternationalStandingOrdersApi.endpoints ++
ImplementationsFundsConfirmationsApi.endpoints
val allResourceDocs =
ImplementationsAccountAccessApi.resourceDocs ++
ImplementationsAccountsApi.resourceDocs ++
ImplementationsBalancesApi.resourceDocs ++
ImplementationsBeneficiariesApi.resourceDocs ++
ImplementationsDirectDebitsApi.resourceDocs ++
ImplementationsOffersApi.resourceDocs ++
ImplementationsPartysApi.resourceDocs ++
ImplementationsProductsApi.resourceDocs ++
ImplementationsScheduledPaymentsApi.resourceDocs ++
ImplementationsDomesticPaymentsApi.resourceDocs ++
ImplementationsDomesticScheduledPaymentsApi.resourceDocs ++
ImplementationsDomesticStandingOrdersApi.resourceDocs ++
ImplementationsFilePaymentsApi.resourceDocs ++
ImplementationsInternationalPaymentsApi.resourceDocs ++
ImplementationsInternationalScheduledPaymentsApi.resourceDocs ++
ImplementationsInternationalStandingOrdersApi.resourceDocs ++
ImplementationsFundsConfirmationsApi.resourceDocs
def findResourceDoc(pf: OBPEndpoint): Option[ResourceDoc] = {
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
private[this] def findResourceDoc(pf: OBPEndpoint): Option[ResourceDoc] = {
allResourceDocs.find(_.partialFunction==pf)
}
// Filter the possible endpoints by the disabled / enabled Props settings and add them together
val routes : List[OBPEndpoint] = getAllowedEndpoints(endpointsOf1_3, allResourceDocs)
override val routes : List[OBPEndpoint] = getAllowedEndpoints(endpoints, allResourceDocs)
// Make them available for use!
routes.foreach(route => {
oauthServe(("open-banking" / version.vDottedApiVersion()).oPrefix{route}, findResourceDoc(route))
oauthServe((apiVersion.urlPrefix / version.vDottedApiVersion()).oPrefix{route}, findResourceDoc(route))
})
logger.info(s"version $version has been run! There are ${routes.length} routes.")
}

View File

@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_OffersApi { self: RestHelper =>
val ImplementationsOffersApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_OffersApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -103,7 +102,7 @@ trait APIMethods_OffersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagOffers :: apiTagMockedData :: Nil
ApiTag("Offers") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdOffers : OBPEndpoint = {
@ -236,7 +235,7 @@ trait APIMethods_OffersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagOffers :: apiTagMockedData :: Nil
ApiTag("Offers") :: apiTagMockedData :: Nil
)
lazy val getOffers : OBPEndpoint = {
@ -303,7 +302,6 @@ trait APIMethods_OffersApi { self: RestHelper =>
}
}
}
}

View File

@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_PartysApi { self: RestHelper =>
val ImplementationsPartysApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_PartysApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -92,7 +91,7 @@ trait APIMethods_PartysApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagPartys :: apiTagMockedData :: Nil
ApiTag("Partys") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdParty : OBPEndpoint = {
@ -203,7 +202,7 @@ trait APIMethods_PartysApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagPartys :: apiTagMockedData :: Nil
ApiTag("Partys") :: apiTagMockedData :: Nil
)
lazy val getParty : OBPEndpoint = {
@ -259,7 +258,6 @@ trait APIMethods_PartysApi { self: RestHelper =>
}
}
}
}

View File

@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_ProductsApi { self: RestHelper =>
val ImplementationsProductsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_ProductsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -49,7 +48,7 @@ trait APIMethods_ProductsApi { self: RestHelper =>
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagProducts :: apiTagMockedData :: Nil
ApiTag("Products") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdProduct : OBPEndpoint = {
@ -70,12 +69,13 @@ trait APIMethods_ProductsApi { self: RestHelper =>
"GET",
"/products",
"Get Products",
s"""${mockedDataText(true)}""",
s"""${mockedDataText(true)}
""",
json.parse(""""""),
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagProducts :: apiTagMockedData :: Nil
ApiTag("Products") :: apiTagMockedData :: Nil
)
lazy val getProducts : OBPEndpoint = {
@ -89,7 +89,6 @@ trait APIMethods_ProductsApi { self: RestHelper =>
}
}
}
}

View File

@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_ScheduledPaymentsApi { self: RestHelper =>
val ImplementationsScheduledPaymentsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_ScheduledPaymentsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -105,7 +104,7 @@ trait APIMethods_ScheduledPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagScheduledPayments :: apiTagMockedData :: Nil
ApiTag("Scheduled Payments") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdScheduledPayments : OBPEndpoint = {
@ -242,7 +241,7 @@ trait APIMethods_ScheduledPaymentsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagScheduledPayments :: apiTagMockedData :: Nil
ApiTag("Scheduled Payments") :: apiTagMockedData :: Nil
)
lazy val getScheduledPayments : OBPEndpoint = {
@ -311,7 +310,6 @@ trait APIMethods_ScheduledPaymentsApi { self: RestHelper =>
}
}
}
}

View File

@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_StandingOrdersApi { self: RestHelper =>
val ImplementationsStandingOrdersApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_StandingOrdersApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -129,7 +128,7 @@ trait APIMethods_StandingOrdersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagStandingOrders :: apiTagMockedData :: Nil
ApiTag("Standing Orders") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdStandingOrders : OBPEndpoint = {
@ -314,7 +313,7 @@ trait APIMethods_StandingOrdersApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagStandingOrders :: apiTagMockedData :: Nil
ApiTag("Standing Orders") :: apiTagMockedData :: Nil
)
lazy val getStandingOrders : OBPEndpoint = {
@ -407,7 +406,6 @@ trait APIMethods_StandingOrdersApi { self: RestHelper =>
}
}
}
}

View File

@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_StatementsApi { self: RestHelper =>
val ImplementationsStatementsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_StatementsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -244,7 +243,7 @@ trait APIMethods_StatementsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagStatements :: apiTagMockedData :: Nil
ApiTag("Statements") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdStatements : OBPEndpoint = {
@ -653,7 +652,7 @@ trait APIMethods_StatementsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagStatements :: apiTagMockedData :: Nil
ApiTag("Statements") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdStatementsStatementId : OBPEndpoint = {
@ -871,7 +870,7 @@ trait APIMethods_StatementsApi { self: RestHelper =>
json.parse(""""""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagStatements :: apiTagMockedData :: Nil
ApiTag("Statements") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdStatementsStatementIdFile : OBPEndpoint = {
@ -1121,7 +1120,7 @@ trait APIMethods_StatementsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagStatements :: apiTagMockedData :: Nil
ApiTag("Statements") ::ApiTag("Transactions") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdStatementsStatementIdTransactions : OBPEndpoint = {
@ -1562,7 +1561,7 @@ trait APIMethods_StatementsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagStatements :: apiTagMockedData :: Nil
ApiTag("Statements") :: apiTagMockedData :: Nil
)
lazy val getStatements : OBPEndpoint = {
@ -1767,7 +1766,6 @@ trait APIMethods_StatementsApi { self: RestHelper =>
}
}
}
}

View File

@ -21,14 +21,13 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.util.ApiTag
trait APIMethods_TransactionsApi { self: RestHelper =>
val ImplementationsTransactionsApi = new Object() {
val apiVersion: ApiVersion = ApiVersion.ukOpenBankingV310
object APIMethods_TransactionsApi extends RestHelper {
val apiVersion = OBP_UKOpenBanking_310.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)
implicit val formats = net.liftweb.json.DefaultFormats
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)
val endpoints =
@ -274,7 +273,7 @@ trait APIMethods_TransactionsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagTransactions :: apiTagMockedData :: Nil
ApiTag("Statements") ::ApiTag("Transactions") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdStatementsStatementIdTransactions : OBPEndpoint = {
@ -747,7 +746,7 @@ trait APIMethods_TransactionsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagTransactions :: apiTagMockedData :: Nil
ApiTag("Transactions") :: apiTagMockedData :: Nil
)
lazy val getAccountsAccountIdTransactions : OBPEndpoint = {
@ -1220,7 +1219,7 @@ trait APIMethods_TransactionsApi { self: RestHelper =>
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
apiTagTransactions :: apiTagMockedData :: Nil
ApiTag("Transactions") :: apiTagMockedData :: Nil
)
lazy val getTransactions : OBPEndpoint = {
@ -1457,7 +1456,6 @@ trait APIMethods_TransactionsApi { self: RestHelper =>
}
}
}
}

View File

@ -19,12 +19,8 @@ import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
trait APIMethods_BERLIN_GROUP_1 {
//needs to be a RestHelper to get access to JsonGet, JsonPost, etc.
self: RestHelper =>
val Implementations1 = new Object() {
val implementedInApiVersion: ApiVersion = ApiVersion.berlinGroupV1
object APIMethods_BERLIN_GROUP_1 extends RestHelper{
val implementedInApiVersion = OBP_BERLIN_GROUP_1.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
@ -177,10 +173,5 @@ trait APIMethods_BERLIN_GROUP_1 {
}
}
}
}
}
object APIMethods_BERLIN_GROUP_1 {
}
}

View File

@ -28,8 +28,9 @@ package code.api.berlin.group.v1
import code.api.OBPRestHelper
import code.api.util.APIUtil.{OBPEndpoint, ResourceDoc, getAllowedEndpoints}
import code.api.util.ApiVersion
import code.api.util.{ApiVersion, ScannedApiVersion, ScannedApis}
import code.util.Helper.MdcLoggable
import code.api.berlin.group.v1.APIMethods_BERLIN_GROUP_1._
import scala.collection.immutable.Nil
@ -40,32 +41,33 @@ This file defines which endpoints from all the versions are available in v1
*/
object OBP_BERLIN_GROUP_1 extends OBPRestHelper with APIMethods_BERLIN_GROUP_1 with MdcLoggable {
object OBP_BERLIN_GROUP_1 extends OBPRestHelper with MdcLoggable with ScannedApis{
val version = ApiVersion.berlinGroupV1
override val apiVersion = ScannedApiVersion("berlin-group", "BG", "v1")
val versionStatus = "DRAFT"
val endpointsOf1 =
Implementations1.getAccountList ::
Implementations1.getAccountBalances ::
Implementations1.getTransactionList ::
val allEndpoints =
getAccountList ::
getAccountBalances ::
getAccountBalances ::
getTransactionList ::
Nil
val allResourceDocs = Implementations1.resourceDocs
override val allResourceDocs = resourceDocs
def findResourceDoc(pf: OBPEndpoint): Option[ResourceDoc] = {
allResourceDocs.find(_.partialFunction==pf)
}
// Filter the possible endpoints by the disabled / enabled Props settings and add them together
val routes : List[OBPEndpoint] = getAllowedEndpoints(endpointsOf1, Implementations1.resourceDocs)
override val routes : List[OBPEndpoint] = getAllowedEndpoints(allEndpoints,resourceDocs)
// Make them available for use!
routes.foreach(route => {
oauthServe(("berlin-group" / version.toString).oPrefix{route}, findResourceDoc(route))
oauthServe((apiVersion.urlPrefix / apiVersion.toString).oPrefix{route}, findResourceDoc(route))
})
logger.info(s"version $version has been run! There are ${routes.length} routes.")
logger.info(s"version $apiVersion has been run! There are ${routes.length} routes.")
}

View File

@ -23,7 +23,7 @@ import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
object APIMethods_AccountInformationServiceAISApi extends RestHelper {
val apiVersion: ApiVersion = OBP_BERLIN_GROUP_1_3.version
val apiVersion = OBP_BERLIN_GROUP_1_3.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)

View File

@ -23,7 +23,7 @@ import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
object APIMethods_CommonServicesApi extends RestHelper {
val apiVersion: ApiVersion = OBP_BERLIN_GROUP_1_3.version
val apiVersion = OBP_BERLIN_GROUP_1_3.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)

View File

@ -23,7 +23,7 @@ import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
object APIMethods_ConfirmationOfFundsServicePIISApi extends RestHelper {
val apiVersion: ApiVersion = OBP_BERLIN_GROUP_1_3.version
val apiVersion = OBP_BERLIN_GROUP_1_3.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)

View File

@ -51,7 +51,7 @@ This file defines which endpoints from all the versions are available in v1
*/
object OBP_BERLIN_GROUP_1_3 extends OBPRestHelper with MdcLoggable with ScannedApis {
override val apiVersion = ScannedApiVersion("berlin-group", "v", "1.3 Dec 20th 2018")
override val apiVersion = ScannedApiVersion("berlin-group", "BG", "v1.3")
val versionStatus = "DRAFT"
private[this] val endpoints =

View File

@ -23,7 +23,7 @@ import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
object APIMethods_PaymentInitiationServicePISApi extends RestHelper {
val apiVersion: ApiVersion = OBP_BERLIN_GROUP_1_3.version
val apiVersion = OBP_BERLIN_GROUP_1_3.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)

View File

@ -23,7 +23,7 @@ import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
object APIMethods_SigningBasketsApi extends RestHelper {
val apiVersion: ApiVersion = OBP_BERLIN_GROUP_1_3.version
val apiVersion = OBP_BERLIN_GROUP_1_3.apiVersion
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
protected implicit def JvalueToSuper(what: JValue): JvalueCaseClass = JvalueCaseClass(what)

View File

@ -16,7 +16,7 @@ import scala.collection.immutable.Nil
import scala.collection.mutable.ArrayBuffer
trait APIMethods_APIBuilder { self: RestHelper =>
val ImplementationsBuilderAPI = new Object() {
val apiVersion: ApiVersion = ApiVersion.apiBuilder
val apiVersion = ApiVersion.apiBuilder
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)

View File

@ -39,7 +39,6 @@ import code.api.Constant._
import code.api.JSONFactoryGateway.PayloadOfJwtJSON
import code.api.OAuthHandshake._
import code.api.UKOpenBanking.v2_0_0.OBP_UKOpenBanking_200
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.berlin.group.v1.OBP_BERLIN_GROUP_1
import code.api.berlin.group.v1_3.OBP_BERLIN_GROUP_1_3
import code.api.oauth1a.Arithmetics
@ -1031,7 +1030,7 @@ object APIUtil extends MdcLoggable {
// Used to document the API calls
case class ResourceDoc(
partialFunction : OBPEndpoint, // PartialFunction[Req, Box[User] => Box[JsonResponse]],
implementedInApiVersion: ApiVersion, // TODO: Use ApiVersion enumeration instead of string
implementedInApiVersion: ScannedApiVersion, // TODO: Use ApiVersion enumeration instead of string
partialFunctionName: String, // The string name of the partial function that implements this resource. Could use it to link to the source code that implements the call
requestVerb: String, // GET, POST etc. TODO: Constrain to GET, POST etc.
requestUrl: String, // The URL. THIS GETS MODIFIED TO include the implemented in prefix e.g. /obp/vX.X). Starts with / No trailing slash.
@ -1656,9 +1655,6 @@ Returns a string showed to the developer
case ApiVersion.v2_2_0 => LiftRules.statelessDispatch.append(v2_2_0.OBPAPI2_2_0)
case ApiVersion.v3_0_0 => LiftRules.statelessDispatch.append(v3_0_0.OBPAPI3_0_0)
case ApiVersion.v3_1_0 => LiftRules.statelessDispatch.append(v3_1_0.OBPAPI3_1_0)
case ApiVersion.`berlinGroupV1` => LiftRules.statelessDispatch.append(OBP_BERLIN_GROUP_1)
case ApiVersion.`ukOpenBankingV200` => LiftRules.statelessDispatch.append(OBP_UKOpenBanking_200)
case ApiVersion.`ukOpenBankingV310` => LiftRules.statelessDispatch.append(OBP_UKOpenBanking_310)
case ApiVersion.`apiBuilder` => LiftRules.statelessDispatch.append(OBP_APIBuilder)
case version: ScannedApiVersion => LiftRules.statelessDispatch.append(ScannedApis.versionMapScannedApis(version))
case _ => logger.info(s"There is no ${version.toString}")

View File

@ -1,5 +1,7 @@
package code.api.util
import code.api.Constant.ApiPathZero
sealed trait ApiVersion {
def dottedApiVersion() : String = this.toString.replace("_", ".").replace("v","")
def vDottedApiVersion() : String = this.toString.replace("_", ".")
@ -11,87 +13,49 @@ sealed trait ApiVersion {
}
/**
* this version object created according swagger file info.title and info.version
* @param urlPrefix api url prefix part, not include "/"
* @param appName parsed from swagger file info.title, is appName variable in swagger-codegen
* @param appVersion parsed from swagger file infor.version, is version variable in wagger-codegen
* We need more fields for the versions. now, we support many standards: UKOpenBanking, BerlinGroup.
* For each standard, we need its own `fullyQualifiedVersion`
* @param urlPrefix : eg: `obp` or 'berlin`-group``
* @param apiStandard eg: obp or `BG` or `UK`
* @param apiShortVersion eg: `v1.2.1` or `v2.0`
*
*/
case class ScannedApiVersion(urlPrefix: String, appName: String, appVersion: String) extends ApiVersion{
override def toString() = {
// extract number part of version, e.g "here is version 1.3 final" -> "1.3"
val version = appVersion.replaceAll(".*?(\\b\\d+\\..+?\\b).*", "$1")
// extract name from appName, e.g: "The customer api" -> "The_customer"
val name = appName.replaceFirst("(?i)api", "").trim.replaceAll("\\s+", "_")
//TODO the version name role will cooperate with API-Explorer, current name role is temporary.
// avoid starts with _ or end with _, and avoid v_ e.g: v_1.3
(name+"_"+version).replaceAll("^_|_$|(v)_", "$1")
}
case class ScannedApiVersion(urlPrefix: String, apiStandard: String, apiShortVersion: String) extends ApiVersion{
val fullyQualifiedVersion = s"${apiStandard.toUpperCase}$apiShortVersion"
override def toString() = apiShortVersion
}
object ApiVersion {
case class V1_0() extends ApiVersion
lazy val v1_0 = V1_0()
case class V1_1() extends ApiVersion
lazy val v1_1 = V1_1()
case class V1_2() extends ApiVersion
lazy val v1_2 = V1_2()
case class V1_2_1() extends ApiVersion
lazy val v1_2_1 = V1_2_1()
case class V1_3_0() extends ApiVersion
lazy val v1_3_0 = V1_3_0()
case class V1_4_0() extends ApiVersion
lazy val v1_4_0 = V1_4_0()
case class V2_0_0() extends ApiVersion
lazy val v2_0_0 = V2_0_0()
case class V2_1_0() extends ApiVersion
lazy val v2_1_0 = V2_1_0()
case class V2_2_0() extends ApiVersion
lazy val v2_2_0 = V2_2_0()
case class V3_0_0() extends ApiVersion
lazy val v3_0_0 = V3_0_0()
case class V3_3_0() extends ApiVersion
lazy val v3_1_0 = V3_1_0()
case class V3_1_0() extends ApiVersion
lazy val v3_3_0 = V3_3_0()
//Special versions
case class ImporterApi() extends ApiVersion
lazy val importerApi = ImporterApi()
case class AccountsApi() extends ApiVersion
lazy val accountsApi = AccountsApi()
case class BankMockApi() extends ApiVersion
lazy val bankMockApi = BankMockApi()
case class BerlinGroupV1() extends ApiVersion {
override def toString() = "v1"
//override def toString() = "berlin_group_v1" // TODO don't want to confuse with OBP
}
lazy val berlinGroupV1 = BerlinGroupV1()
case class UKOpenBankingV200() extends ApiVersion {
override def toString() = "v2_0"
// override def toString() = "uk_v2.0.0" // TODO don't want to confuse with OBP
}
lazy val ukOpenBankingV200 = UKOpenBankingV200()
case class UKOpenBankingV310() extends ApiVersion {
override def toString() = "v3_1"
// override def toString() = "uk_v2.0.0" // TODO don't want to confuse with OBP
}
lazy val ukOpenBankingV310 = UKOpenBankingV310()
//OBP Standard
val v1_2_1 = ScannedApiVersion(ApiPathZero,"obp","v1.2.1")
val v1_3_0 = ScannedApiVersion(ApiPathZero,"obp","v1.3.0")
val v1_4_0 = ScannedApiVersion(ApiPathZero,"obp","v1.4.0")
val v2_0_0 = ScannedApiVersion(ApiPathZero,"obp","v2.0.0")
val v2_1_0 = ScannedApiVersion(ApiPathZero,"obp","v2.1.0")
val v2_2_0 = ScannedApiVersion(ApiPathZero,"obp","v2.2.0")
val v3_0_0 = ScannedApiVersion(ApiPathZero,"obp","v3.0.0")
val v3_1_0 = ScannedApiVersion(ApiPathZero,"obp","v3.1.0")
case class OpenIdConnect1() extends ApiVersion
lazy val openIdConnect1 = OpenIdConnect1()
case class Sandbox() extends ApiVersion
lazy val sandbox = Sandbox()
case class APIBuilder() extends ApiVersion {
override def toString() = "b1"
//override def toString() = "api_builder_v1" // TODO don't want to confuse with OBP
}
lazy val apiBuilder = APIBuilder()
lazy val apiBuilder = ScannedApiVersion("api-builder","obp","b1")
val scabbedApis = ScannedApis.versionMapScannedApis.keysIterator.toList
private val versions =
// v1_0 ::
// v1_1 ::
// v1_2 ::
v1_2_1 ::
v1_3_0 ::
v1_4_0 ::
@ -100,20 +64,35 @@ object ApiVersion {
v2_2_0 ::
v3_0_0 ::
v3_1_0 ::
v3_3_0 ::
importerApi ::
accountsApi ::
bankMockApi ::
openIdConnect1 ::
sandbox ::
berlinGroupV1 ::
ukOpenBankingV200 ::
ukOpenBankingV310 ::
apiBuilder::
ScannedApis.versionMapScannedApis.keysIterator.toList // all the scanned version
scabbedApis
def valueOf(value: String): ApiVersion = {
versions.filter(_.vDottedApiVersion == value) match {
//This `match` is used for compatibility. Before we do not take care for the BerlinGroup and UKOpenBanking versions carefully.
// eg: v1 ==BGv1, v1.3 ==BGv1.3, v2.0 == UKv2.0
// Now, we use the BerlinGroup standard version in OBP. But we need still make sure old version system is working.
val compatibilityVersion = value match {
case v1_2_1.fullyQualifiedVersion => v1_2_1.apiShortVersion
case v1_3_0.fullyQualifiedVersion => v1_3_0.apiShortVersion
case v1_4_0.fullyQualifiedVersion => v1_4_0.apiShortVersion
case v2_0_0.fullyQualifiedVersion => v2_0_0.apiShortVersion
case v2_1_0.fullyQualifiedVersion => v2_1_0.apiShortVersion
case v2_2_0.fullyQualifiedVersion => v2_2_0.apiShortVersion
case v3_0_0.fullyQualifiedVersion => v3_0_0.apiShortVersion
case v3_1_0.fullyQualifiedVersion => v3_1_0.apiShortVersion
case apiBuilder.fullyQualifiedVersion => apiBuilder.apiShortVersion
case version if(scabbedApis.map(_.fullyQualifiedVersion).contains(version))
=>scabbedApis.filter(_.fullyQualifiedVersion==version).head.apiShortVersion
case _=> value
}
versions.filter(_.vDottedApiVersion == compatibilityVersion) match {
case x :: Nil => x // We find exactly one Role
case x :: _ => throw new Exception("Duplicated version: " + x) // We find more than one Role
case _ => throw new IllegalArgumentException("Incorrect ApiVersion value: " + value) // There is no Role

View File

@ -107,7 +107,7 @@ trait APIMethods121 {
val resourceDocs = ArrayBuffer[ResourceDoc]()
val emptyObjectJson = EmptyClassJson()
val apiVersion : ApiVersion = ApiVersion.v1_2_1 // was String "1_2_1"
val apiVersion = ApiVersion.v1_2_1 // was String "1_2_1"
val apiVersionStatus : String = "STABLE"
resourceDocs += ResourceDoc(

View File

@ -21,7 +21,7 @@ trait APIMethods130 {
val resourceDocs = ArrayBuffer[ResourceDoc]()
val emptyObjectJson = EmptyClassJson()
val apiVersion : ApiVersion = ApiVersion.v1_3_0 // was String "1_3_0"
val apiVersion = ApiVersion.v1_3_0 // was String "1_3_0"
resourceDocs += ResourceDoc(

View File

@ -54,7 +54,7 @@ trait APIMethods140 extends MdcLoggable with APIMethods130 with APIMethods121{
val resourceDocs = ArrayBuffer[ResourceDoc]()
val emptyObjectJson = EmptyClassJson()
val apiVersion : ApiVersion = ApiVersion.v1_4_0 // was noV i.e. "1_4_0"
val apiVersion = ApiVersion.v1_4_0 // was noV i.e. "1_4_0"
val apiVersionStatus : String = "STABLE"
resourceDocs += ResourceDoc(

View File

@ -365,7 +365,7 @@ object JSONFactory1_4_0 {
// We return html rather than markdown to the consumer so they don't have to bother with these questions.
ResourceDocJson(
operation_id = s"v${rd.implementedInApiVersion.toString}-${rd.partialFunctionName.toString}",
operation_id = s"${rd.implementedInApiVersion.fullyQualifiedVersion}-${rd.partialFunctionName.toString}",
request_verb = rd.requestVerb,
request_url = rd.requestUrl,
summary = rd.summary,

View File

@ -119,7 +119,7 @@ trait APIMethods200 {
val apiRelations = ArrayBuffer[ApiRelation]()
val emptyObjectJson = EmptyClassJson()
val apiVersion: ApiVersion = ApiVersion.v2_0_0 // was String "2_0_0"
val apiVersion = ApiVersion.v2_0_0 // was String "2_0_0"
val codeContext = CodeContext(resourceDocs, apiRelations)

View File

@ -68,7 +68,7 @@ trait APIMethods210 {
val apiRelations = ArrayBuffer[ApiRelation]()
val emptyObjectJson = EmptyClassJson()
val apiVersion: util.ApiVersion = util.ApiVersion.v2_1_0 // was String "2_1_0"
val apiVersion = util.ApiVersion.v2_1_0 // was String "2_1_0"
val codeContext = CodeContext(resourceDocs, apiRelations)

View File

@ -43,7 +43,7 @@ trait APIMethods220 {
val apiRelations = ArrayBuffer[ApiRelation]()
val emptyObjectJson = EmptyClassJson()
val implementedInApiVersion: ApiVersion = ApiVersion.v2_2_0 // was String "2_2_0"
val implementedInApiVersion = ApiVersion.v2_2_0 // was String "2_2_0"
val codeContext = CodeContext(resourceDocs, apiRelations)

View File

@ -49,7 +49,7 @@ trait APIMethods300 {
val Implementations3_0_0 = new Object() {
val implementedInApiVersion: ApiVersion = ApiVersion.v3_0_0 // was noV
val implementedInApiVersion = ApiVersion.v3_0_0 // was noV
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()

View File

@ -14,7 +14,7 @@ trait CustomAPIMethods300 {
def endpointsOfCustom3_0_0 = createTransactionRequestTransferToReferenceAccountCustom :: Nil
val apiVersion: ApiVersion = ApiVersion.v3_0_0
val apiVersion = ApiVersion.v3_0_0
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()
val codeContext = CodeContext(resourceDocs, apiRelations)

View File

@ -48,7 +48,7 @@ trait APIMethods310 {
class Implementations310 {
val implementedInApiVersion: ApiVersion = ApiVersion.v3_1_0
val implementedInApiVersion = ApiVersion.v3_1_0
val resourceDocs = ArrayBuffer[ResourceDoc]()
val apiRelations = ArrayBuffer[ApiRelation]()