mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 17:56:46 +00:00
feature/Transaction Request Reasons - WIP 2
This commit is contained in:
parent
02f5dd8eaa
commit
4c8615e0cc
@ -16,7 +16,7 @@ import code.api.v3_0_0.JSONFactory300.createBranchJsonV300
|
||||
import code.api.v3_0_0.custom.JSONFactoryCustom300
|
||||
import code.api.v3_0_0.{LobbyJsonV330, _}
|
||||
import code.api.v3_1_0.{AccountBalanceV310, AccountsBalancesV310Json, BadLoginStatusJson, ContactDetailsJson, CustomerWithAttributesJsonV310, InviteeJson, ObpApiLoopbackJson, PhysicalCardWithAttributesJsonV310, PutUpdateCustomerEmailJsonV310, _}
|
||||
import code.api.v4_0_0.{APIInfoJson400, AccountTagJSON, AccountTagsJSON, AttributeDefinitionJsonV400, AttributeDefinitionResponseJsonV400, AttributeDefinitionsResponseJsonV400, ChallengeJsonV400, CustomerAttributeJsonV400, CustomerAttributesResponseJson, DirectDebitJsonV400, EnergySource400, HostedAt400, HostedBy400, ModeratedAccountJSON400, ModeratedCoreAccountJsonV400, PostAccountAccessJsonV400, PostAccountTagJSON, PostCustomerPhoneNumberJsonV400, PostDirectDebitJsonV400, PostStandingOrderJsonV400, PostViewJsonV400, RefundJson, RevokedJsonV400, StandingOrderJsonV400, TransactionAttributeJsonV400, TransactionAttributeResponseJson, TransactionAttributesResponseJson, TransactionRequestBodyRefundJsonV400, TransactionRequestBodySEPAJsonV400, TransactionRequestWithChargeJSON400, UserLockStatusJson, When}
|
||||
import code.api.v4_0_0.{APIInfoJson400, AccountTagJSON, AccountTagsJSON, AttributeDefinitionJsonV400, AttributeDefinitionResponseJsonV400, AttributeDefinitionsResponseJsonV400, ChallengeJsonV400, CustomerAttributeJsonV400, CustomerAttributesResponseJson, DirectDebitJsonV400, EnergySource400, HostedAt400, HostedBy400, ModeratedAccountJSON400, ModeratedCoreAccountJsonV400, PostAccountAccessJsonV400, PostAccountTagJSON, PostCustomerPhoneNumberJsonV400, PostDirectDebitJsonV400, PostStandingOrderJsonV400, PostViewJsonV400, RefundJson, RevokedJsonV400, StandingOrderJsonV400, TransactionAttributeJsonV400, TransactionAttributeResponseJson, TransactionAttributesResponseJson, TransactionRequestBodyRefundJsonV400, TransactionRequestBodySEPAJsonV400, TransactionRequestReasonV400, TransactionRequestWithChargeJSON400, UserLockStatusJson, When}
|
||||
import code.api.v3_1_0.{AccountBalanceV310, AccountsBalancesV310Json, BadLoginStatusJson, ContactDetailsJson, InviteeJson, ObpApiLoopbackJson, PhysicalCardWithAttributesJsonV310, PutUpdateCustomerEmailJsonV310, _}
|
||||
import code.branches.Branches.{Branch, DriveUpString, LobbyString}
|
||||
import code.consent.ConsentStatus
|
||||
@ -1942,13 +1942,13 @@ object SwaggerDefinitionsJSON {
|
||||
description = "This is a SEPA Transaction Request",
|
||||
charge_policy = "SHARED",
|
||||
future_date = Some("20881230"),
|
||||
reason = Some(List(
|
||||
reasons = Some(List(
|
||||
TransactionRequestReason(
|
||||
code = "410",
|
||||
document_number = Some("2020/154"),
|
||||
documentNumber = Some("2020/154"),
|
||||
amount = Some("100"),
|
||||
currency = Some("EUR"),
|
||||
description = Some("international payment")
|
||||
description = Some("SEPA payment")
|
||||
)
|
||||
))
|
||||
)
|
||||
|
||||
@ -15,7 +15,7 @@ import code.api.v1_4_0.OBPAPI1_4_0.Implementations1_4_0
|
||||
import code.api.v2_0_0.OBPAPI2_0_0.Implementations2_0_0
|
||||
import code.api.v2_1_0.OBPAPI2_1_0.Implementations2_1_0
|
||||
import code.api.v2_2_0.OBPAPI2_2_0.Implementations2_2_0
|
||||
import code.api.v4_0_0.{DynamicEndpointHelper, DynamicEntityInfo}
|
||||
import code.api.v4_0_0.{DynamicEndpointHelper, DynamicEntityInfo, TransactionRequestReasonV400}
|
||||
import code.bankconnectors.Connector
|
||||
import code.bankconnectors.rest.RestConnector_vMar2019
|
||||
import code.branches.Branches.{Branch, DriveUpString, LobbyString}
|
||||
@ -683,17 +683,18 @@ object NewStyle {
|
||||
}
|
||||
}
|
||||
def createTransactionRequestv400(
|
||||
u: User,
|
||||
viewId: ViewId,
|
||||
fromAccount: BankAccount,
|
||||
toAccount: BankAccount,
|
||||
transactionRequestType: TransactionRequestType,
|
||||
transactionRequestCommonBody: TransactionRequestCommonBodyJSON,
|
||||
detailsPlain: String,
|
||||
chargePolicy: String,
|
||||
challengeType: Option[String],
|
||||
scaMethod: Option[SCA],
|
||||
callContext: Option[CallContext]): OBPReturnType[TransactionRequest] =
|
||||
u: User,
|
||||
viewId: ViewId,
|
||||
fromAccount: BankAccount,
|
||||
toAccount: BankAccount,
|
||||
transactionRequestType: TransactionRequestType,
|
||||
transactionRequestCommonBody: TransactionRequestCommonBodyJSON,
|
||||
detailsPlain: String,
|
||||
chargePolicy: String,
|
||||
challengeType: Option[String],
|
||||
scaMethod: Option[SCA],
|
||||
reasons: Option[List[TransactionRequestReason]],
|
||||
callContext: Option[CallContext]): OBPReturnType[TransactionRequest] =
|
||||
{
|
||||
Connector.connector.vend.createTransactionRequestv400(
|
||||
u: User,
|
||||
@ -706,6 +707,7 @@ object NewStyle {
|
||||
chargePolicy: String,
|
||||
challengeType: Option[String],
|
||||
scaMethod: Option[SCA],
|
||||
reasons: Option[List[TransactionRequestReason]],
|
||||
callContext: Option[CallContext]
|
||||
) map { i =>
|
||||
(unboxFullOrFail(i._1, callContext, s"$InvalidConnectorResponseForGetTransactionRequests210", 400), i._2)
|
||||
@ -784,7 +786,7 @@ object NewStyle {
|
||||
amount: BigDecimal,
|
||||
description: String,
|
||||
transactionRequestType: TransactionRequestType,
|
||||
chargePolicy: String,
|
||||
chargePolicy: String,
|
||||
callContext: Option[CallContext]): OBPReturnType[TransactionId]=
|
||||
Connector.connector.vend.makePaymentv210(
|
||||
fromAccount: BankAccount,
|
||||
|
||||
@ -37,7 +37,7 @@ import code.metadata.tags.Tags
|
||||
import code.model.dataAccess.{AuthUser, BankAccountCreation}
|
||||
import code.model.{toUserExtended, _}
|
||||
import code.transactionChallenge.MappedExpectedChallengeAnswer
|
||||
import code.transactionrequests.MappedTransactionRequestProvider
|
||||
import code.transactionrequests.{MappedTransactionRequestProvider, TransactionRequestReasons}
|
||||
import code.transactionrequests.TransactionRequests.TransactionChallengeTypes._
|
||||
import code.transactionrequests.TransactionRequests.TransactionRequestTypes
|
||||
import code.transactionrequests.TransactionRequests.TransactionRequestTypes.{apply => _, _}
|
||||
@ -545,6 +545,7 @@ trait APIMethods400 {
|
||||
sharedChargePolicy.toString,
|
||||
Some(OTP_VIA_API.toString),
|
||||
getScaMethodAtInstance(transactionRequestType.value).toOption,
|
||||
None,
|
||||
callContext) //in ACCOUNT, ChargePolicy set default "SHARED"
|
||||
} yield (createdTransactionRequest, callContext)
|
||||
}
|
||||
@ -572,6 +573,7 @@ trait APIMethods400 {
|
||||
sharedChargePolicy.toString,
|
||||
Some(OTP_VIA_API.toString),
|
||||
getScaMethodAtInstance(transactionRequestType.value).toOption,
|
||||
None,
|
||||
callContext) //in ACCOUNT, ChargePolicy set default "SHARED"
|
||||
} yield (createdTransactionRequest, callContext)
|
||||
}
|
||||
@ -599,6 +601,7 @@ trait APIMethods400 {
|
||||
sharedChargePolicy.toString,
|
||||
Some(OTP_VIA_WEB_FORM.toString),
|
||||
getScaMethodAtInstance(transactionRequestType.value).toOption,
|
||||
None,
|
||||
callContext) //in ACCOUNT, ChargePolicy set default "SHARED"
|
||||
} yield (createdTransactionRequest, callContext)
|
||||
}
|
||||
@ -632,6 +635,7 @@ trait APIMethods400 {
|
||||
chargePolicy,
|
||||
Some(OTP_VIA_API.toString),
|
||||
getScaMethodAtInstance(transactionRequestType.value).toOption,
|
||||
None,
|
||||
callContext)
|
||||
} yield (createdTransactionRequest, callContext)
|
||||
|
||||
@ -640,7 +644,7 @@ trait APIMethods400 {
|
||||
for {
|
||||
//For SEPA, Use the iban to find the toCounterparty and set up the toAccount
|
||||
transDetailsSEPAJson <- NewStyle.function.tryons(s"${InvalidJsonFormat}, it should be $SEPA json format", 400, cc.callContext) {
|
||||
json.extract[TransactionRequestBodySEPAJSON]
|
||||
json.extract[TransactionRequestBodySEPAJsonV400]
|
||||
}
|
||||
toIban = transDetailsSEPAJson.to.iban
|
||||
(toCounterparty, callContext) <- NewStyle.function.getCounterpartyByIban(toIban, cc.callContext)
|
||||
@ -665,8 +669,22 @@ trait APIMethods400 {
|
||||
chargePolicy,
|
||||
Some(OTP_VIA_API.toString),
|
||||
getScaMethodAtInstance(transactionRequestType.value).toOption,
|
||||
transDetailsSEPAJson.reasons,
|
||||
callContext)
|
||||
} yield (createdTransactionRequest, callContext)
|
||||
} yield {
|
||||
for (reason <- transDetailsSEPAJson.reasons.getOrElse(Nil)) {
|
||||
TransactionRequestReasons
|
||||
.create
|
||||
.TransactionRequestId(createdTransactionRequest.id.value)
|
||||
.Amount(reason.amount.getOrElse(""))
|
||||
.Code(reason.code)
|
||||
.Currency(reason.currency.getOrElse(""))
|
||||
.DocumentNumber(reason.documentNumber.getOrElse(""))
|
||||
.Description(reason.description.getOrElse(""))
|
||||
.save()
|
||||
}
|
||||
(createdTransactionRequest, callContext)
|
||||
}
|
||||
}
|
||||
case FREE_FORM => {
|
||||
for {
|
||||
@ -688,6 +706,7 @@ trait APIMethods400 {
|
||||
sharedChargePolicy.toString,
|
||||
Some(OTP_VIA_API.toString),
|
||||
getScaMethodAtInstance(transactionRequestType.value).toOption,
|
||||
None,
|
||||
cc.callContext)
|
||||
} yield
|
||||
(createdTransactionRequest, callContext)
|
||||
|
||||
@ -217,8 +217,16 @@ case class TransactionRequestBodySEPAJsonV400(
|
||||
description: String,
|
||||
charge_policy: String,
|
||||
future_date: Option[String] = None,
|
||||
reason: Option[List[TransactionRequestReason]] = None
|
||||
reasons: Option[List[TransactionRequestReason]] = None
|
||||
) extends TransactionRequestCommonBodyJSON
|
||||
|
||||
case class TransactionRequestReasonV400(
|
||||
code: String,
|
||||
document_number: Option[String],
|
||||
amount: Option[String],
|
||||
currency: Option[String],
|
||||
description: Option[String]
|
||||
)
|
||||
// the data from endpoint, extract as valid JSON
|
||||
case class TransactionRequestBodyRefundJsonV400(
|
||||
to: TransactionRequestAccountJsonV140,
|
||||
|
||||
@ -968,6 +968,7 @@ trait Connector extends MdcLoggable {
|
||||
chargePolicy: String,
|
||||
challengeType: Option[String],
|
||||
scaMethod: Option[SCA],
|
||||
reasons: Option[List[TransactionRequestReason]],
|
||||
callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = Future{(Failure(setUnimplementedError), callContext)}
|
||||
|
||||
//place holder for various connector methods that overwrite methods like these, does the actual data access
|
||||
|
||||
@ -3628,6 +3628,7 @@ object LocalMappedConnector extends Connector with MdcLoggable {
|
||||
chargePolicy: String,
|
||||
challengeType: Option[String],
|
||||
scaMethod: Option[SCA],
|
||||
reasons: Option[List[TransactionRequestReason]],
|
||||
callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = {
|
||||
|
||||
for {
|
||||
|
||||
@ -10,6 +10,7 @@ import code.api.util.APIUtil.{AdapterImplementation, MessageDoc, OBPReturnType,
|
||||
import code.api.util.ErrorMessages.{AdapterFunctionNotImplemented, AdapterUnknownError}
|
||||
import code.api.util.ExampleValue._
|
||||
import code.api.util._
|
||||
import code.api.v4_0_0.TransactionRequestReasonV400
|
||||
import code.bankconnectors._
|
||||
import code.bankconnectors.akka.actor.{AkkaConnectorActorInit, AkkaConnectorHelperActor}
|
||||
import com.openbankproject.commons.ExecutionContext.Implicits.global
|
||||
@ -1533,146 +1534,6 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit {
|
||||
response.map(convertToTuple[TransactionRequest](callContext))
|
||||
}
|
||||
|
||||
messageDocs += createTransactionRequestv400Doc
|
||||
def createTransactionRequestv400Doc = MessageDoc(
|
||||
process = "obp.createTransactionRequestv400",
|
||||
messageFormat = messageFormat,
|
||||
description = "Create Transaction Requestv400",
|
||||
outboundTopic = None,
|
||||
inboundTopic = None,
|
||||
exampleOutboundMessage = (
|
||||
OutBoundCreateTransactionRequestv400(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext,
|
||||
initiator= UserCommons(userPrimaryKey=UserPrimaryKey(123),
|
||||
userId=userIdExample.value,
|
||||
idGivenByProvider="string",
|
||||
provider="string",
|
||||
emailAddress=emailExample.value,
|
||||
name=usernameExample.value),
|
||||
viewId=ViewId(viewIdExample.value),
|
||||
fromAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value),
|
||||
accountType=accountTypeExample.value,
|
||||
balance=BigDecimal(balanceAmountExample.value),
|
||||
currency=currencyExample.value,
|
||||
name=bankAccountNameExample.value,
|
||||
label=labelExample.value,
|
||||
iban=Some(ibanExample.value),
|
||||
number=bankAccountNumberExample.value,
|
||||
bankId=BankId(bankIdExample.value),
|
||||
lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")),
|
||||
branchId=branchIdExample.value,
|
||||
accountRoutingScheme=accountRoutingSchemeExample.value,
|
||||
accountRoutingAddress=accountRoutingAddressExample.value,
|
||||
accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value,
|
||||
address=accountRoutingAddressExample.value)),
|
||||
accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value,
|
||||
value=accountRuleValueExample.value)),
|
||||
accountHolder=bankAccountAccountHolderExample.value),
|
||||
toAccount= BankAccountCommons(accountId=AccountId(accountIdExample.value),
|
||||
accountType=accountTypeExample.value,
|
||||
balance=BigDecimal(balanceAmountExample.value),
|
||||
currency=currencyExample.value,
|
||||
name=bankAccountNameExample.value,
|
||||
label=labelExample.value,
|
||||
iban=Some(ibanExample.value),
|
||||
number=bankAccountNumberExample.value,
|
||||
bankId=BankId(bankIdExample.value),
|
||||
lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not validate date format.")),
|
||||
branchId=branchIdExample.value,
|
||||
accountRoutingScheme=accountRoutingSchemeExample.value,
|
||||
accountRoutingAddress=accountRoutingAddressExample.value,
|
||||
accountRoutings=List( AccountRouting(scheme=accountRoutingSchemeExample.value,
|
||||
address=accountRoutingAddressExample.value)),
|
||||
accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value,
|
||||
value=accountRuleValueExample.value)),
|
||||
accountHolder=bankAccountAccountHolderExample.value),
|
||||
transactionRequestType=TransactionRequestType(transactionRequestTypeExample.value),
|
||||
transactionRequestCommonBody= TransactionRequestCommonBodyJSONCommons(value= AmountOfMoneyJsonV121(currency=currencyExample.value,
|
||||
amount="string"),
|
||||
description="string"),
|
||||
detailsPlain="string",
|
||||
chargePolicy="string",
|
||||
challengeType=Some("string"),
|
||||
scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS))
|
||||
),
|
||||
exampleInboundMessage = (
|
||||
InBoundCreateTransactionRequestv400(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext,
|
||||
status=MessageDocsSwaggerDefinitions.inboundStatus,
|
||||
data= TransactionRequest(id=TransactionRequestId("string"),
|
||||
`type`=transactionRequestTypeExample.value,
|
||||
from= TransactionRequestAccount(bank_id="string",
|
||||
account_id="string"),
|
||||
body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id="string",
|
||||
account_id="string")),
|
||||
to_sepa=Some(TransactionRequestIban("string")),
|
||||
to_counterparty=Some(TransactionRequestCounterpartyId("string")),
|
||||
to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value,
|
||||
amount="string"),
|
||||
description="string",
|
||||
message="string",
|
||||
from= FromAccountTransfer(mobile_phone_number="string",
|
||||
nickname="string"),
|
||||
to=ToAccountTransferToPhone("string"))),
|
||||
to_transfer_to_atm=Some( TransactionRequestTransferToAtm(value= AmountOfMoneyJsonV121(currency=currencyExample.value,
|
||||
amount="string"),
|
||||
description="string",
|
||||
message="string",
|
||||
from= FromAccountTransfer(mobile_phone_number="string",
|
||||
nickname="string"),
|
||||
to= ToAccountTransferToAtm(legal_name="string",
|
||||
date_of_birth="string",
|
||||
mobile_phone_number="string",
|
||||
kyc_document= ToAccountTransferToAtmKycDocument(`type`="string",
|
||||
number="string")))),
|
||||
to_transfer_to_account=Some( TransactionRequestTransferToAccount(value= AmountOfMoneyJsonV121(currency=currencyExample.value,
|
||||
amount="string"),
|
||||
description="string",
|
||||
transfer_type="string",
|
||||
future_date="string",
|
||||
to= ToAccountTransferToAccount(name="string",
|
||||
bank_code="string",
|
||||
branch_number="string",
|
||||
account= ToAccountTransferToAccountAccount(number=accountNumberExample.value,
|
||||
iban=ibanExample.value)))),
|
||||
to_sepa_credit_transfers=Some( SepaCreditTransfers(debtorAccount=PaymentAccount("string"),
|
||||
instructedAmount= AmountOfMoneyJsonV121(currency=currencyExample.value,
|
||||
amount="string"),
|
||||
creditorAccount=PaymentAccount("string"),
|
||||
creditorName="string")),
|
||||
value= AmountOfMoney(currency=currencyExample.value,
|
||||
amount="string"),
|
||||
description="string"),
|
||||
transaction_ids="string",
|
||||
status="string",
|
||||
start_date=new Date(),
|
||||
end_date=new Date(),
|
||||
challenge= TransactionRequestChallenge(id="string",
|
||||
allowed_attempts=123,
|
||||
challenge_type="string"),
|
||||
charge= TransactionRequestCharge(summary="string",
|
||||
value= AmountOfMoney(currency=currencyExample.value,
|
||||
amount="string")),
|
||||
charge_policy="string",
|
||||
counterparty_id=CounterpartyId(counterpartyIdExample.value),
|
||||
name="string",
|
||||
this_bank_id=BankId(bankIdExample.value),
|
||||
this_account_id=AccountId(accountIdExample.value),
|
||||
this_view_id=ViewId(viewIdExample.value),
|
||||
other_account_routing_scheme="string",
|
||||
other_account_routing_address="string",
|
||||
other_bank_routing_scheme="string",
|
||||
other_bank_routing_address="string",
|
||||
is_beneficiary=true,
|
||||
future_date=Some("string")))
|
||||
),
|
||||
adapterImplementation = Some(AdapterImplementation("- Core", 1))
|
||||
)
|
||||
|
||||
override def createTransactionRequestv400(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = {
|
||||
import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv400 => OutBound, InBoundCreateTransactionRequestv400 => InBound}
|
||||
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod)
|
||||
val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _)
|
||||
response.map(convertToTuple[TransactionRequest](callContext))
|
||||
}
|
||||
|
||||
messageDocs += getTransactionRequests210Doc
|
||||
def getTransactionRequests210Doc = MessageDoc(
|
||||
|
||||
@ -74,7 +74,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
val connectorName = "stored_procedure_vDec2019"
|
||||
|
||||
//---------------- dynamic start -------------------please don't modify this line
|
||||
// ---------- created on 2020-07-22T12:18:29Z
|
||||
// ---------- created on 2020-07-27T17:23:14Z
|
||||
|
||||
messageDocs += getAdapterInfoDoc
|
||||
def getAdapterInfoDoc = MessageDoc(
|
||||
@ -246,8 +246,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
inboundTopic = None,
|
||||
exampleOutboundMessage = (
|
||||
OutBoundValidateChallengeAnswer(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext,
|
||||
challengeId="string",
|
||||
hashOfSuppliedAnswer=HashUtil.Sha256Hash("123"))
|
||||
challengeId=challengeIdExample.value,
|
||||
hashOfSuppliedAnswer=hashOfSuppliedAnswerExample.value)
|
||||
),
|
||||
exampleInboundMessage = (
|
||||
InBoundValidateChallengeAnswer(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext,
|
||||
@ -1658,7 +1658,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
status="string",
|
||||
start_date=toDate(transactionRequestStartDateExample),
|
||||
end_date=toDate(transactionRequestEndDateExample),
|
||||
challenge= TransactionRequestChallenge(id="string",
|
||||
challenge= TransactionRequestChallenge(id=challengeIdExample.value,
|
||||
allowed_attempts=123,
|
||||
challenge_type="string"),
|
||||
charge= TransactionRequestCharge(summary="string",
|
||||
@ -1746,7 +1746,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
detailsPlain="string",
|
||||
chargePolicy="string",
|
||||
challengeType=Some("string"),
|
||||
scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS))
|
||||
scaMethod=Some(com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SMS),
|
||||
reasons=Some(List( TransactionRequestReason(code="string",
|
||||
documentNumber=Some("string"),
|
||||
amount=Some(amountExample.value),
|
||||
currency=Some(currencyExample.value),
|
||||
description=Some("string")))))
|
||||
),
|
||||
exampleInboundMessage = (
|
||||
InBoundCreateTransactionRequestv400(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext,
|
||||
@ -1799,7 +1804,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
status="string",
|
||||
start_date=toDate(transactionRequestStartDateExample),
|
||||
end_date=toDate(transactionRequestEndDateExample),
|
||||
challenge= TransactionRequestChallenge(id="string",
|
||||
challenge= TransactionRequestChallenge(id=challengeIdExample.value,
|
||||
allowed_attempts=123,
|
||||
challenge_type="string"),
|
||||
charge= TransactionRequestCharge(summary="string",
|
||||
@ -1821,9 +1826,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
adapterImplementation = Some(AdapterImplementation("- Core", 1))
|
||||
)
|
||||
|
||||
override def createTransactionRequestv400(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = {
|
||||
override def createTransactionRequestv400(initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], reasons: Option[List[TransactionRequestReason]], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = {
|
||||
import com.openbankproject.commons.dto.{OutBoundCreateTransactionRequestv400 => OutBound, InBoundCreateTransactionRequestv400 => InBound}
|
||||
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod)
|
||||
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons)
|
||||
val response: Future[Box[InBound]] = sendRequest[InBound]("obp_create_transaction_requestv400", req, callContext)
|
||||
response.map(convertToTuple[TransactionRequest](callContext))
|
||||
}
|
||||
@ -1913,7 +1918,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
status="string",
|
||||
start_date=toDate(transactionRequestStartDateExample),
|
||||
end_date=toDate(transactionRequestEndDateExample),
|
||||
challenge= TransactionRequestChallenge(id="string",
|
||||
challenge= TransactionRequestChallenge(id=challengeIdExample.value,
|
||||
allowed_attempts=123,
|
||||
challenge_type="string"),
|
||||
charge= TransactionRequestCharge(summary="string",
|
||||
@ -2004,7 +2009,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
status="string",
|
||||
start_date=toDate(transactionRequestStartDateExample),
|
||||
end_date=toDate(transactionRequestEndDateExample),
|
||||
challenge= TransactionRequestChallenge(id="string",
|
||||
challenge= TransactionRequestChallenge(id=challengeIdExample.value,
|
||||
allowed_attempts=123,
|
||||
challenge_type="string"),
|
||||
charge= TransactionRequestCharge(summary="string",
|
||||
@ -2108,7 +2113,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
status="string",
|
||||
start_date=toDate(transactionRequestStartDateExample),
|
||||
end_date=toDate(transactionRequestEndDateExample),
|
||||
challenge= TransactionRequestChallenge(id="string",
|
||||
challenge= TransactionRequestChallenge(id=challengeIdExample.value,
|
||||
allowed_attempts=123,
|
||||
challenge_type="string"),
|
||||
charge= TransactionRequestCharge(summary="string",
|
||||
@ -2178,7 +2183,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
status="string",
|
||||
start_date=toDate(transactionRequestStartDateExample),
|
||||
end_date=toDate(transactionRequestEndDateExample),
|
||||
challenge= TransactionRequestChallenge(id="string",
|
||||
challenge= TransactionRequestChallenge(id=challengeIdExample.value,
|
||||
allowed_attempts=123,
|
||||
challenge_type="string"),
|
||||
charge= TransactionRequestCharge(summary="string",
|
||||
@ -2751,7 +2756,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
status="string",
|
||||
start_date=toDate(transactionRequestStartDateExample),
|
||||
end_date=toDate(transactionRequestEndDateExample),
|
||||
challenge= TransactionRequestChallenge(id="string",
|
||||
challenge= TransactionRequestChallenge(id=challengeIdExample.value,
|
||||
allowed_attempts=123,
|
||||
challenge_type="string"),
|
||||
charge= TransactionRequestCharge(summary="string",
|
||||
@ -2998,7 +3003,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
status="string",
|
||||
start_date=toDate(transactionRequestStartDateExample),
|
||||
end_date=toDate(transactionRequestEndDateExample),
|
||||
challenge= TransactionRequestChallenge(id="string",
|
||||
challenge= TransactionRequestChallenge(id=challengeIdExample.value,
|
||||
allowed_attempts=123,
|
||||
challenge_type="string"),
|
||||
charge= TransactionRequestCharge(summary="string",
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package code.transactionrequests
|
||||
|
||||
import code.api.util.APIUtil
|
||||
import code.util.UUIDString
|
||||
import com.openbankproject.commons.model.TransactionRequestReasonsTrait
|
||||
import net.liftweb.mapper._
|
||||
@ -7,7 +8,10 @@ import net.liftweb.mapper._
|
||||
class TransactionRequestReasons extends TransactionRequestReasonsTrait with LongKeyedMapper[TransactionRequestReasons] with IdPK with CreatedUpdated{
|
||||
def getSingleton = TransactionRequestReasons
|
||||
|
||||
object TransactionRequestReasonId extends UUIDString(this) // Add class for this
|
||||
object TransactionRequestReasonId extends UUIDString(this) {
|
||||
override def defaultValue = APIUtil.generateUUID()
|
||||
}
|
||||
object TransactionRequestId extends UUIDString(this)
|
||||
object Code extends MappedString(this, 8)
|
||||
object DocumentNumber extends MappedString(this, 100)
|
||||
object Currency extends MappedString(this, 3)
|
||||
@ -15,6 +19,7 @@ class TransactionRequestReasons extends TransactionRequestReasonsTrait with Long
|
||||
object Description extends MappedString(this, 512)
|
||||
|
||||
override def transactionRequestReasonId: String = TransactionRequestReasonId.get
|
||||
override def transactionRequestId: String = TransactionRequestId.get
|
||||
override def code: String = Code.get
|
||||
override def documentNumber: String = DocumentNumber.get
|
||||
override def amount: String = Amount.get
|
||||
|
||||
@ -1031,7 +1031,7 @@ case class InBoundGetChargeValue(status: Status, data: String) extends InBoundTr
|
||||
override val inboundAdapterCallContext: InboundAdapterCallContext = InboundAdapterCallContext()
|
||||
}
|
||||
|
||||
case class OutBoundCreateTransactionRequestv400(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA]) extends TopicTrait
|
||||
case class OutBoundCreateTransactionRequestv400(outboundAdapterCallContext: OutboundAdapterCallContext, initiator: User, viewId: ViewId, fromAccount: BankAccount, toAccount: BankAccount, transactionRequestType: TransactionRequestType, transactionRequestCommonBody: TransactionRequestCommonBodyJSON, detailsPlain: String, chargePolicy: String, challengeType: Option[String], scaMethod: Option[StrongCustomerAuthentication.SCA], reasons: Option[List[TransactionRequestReason]]) extends TopicTrait
|
||||
case class InBoundCreateTransactionRequestv400(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: TransactionRequest) extends InBoundTrait[TransactionRequest]
|
||||
|
||||
case class OutBoundCreateTransactionRequestImpl(transactionRequestId: TransactionRequestId, transactionRequestType: TransactionRequestType, fromAccount: BankAccount, counterparty: BankAccount, body: TransactionRequestBody, status: String, charge: TransactionRequestCharge) extends TopicTrait
|
||||
|
||||
@ -707,7 +707,7 @@ case class TransactionRequestBody (
|
||||
|
||||
case class TransactionRequestReason(
|
||||
code: String,
|
||||
document_number: Option[String],
|
||||
documentNumber: Option[String],
|
||||
amount: Option[String],
|
||||
currency: Option[String],
|
||||
description: Option[String]
|
||||
|
||||
@ -444,6 +444,7 @@ trait TransactionRequestTypeCharge {
|
||||
|
||||
trait TransactionRequestReasonsTrait {
|
||||
def transactionRequestReasonId: String
|
||||
def transactionRequestId: String
|
||||
def code: String
|
||||
def documentNumber: String
|
||||
def amount: String
|
||||
|
||||
Loading…
Reference in New Issue
Block a user