Skip to content

Commit

Permalink
Merge pull request #2423 from hongwei1/develop
Browse files Browse the repository at this point in the history
feature/BGv1.3 added periodic_payments - fixed failed tests
  • Loading branch information
simonredfern authored Sep 11, 2024
2 parents afcaca8 + 9b9a07a commit 2ee2299
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,19 +573,28 @@ object SwaggerDefinitionsJSON {
to = toAccountTransferToAccount
)

val sepaCreditTransfers = SepaCreditTransfers(
debtorAccount = PaymentAccount(iban = "12345"),
instructedAmount = amountOfMoneyJsonV121,
creditorAccount = PaymentAccount(iban = "54321"),
creditorName = "John Miles"
)

val sepaCreditTransfersBerlinGroupV13 = SepaCreditTransfersBerlinGroupV13(
debtorAccount = PaymentAccount(iban = "GB33BUKB20201555555555"),
instructedAmount = amountOfMoneyJsonV121,
creditorAccount = PaymentAccount(iban = "DE75512108001245126199"),
creditorName = "John Miles"
)
val sepaCreditTransfers = SepaCreditTransfers(
debtorAccount = PaymentAccount(iban = "12345"),
instructedAmount = amountOfMoneyJsonV121,
creditorAccount = PaymentAccount(iban = "54321"),
creditorName = "John Miles"
)

val sepaCreditTransfersBerlinGroupV13 = SepaCreditTransfersBerlinGroupV13(
debtorAccount = PaymentAccount(iban = "GB33BUKB20201555555555"),
instructedAmount = amountOfMoneyJsonV121,
creditorAccount = PaymentAccount(iban = "DE75512108001245126199"),
creditorName = "John Miles"
)

val periodicSepaCreditTransfersBerlinGroupV13 = PeriodicSepaCreditTransfersBerlinGroupV13(
debtorAccount = PaymentAccount(iban = "GB33BUKB20201555555555"),
instructedAmount = amountOfMoneyJsonV121,
creditorAccount = PaymentAccount(iban = "DE75512108001245126199"),
creditorName = "John Miles",
frequency = "Monthly",
startDate ="2018-03-01",
)

val transactionRequestSimple= TransactionRequestSimple(
otherBankRoutingScheme = bankRoutingSchemeExample.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import net.liftweb.util.StringHelpers
import scala.collection.mutable.ListBuffer
import com.openbankproject.commons.model.ListResult
import code.util.Helper.MdcLoggable
import net.liftweb.common.Box.tryo
import net.liftweb.common.{EmptyBox, Full}
import net.liftweb.json

Expand Down Expand Up @@ -692,7 +693,12 @@ object SwaggerJSONFactory extends MdcLoggable {
case _ if isOneOfType[Coll[BigDecimal], Coll[JBigDecimal]] => s""" {"type":"array", "items":{"type": "string", "format":"double","example":"123.321"}}"""
case _ if isOneOfType[Option[Coll[BigDecimal]], Option[Coll[JBigDecimal]]] => s""" {"type":"array", "items":{"type": "string", "format":"double","example":"123.321"}}"""
//Date
case _ if isOneOfType[Date, Option[Date]] => s""" {"type":"string", "format":"date","example":"${APIUtil.DateWithSecondsFormat.format(exampleValue)}"}"""
case _ if isOneOfType[Date, Option[Date]] => {
val valueBox = tryo {s"""${APIUtil.DateWithSecondsFormat.format(exampleValue)}"""}
if(valueBox.isEmpty) logger.debug(s"isOneOfType[Date, Option[Date]]- Current Example Value is: $paramType - $exampleValue")
val value = valueBox.getOrElse(APIUtil.DateWithSecondsExampleString)
s""" {"type":"string", "format":"date","example":"$value"}"""
}
case _ if isOneOfType[Coll[Date], Option[Coll[Date]]] => s""" {"type":"array", "items":{"type":"string", "format":"date"}}"""

//List or Array Option data.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package code.api.builder.PaymentInitiationServicePISApi

import code.api.Constant
import code.api.ResourceDocs1_4_0.SwaggerDefinitionsJSON.sepaCreditTransfersBerlinGroupV13
import code.api.berlin.group.v1_3.JSONFactory_BERLIN_GROUP_1_3.{CancelPaymentResponseJson, CancelPaymentResponseLinks, LinkHrefJson, UpdatePaymentPsuDataJson, checkAuthorisationConfirmation, checkSelectPsuAuthenticationMethod, checkTransactionAuthorisation, checkUpdatePsuAuthentication, createCancellationTransactionRequestJson}
import code.api.berlin.group.v1_3.{JSONFactory_BERLIN_GROUP_1_3, JvalueCaseClass, OBP_BERLIN_GROUP_1_3}
import code.api.util.APIUtil._
Expand Down Expand Up @@ -633,7 +632,19 @@ Check the transaction status of a payment initiation.""",
"/payments/PAYMENT_PRODUCT",
"Payment initiation request(payments)",
generalPaymentSummary,
sepaCreditTransfersBerlinGroupV13,
json.parse(s"""{
"debtorAccount": {
"iban": "DE123456987480123"
},
"instructedAmount": {
"currency": "EUR",
"amount": "100"
},
"creditorAccount": {
"iban": "UK12 1234 5123 4517 2948 6166 077"
},
"creditorName": "70charname"
}"""),
json.parse(s"""{
"transactionStatus": "RCVD",
"paymentId": "1234-wertiq-983",
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 @@ -1088,6 +1088,7 @@ trait Connector extends MdcLoggable {
charge,
chargePolicy,
None,
None,
)
} map {
unboxFullOrFail(_, callContext, s"$InvalidConnectorResponseForCreateTransactionRequestImpl210")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ object ConnectorBuilderUtil {
//"getCustomerByCustomerIdLegacy", // should not generate for Legacy methods

"createChallenges",
"createTransactionRequestv400",
"getCustomersByCustomerPhoneNumber",
"getTransactionAttributeById",
"createOrUpdateCustomerAttribute",
Expand Down Expand Up @@ -390,6 +389,7 @@ object ConnectorBuilderUtil {
"makePaymentv200",
"createTransactionRequest",
"createTransactionRequestv200",
"createTransactionRequestv400",
"getStatus",
"getChargeValue",
"saveTransactionRequestTransaction",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5023,8 +5023,8 @@ object LocalMappedConnector extends Connector with MdcLoggable {
status.toString,
charge,
chargePolicy,
None, //berlinGroupPayments this is only from BerlinGroup
)
None,
None)
} map {
unboxFullOrFail(_, callContext, s"$InvalidConnectorResponseForCreateTransactionRequestImpl210")
}
Expand Down Expand Up @@ -5180,6 +5180,7 @@ object LocalMappedConnector extends Connector with MdcLoggable {
status.toString,
charge,
chargePolicy,
paymentService,
berlinGroupPayments
)
saveTransactionRequestReasons(reasons, transactionRequest)
Expand Down
Loading

0 comments on commit 2ee2299

Please sign in to comment.