From ba28dbab6810b605a2856a3e1e6b05acf6ce389a Mon Sep 17 00:00:00 2001 From: struga Date: Wed, 25 May 2022 11:27:25 +0300 Subject: [PATCH] Add invoice format id (#37) --- pom.xml | 2 +- .../lib/converter/entry/CtxToEntryModelConverter.java | 8 +++++++- .../lib/converter/entry/RecCtxToEntryModelConverter.java | 4 +++- .../vality/adapter/flow/lib/model/BaseRequestModel.java | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 6a42042..e40b803 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ adapter-flow-lib - 0.1.7 + 0.1.8 jar adapter-flow-lib diff --git a/src/main/java/dev/vality/adapter/flow/lib/converter/entry/CtxToEntryModelConverter.java b/src/main/java/dev/vality/adapter/flow/lib/converter/entry/CtxToEntryModelConverter.java index ef8d902..083478e 100644 --- a/src/main/java/dev/vality/adapter/flow/lib/converter/entry/CtxToEntryModelConverter.java +++ b/src/main/java/dev/vality/adapter/flow/lib/converter/entry/CtxToEntryModelConverter.java @@ -63,12 +63,14 @@ public class CtxToEntryModelConverter implements Converter adapterConfigurations = context.getOptions(); Invoice invoice = paymentInfo.getInvoice(); InvoiceDetails details = invoice.getDetails(); + String invoiceFormatPaymentId = getInvoiceFormatPaymentId(payment, invoice); return EntryStateModel.builder() .baseRequestModel(BaseRequestModel.builder().recurrentPaymentData(recurrentPaymentData) .mobilePaymentData(mobilePaymentData) .cardData(cardData) .refundData(initRefundData(paymentInfo)) - .paymentId(idGenerator.get(invoice.getId())) + .paymentId(idGenerator.get(invoiceFormatPaymentId)) + .invoiceFormatPaymentId(invoiceFormatPaymentId) .createdAt(paymentInfo.getPayment().getCreatedAt()) .currency(Currency.builder() .symbolicCode(payment.getCost().getCurrency().getSymbolicCode()) @@ -91,6 +93,10 @@ public class CtxToEntryModelConverter implements Converter adapterConfigurations) { return callbackUrlExtractor.getSuccessRedirectUrl( adapterConfigurations, diff --git a/src/main/java/dev/vality/adapter/flow/lib/converter/entry/RecCtxToEntryModelConverter.java b/src/main/java/dev/vality/adapter/flow/lib/converter/entry/RecCtxToEntryModelConverter.java index dde16a8..bcc2421 100644 --- a/src/main/java/dev/vality/adapter/flow/lib/converter/entry/RecCtxToEntryModelConverter.java +++ b/src/main/java/dev/vality/adapter/flow/lib/converter/entry/RecCtxToEntryModelConverter.java @@ -49,7 +49,8 @@ public class RecCtxToEntryModelConverter implements Converter