Add phone

This commit is contained in:
k.struzhkin 2021-11-23 14:00:45 +03:00
parent fda74ddddd
commit 29078dfad6
6 changed files with 11 additions and 9 deletions

@ -1 +1 @@
Subproject commit be44d69fc87b22a0bb82d98d6eae7658d1647f98
Subproject commit 24aa772730be966667adb285a09fcb494d4f218e

View File

@ -25,7 +25,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<machinegun-proto.version>1.18-d814d69</machinegun-proto.version>
<fraudbusters-proto.version>1.97-28a6a95</fraudbusters-proto.version>
<fraudbusters-proto.version>1.99-2a8f6ca</fraudbusters-proto.version>
<fistful-proto.version>1.128-d331fce</fistful-proto.version>
</properties>

View File

@ -63,12 +63,13 @@ public class PaymentMapper implements Mapper<InvoiceChange, MachineEvent, Paymen
private Payment initPayment(MachineEvent event, InvoicePaymentStatusChanged invoicePaymentStatusChanged,
com.rbkmoney.damsel.domain.Invoice invoice, InvoicePayment invoicePayment, Payer payer,
PaymentTool paymentTool) {
com.rbkmoney.damsel.domain.InvoicePayment payment = invoicePayment.getPayment();
return new Payment()
.setStatus(TBaseUtil.unionFieldToEnum(invoicePaymentStatusChanged.getStatus(), PaymentStatus.class))
.setCost(invoicePayment.getPayment().getCost())
.setCost(payment.getCost())
.setReferenceInfo(generalInfoInitiator.initReferenceInfo(invoice))
.setPaymentTool(paymentTool)
.setId(String.join(DELIMITER, invoice.getId(), invoicePayment.getPayment().getId()))
.setId(String.join(DELIMITER, invoice.getId(), payment.getId()))
.setEventTime(event.getCreatedAt())
.setClientInfo(generalInfoInitiator.initClientInfo(payer))
.setProviderInfo(generalInfoInitiator.initProviderInfo(invoicePayment))

View File

@ -47,13 +47,14 @@ public class GeneralInfoInitiator implements InfoInitializer<InvoicePaymentStatu
clientInfo.setFingerprint(clientInfoRes.getFingerprint());
}
}
initEmail(clientInfo, payer);
initContactInfo(clientInfo, payer);
return clientInfo;
}
public void initEmail(ClientInfo clientInfo, Payer payer) {
public void initContactInfo(ClientInfo clientInfo, Payer payer) {
if (payer.isSetPaymentResource() && payer.getPaymentResource().isSetContactInfo()) {
clientInfo.setEmail(payer.getPaymentResource().getContactInfo().getEmail());
clientInfo.setPhone(payer.getPaymentResource().getContactInfo().getPhoneNumber());
}
}

View File

@ -15,7 +15,7 @@ public interface InfoInitializer<T> {
ClientInfo initClientInfo(Payer payer);
void initEmail(ClientInfo clientInfo, Payer payer);
void initContactInfo(ClientInfo clientInfo, Payer payer);
ProviderInfo initProviderInfo(InvoicePayment invoicePayment);

View File

@ -47,8 +47,8 @@ public class RefundInfoInitiatorDecorator implements InfoInitializer<InvoicePaym
}
@Override
public void initEmail(ClientInfo clientInfo, Payer payer) {
generalInfoInitiator.initEmail(clientInfo, payer);
public void initContactInfo(ClientInfo clientInfo, Payer payer) {
generalInfoInitiator.initContactInfo(clientInfo, payer);
}
@NonNull