Fix proto (#11)

This commit is contained in:
struga 2022-03-23 18:16:28 +03:00 committed by GitHub
parent d6288f3d0d
commit 4a28a6483c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 5 deletions

View File

@ -25,8 +25,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<machinegun-proto.version>1.21-e4784ab</machinegun-proto.version>
<fraudbusters-proto.version>1.102-269908f</fraudbusters-proto.version>
<fistful-proto.version>1.133-c484877</fistful-proto.version>
<fraudbusters-proto.version>1.108-0800fde</fraudbusters-proto.version>
<fistful-proto.version>1.143-711814e</fistful-proto.version>
</properties>
<dependencies>

View File

@ -4,9 +4,7 @@ import dev.vality.damsel.domain.BankCard;
import dev.vality.damsel.domain.CountryCode;
import dev.vality.damsel.domain.LegacyBankCardPaymentSystem;
import dev.vality.damsel.domain.PaymentSystemRef;
import dev.vality.damsel.fraudbusters.CryptoWallet;
import dev.vality.damsel.fraudbusters.DigitalWallet;
import dev.vality.damsel.fraudbusters.Resource;
import dev.vality.damsel.fraudbusters.*;
import dev.vality.fraudbusters.mg.connector.exception.UnknownResourceException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.convert.converter.Converter;
@ -41,6 +39,16 @@ public class FistfulResourceToDomainResourceConverter
.getDigitalWallet().getPaymentService().getId());
}
resource.setDigitalWallet(digitalWallet);
} else if (fistfulResource.isSetGeneric()) {
GenericPaymentTool genericPaymentTool = new GenericPaymentTool();
genericPaymentTool.setId(fistfulResource.getGeneric().getGeneric().getProvider().getId());
if (fistfulResource.getGeneric().getGeneric().isSetData()) {
genericPaymentTool.setContent(new Content()
.setData(fistfulResource.getGeneric().getGeneric().getData().getData())
.setType(fistfulResource.getGeneric().getGeneric().getData().getType())
);
}
resource.setGeneric(genericPaymentTool);
} else {
log.error("Unknown resource type: {}", fistfulResource);
throw new UnknownResourceException();