mirror of
https://github.com/valitydev/adapter-flow-lib.git
synced 2024-11-06 00:05:22 +00:00
Fill 'details' with 'product' if 'description' is null (#35)
Co-authored-by: Inal Arsanukaev <inalarsanukaev@192.168.1.5>
This commit is contained in:
parent
ba825592ca
commit
b0b410cef2
2
pom.xml
2
pom.xml
@ -12,7 +12,7 @@
|
||||
</parent>
|
||||
|
||||
<artifactId>adapter-flow-lib</artifactId>
|
||||
<version>0.1.6</version>
|
||||
<version>0.1.7</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>adapter-flow-lib</name>
|
||||
|
@ -19,6 +19,7 @@ import dev.vality.cds.storage.Auth3DS;
|
||||
import dev.vality.cds.storage.CardData;
|
||||
import dev.vality.cds.storage.SessionData;
|
||||
import dev.vality.damsel.domain.BankCard;
|
||||
import dev.vality.damsel.domain.InvoiceDetails;
|
||||
import dev.vality.damsel.domain.TransactionInfo;
|
||||
import dev.vality.damsel.proxy_provider.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -26,6 +27,7 @@ import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class CtxToEntryModelConverter implements Converter<PaymentContext, EntryStateModel> {
|
||||
@ -59,19 +61,21 @@ public class CtxToEntryModelConverter implements Converter<PaymentContext, Entry
|
||||
TransactionInfo trx = payment.getTrx();
|
||||
RecurrentPaymentData recurrentPaymentData = initRecurrentPaymentData(payment, paymentResource, trx);
|
||||
Map<String, String> adapterConfigurations = context.getOptions();
|
||||
Invoice invoice = paymentInfo.getInvoice();
|
||||
InvoiceDetails details = invoice.getDetails();
|
||||
return EntryStateModel.builder()
|
||||
.baseRequestModel(BaseRequestModel.builder().recurrentPaymentData(recurrentPaymentData)
|
||||
.mobilePaymentData(mobilePaymentData)
|
||||
.cardData(cardData)
|
||||
.refundData(initRefundData(paymentInfo))
|
||||
.paymentId(idGenerator.get(paymentInfo.getInvoice().getId()))
|
||||
.paymentId(idGenerator.get(invoice.getId()))
|
||||
.createdAt(paymentInfo.getPayment().getCreatedAt())
|
||||
.currency(Currency.builder()
|
||||
.symbolicCode(payment.getCost().getCurrency().getSymbolicCode())
|
||||
.numericCode(payment.getCost().getCurrency().getNumericCode())
|
||||
.build()
|
||||
).amount(payment.getCost().getAmount())
|
||||
.details(paymentInfo.getInvoice().getDetails().getDescription())
|
||||
.details(Objects.requireNonNullElse(details.getDescription(), details.getProduct()))
|
||||
.payerInfo(PayerInfo.builder()
|
||||
.ip(ProxyProviderPackageCreators.extractIpAddress(context))
|
||||
.build())
|
||||
|
Loading…
Reference in New Issue
Block a user