mirror of
https://github.com/valitydev/adapter-flow-lib.git
synced 2024-11-06 00:05:22 +00:00
Add invoice format id (#37)
This commit is contained in:
parent
b0b410cef2
commit
ba28dbab68
2
pom.xml
2
pom.xml
@ -12,7 +12,7 @@
|
||||
</parent>
|
||||
|
||||
<artifactId>adapter-flow-lib</artifactId>
|
||||
<version>0.1.7</version>
|
||||
<version>0.1.8</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>adapter-flow-lib</name>
|
||||
|
@ -63,12 +63,14 @@ public class CtxToEntryModelConverter implements Converter<PaymentContext, Entry
|
||||
Map<String, String> 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<PaymentContext, Entry
|
||||
.build();
|
||||
}
|
||||
|
||||
private String getInvoiceFormatPaymentId(InvoicePayment payment, Invoice invoice) {
|
||||
return invoice.getId() + "." + payment.getId();
|
||||
}
|
||||
|
||||
private String getSuccessRedirectUrl(InvoicePayment payment, Map<String, String> adapterConfigurations) {
|
||||
return callbackUrlExtractor.getSuccessRedirectUrl(
|
||||
adapterConfigurations,
|
||||
|
@ -49,7 +49,8 @@ public class RecCtxToEntryModelConverter implements Converter<RecurrentTokenCont
|
||||
var mobilePaymentData = initMobilePaymentData(context, generalExitStateModel);
|
||||
|
||||
TransactionInfo transactionInfo = tokenInfo.getTrx();
|
||||
Long orderId = idGenerator.get(tokenInfo.getPaymentTool().getId());
|
||||
String invoiceFormatPaymentId = tokenInfo.getPaymentTool().getId();
|
||||
Long orderId = idGenerator.get(invoiceFormatPaymentId);
|
||||
var temporaryContext = temporaryContextService.getTemporaryContext(context, temporaryContextDeserializer);
|
||||
|
||||
return entryStateModelBuilder
|
||||
@ -65,6 +66,7 @@ public class RecCtxToEntryModelConverter implements Converter<RecurrentTokenCont
|
||||
.cardData(cardData)
|
||||
.refundData(initRefundData(recurrentPaymentTool, orderId))
|
||||
.paymentId(orderId)
|
||||
.invoiceFormatPaymentId(invoiceFormatPaymentId)
|
||||
.currency(Currency.builder()
|
||||
.symbolicCode(
|
||||
recurrentPaymentTool.getMinimalPaymentCost().getCurrency().getSymbolicCode())
|
||||
|
@ -20,6 +20,10 @@ public class BaseRequestModel {
|
||||
* Uniq Long identifier for payment.
|
||||
*/
|
||||
private Long paymentId;
|
||||
/**
|
||||
* Uniq String identifier for payment invoice format.
|
||||
*/
|
||||
private String invoiceFormatPaymentId;
|
||||
/**
|
||||
* Uniq identifier from provider (if exists), not come in first methods.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user