Skip to content

Commit

Permalink
feature/BGv1.3 added periodic_payments - step5
Browse files Browse the repository at this point in the history
  • Loading branch information
hongwei1 committed Aug 22, 2024
1 parent 2cd1cca commit c7398e2
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ Check the transaction status of a payment initiation.""",
Some(BERLIN_GROUP_PAYMENT_CHALLENGE),
None,
None,
Some(paymentService),
Some(sepaCreditTransfersBerlinGroupV13),
callContext
) //in SANDBOX_TAN, ChargePolicy set default "SHARED"
Expand Down
3 changes: 3 additions & 0 deletions obp-api/src/main/scala/code/api/util/ExampleValue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2275,6 +2275,9 @@ object ExampleValue {
lazy val descriptionExample = ConnectorField(s"This an optional field. Maximum length is ${ApiCollection.Description.maxLen}. It can be any characters here.","The human readable description here.")
glossaryItems += makeGlossaryItem("description", descriptionExample)

lazy val paymentServiceExample = ConnectorField("payments", s"The berlin group payment services, eg: payments, periodic-payments and bulk-payments. ")
glossaryItems += makeGlossaryItem("paymentService", paymentServiceExample)

lazy val dynamicResourceDocDescriptionExample = ConnectorField("Create one User", "the description for this endpoint")
glossaryItems += makeGlossaryItem("DynamicResourceDoc.description", dynamicResourceDocDescriptionExample)

Expand Down
2 changes: 2 additions & 0 deletions obp-api/src/main/scala/code/api/util/NewStyle.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ object NewStyle extends MdcLoggable{
challengeType: Option[ChallengeType.Value],
scaMethod: Option[SCA],
reasons: Option[List[TransactionRequestReason]],
paymentService: Option[String],
berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson],
callContext: Option[CallContext]): OBPReturnType[TransactionRequest] =
{
Expand All @@ -1144,6 +1145,7 @@ object NewStyle extends MdcLoggable{
challengeType = challengeType.map(_.toString),
scaMethod: Option[SCA],
reasons: Option[List[TransactionRequestReason]],
paymentService: Option[String],
berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson],
callContext: Option[CallContext]
) map { i =>
Expand Down
8 changes: 8 additions & 0 deletions obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ trait APIMethods400 extends MdcLoggable {
getScaMethodAtInstance(transactionRequestType.value).toOption,
None,
None,
None,
callContext) //in ACCOUNT, ChargePolicy set default "SHARED"

_ <- NewStyle.function.createOrUpdateTransactionRequestAttribute(
Expand Down Expand Up @@ -1152,6 +1153,7 @@ trait APIMethods400 extends MdcLoggable {
getScaMethodAtInstance(transactionRequestType.value).toOption,
None,
None,
None,
callContext) //in ACCOUNT, ChargePolicy set default "SHARED"
} yield (createdTransactionRequest, callContext)
}
Expand Down Expand Up @@ -1181,6 +1183,7 @@ trait APIMethods400 extends MdcLoggable {
getScaMethodAtInstance(transactionRequestType.value).toOption,
None,
None,
None,
callContext) //in ACCOUNT, ChargePolicy set default "SHARED"
} yield (createdTransactionRequest, callContext)
}
Expand Down Expand Up @@ -1216,6 +1219,7 @@ trait APIMethods400 extends MdcLoggable {
getScaMethodAtInstance(transactionRequestType.value).toOption,
None,
None,
None,
callContext)
} yield (createdTransactionRequest, callContext)
}
Expand Down Expand Up @@ -1248,6 +1252,7 @@ trait APIMethods400 extends MdcLoggable {
getScaMethodAtInstance(transactionRequestType.value).toOption,
None,
None,
None,
callContext)
} yield (createdTransactionRequest, callContext)

Expand Down Expand Up @@ -1300,6 +1305,7 @@ trait APIMethods400 extends MdcLoggable {
getScaMethodAtInstance(transactionRequestType.value).toOption,
None,
None,
None,
callContext)
} yield (createdTransactionRequest, callContext)

Expand Down Expand Up @@ -1335,6 +1341,7 @@ trait APIMethods400 extends MdcLoggable {
getScaMethodAtInstance(transactionRequestType.value).toOption,
transDetailsSEPAJson.reasons.map(_.map(_.transform)),
None,
None,
callContext)
} yield (createdTransactionRequest, callContext)
}
Expand All @@ -1360,6 +1367,7 @@ trait APIMethods400 extends MdcLoggable {
getScaMethodAtInstance(transactionRequestType.value).toOption,
None,
None,
None,
callContext)
} yield
(createdTransactionRequest, callContext)
Expand Down
1 change: 1 addition & 0 deletions obp-api/src/main/scala/code/bankconnectors/Connector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,7 @@ trait Connector extends MdcLoggable {
challengeType: Option[String],
scaMethod: Option[SCA],
reasons: Option[List[TransactionRequestReason]],
paymentService: Option[String],
berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson],
callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = Future{(Failure(setUnimplementedError), callContext)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5103,6 +5103,7 @@ object LocalMappedConnector extends Connector with MdcLoggable {
challengeType: Option[String],
scaMethod: Option[SCA],
reasons: Option[List[TransactionRequestReason]],
paymentService: Option[String],
berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson],
callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2196,6 +2196,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit {
amount=Some(amountExample.value),
currency=Some(currencyExample.value),
description=Some(descriptionExample.value)))),
paymentService = Some(paymentServiceExample.value),
berlinGroupPayments=Some( SepaCreditTransfersBerlinGroupV13(endToEndIdentification=Some("string"),
instructionIdentification=Some("string"),
debtorName=Some("string"),
Expand Down Expand Up @@ -2305,9 +2306,9 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit {
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], reasons: Option[List[TransactionRequestReason]], berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], 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]], paymentService: Option[String], berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = {
import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv400 => InBound, OutBoundCreateTransactionRequestv400 => OutBound}
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons, berlinGroupPayments)
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons, paymentService, berlinGroupPayments)
val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _)
response.map(convertToTuple[TransactionRequest](callContext))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2337,6 +2337,7 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
amount=Some(amountExample.value),
currency=Some(currencyExample.value),
description=Some(descriptionExample.value)))),
paymentService = Some(paymentServiceExample.value),
berlinGroupPayments=Some( SepaCreditTransfersBerlinGroupV13(endToEndIdentification=Some("string"),
instructionIdentification=Some("string"),
debtorName=Some("string"),
Expand Down Expand Up @@ -2446,9 +2447,9 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper 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], reasons: Option[List[TransactionRequestReason]], berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], 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]], paymentService: Option[String], berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = {
import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv400 => InBound, OutBoundCreateTransactionRequestv400 => OutBound}
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons, berlinGroupPayments)
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons, paymentService, berlinGroupPayments)
val response: Future[Box[InBound]] = sendRequest[InBound](getUrl(callContext, "createTransactionRequestv400"), HttpMethods.POST, req, callContext)
response.map(convertToTuple[TransactionRequest](callContext))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2504,6 +2504,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
amount=Some(amountExample.value),
currency=Some(currencyExample.value),
description=Some(descriptionExample.value)))),
paymentService = Some(paymentServiceExample.value),
berlinGroupPayments=Some( SepaCreditTransfersBerlinGroupV13(endToEndIdentification=Some("string"),
instructionIdentification=Some("string"),
debtorName=Some("string"),
Expand Down Expand Up @@ -2613,9 +2614,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], reasons: Option[List[TransactionRequestReason]], berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], 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]], paymentService: Option[String], berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson], callContext: Option[CallContext]): OBPReturnType[Box[TransactionRequest]] = {
import com.openbankproject.commons.dto.{InBoundCreateTransactionRequestv400 => InBound, OutBoundCreateTransactionRequestv400 => OutBound}
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons, berlinGroupPayments)
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, initiator, viewId, fromAccount, toAccount, transactionRequestType, transactionRequestCommonBody, detailsPlain, chargePolicy, challengeType, scaMethod, reasons, paymentService, berlinGroupPayments)
val response: Future[Box[InBound]] = sendRequest[InBound]("obp_create_transaction_requestv400", req, callContext)
response.map(convertToTuple[TransactionRequest](callContext))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,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], reasons: Option[List[TransactionRequestReason]], berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson]) 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]], paymentService: Option[String], berlinGroupPayments: Option[BerlinGroupTransactionRequestCommonBodyJson]) 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
Expand Down

0 comments on commit c7398e2

Please sign in to comment.