Mamsel added, damsel updated

This commit is contained in:
e.chernyak 2021-05-12 18:38:30 +03:00 committed by e.chernyak
parent 6a1041a3a1
commit 0693b60852
4 changed files with 14 additions and 7 deletions

View File

@ -6,7 +6,7 @@
<parent>
<groupId>com.rbkmoney</groupId>
<artifactId>service-parent-pom</artifactId>
<version>1.1.1</version>
<version>1.2.0</version>
</parent>
<artifactId>fraudbusters-mg-connector</artifactId>
@ -55,6 +55,10 @@
<groupId>com.rbkmoney</groupId>
<artifactId>damsel</artifactId>
</dependency>
<dependency>
<groupId>com.rbkmoney</groupId>
<artifactId>mamsel</artifactId>
</dependency>
<dependency>
<groupId>com.rbkmoney</groupId>
<artifactId>machinegun-proto</artifactId>

View File

@ -1,7 +1,8 @@
package com.rbkmoney.fraudbusters.mg.connector.converter;
import com.rbkmoney.damsel.domain.BankCard;
import com.rbkmoney.damsel.domain.BankCardPaymentSystem;
import com.rbkmoney.damsel.domain.LegacyBankCardPaymentSystem;
import com.rbkmoney.damsel.domain.PaymentSystemRef;
import com.rbkmoney.damsel.domain.Residence;
import com.rbkmoney.damsel.fraudbusters.CryptoWallet;
import com.rbkmoney.damsel.fraudbusters.Resource;
@ -15,7 +16,8 @@ import org.springframework.stereotype.Component;
public class FistfulResourceToDomainResourceConverter
implements Converter<com.rbkmoney.fistful.base.Resource, Resource> {
public static final BankCardPaymentSystem DEAFAULT_PAYMENT_SYSTEM = BankCardPaymentSystem.visa;
public static final PaymentSystemRef DEFAULT_PAYMENT_SYSTEM =
new PaymentSystemRef(LegacyBankCardPaymentSystem.visa.name());
public static final String UNKNOWN = "UNKNOWN";
@Override
@ -45,8 +47,8 @@ public class FistfulResourceToDomainResourceConverter
? Residence.valueOf(bankCardFrom.getIssuerCountry().name())
: null);
bankCard.setPaymentSystem(bankCardFrom.isSetPaymentSystem()
? BankCardPaymentSystem.valueOf(bankCardFrom.getPaymentSystem().name())
: DEAFAULT_PAYMENT_SYSTEM);
? new PaymentSystemRef(bankCardFrom.getPaymentSystem().name())
: DEFAULT_PAYMENT_SYSTEM);
bankCard.setLastDigits(bankCardFrom.getMaskedPan() != null
? bankCardFrom.getMaskedPan()
: UNKNOWN);

View File

@ -13,6 +13,7 @@ import com.rbkmoney.fraudbusters.mg.connector.mapper.initializer.InfoInitializer
import com.rbkmoney.fraudbusters.mg.connector.service.HgClientService;
import com.rbkmoney.geck.common.util.TBaseUtil;
import com.rbkmoney.machinegun.eventsink.MachineEvent;
import com.rbkmoney.mamsel.TokenProviderUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@ -103,6 +104,6 @@ public class PaymentMapper implements Mapper<InvoiceChange, MachineEvent, Paymen
}
public boolean isMobile(PaymentTool paymentTool) {
return paymentTool.isSetBankCard() && paymentTool.getBankCard().isSetTokenProvider();
return paymentTool.isSetBankCard() && TokenProviderUtil.isSetTokenProvider(paymentTool.getBankCard());
}
}

View File

@ -415,7 +415,7 @@ public class MgEventSinkFlowGenerator {
paymentTool.setBankCard(
new BankCard()
.setToken("477bba133c182267fe5f086924abdc5db71f77bfc27f01f2843f2cdc69d89f05")
.setPaymentSystem(BankCardPaymentSystem.mastercard)
.setPaymentSystem(new PaymentSystemRef(LegacyBankCardPaymentSystem.mastercard.name()))
.setBin(BIN)
.setLastDigits("4242")
.setIssuerCountry(Residence.RUS)