Skip to content

Commit e11cfee

Browse files
committed
fix payment account creation within pre authorization without pre registration
1 parent 6ef388f commit e11cfee

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ThisBuild / organization := "app.softnetwork"
22

33
name := "payment"
44

5-
ThisBuild / version := "0.7.3"
5+
ThisBuild / version := "0.7.3.1"
66

77
ThisBuild / scalaVersion := "2.12.18"
88

core/src/main/scala/app/softnetwork/payment/persistence/typed/PreAuthorizationCommandHandler.scala

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,13 @@ trait PreAuthorizationCommandHandler
284284
case Transaction.TransactionStatus.TRANSACTION_PENDING_PAYMENT
285285
if transaction.paymentClientReturnUrl.isDefined =>
286286
Effect
287-
.persist(walletEvents :+ transactionUpdatedEvent)
287+
.persist(
288+
List(
289+
PaymentAccountUpsertedEvent.defaultInstance
290+
.withDocument(updatedPaymentAccount)
291+
.withLastUpdated(lastUpdated)
292+
) ++ walletEvents :+ transactionUpdatedEvent
293+
)
288294
.thenRun(_ =>
289295
PaymentRequired(
290296
transaction.id,
@@ -296,7 +302,13 @@ trait PreAuthorizationCommandHandler
296302
case Transaction.TransactionStatus.TRANSACTION_CREATED
297303
if transaction.redirectUrl.isDefined => // 3ds
298304
Effect
299-
.persist(walletEvents :+ transactionUpdatedEvent)
305+
.persist(
306+
List(
307+
PaymentAccountUpsertedEvent.defaultInstance
308+
.withDocument(updatedPaymentAccount)
309+
.withLastUpdated(lastUpdated)
310+
) ++ walletEvents :+ transactionUpdatedEvent
311+
)
300312
.thenRun(_ =>
301313
PaymentRedirection(
302314
transaction.redirectUrl.get

0 commit comments

Comments
 (0)