Fix get card data (#6)

This commit is contained in:
struga 2022-02-28 16:49:05 +03:00 committed by GitHub
parent 760ccdd746
commit 8a48e7260a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -13,7 +13,7 @@
</parent> </parent>
<artifactId>adapter-flow-lib</artifactId> <artifactId>adapter-flow-lib</artifactId>
<version>0.0.2</version> <version>0.0.3</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>adapter-flow-lib</name> <name>adapter-flow-lib</name>

View File

@ -13,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.Converter;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.util.HashMap;
@Slf4j @Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
public class ExitModelToProxyResultConverter implements Converter<ExitStateModel, PaymentProxyResult> { public class ExitModelToProxyResultConverter implements Converter<ExitStateModel, PaymentProxyResult> {
@ -33,7 +35,10 @@ public class ExitModelToProxyResultConverter implements Converter<ExitStateModel
return new PaymentProxyResult(intent) return new PaymentProxyResult(intent)
.setNextState(serializer.writeByte(contextConverter.convert(exitStateModel))) .setNextState(serializer.writeByte(contextConverter.convert(exitStateModel)))
.setTrx(DomainPackageCreators.createTransactionInfo( .setTrx(DomainPackageCreators.createTransactionInfo(
exitStateModel.getProviderTrxId(), exitStateModel.getTrxExtra()) exitStateModel.getProviderTrxId(),
exitStateModel.getTrxExtra() != null
? exitStateModel.getTrxExtra()
: new HashMap<>())
); );
} }

View File

@ -10,6 +10,8 @@ import dev.vality.damsel.proxy_provider.RecurrentTokenProxyResult;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.Converter;
import java.util.HashMap;
import static dev.vality.java.damsel.utils.creators.DomainPackageCreators.createTransactionInfo; import static dev.vality.java.damsel.utils.creators.DomainPackageCreators.createTransactionInfo;
@RequiredArgsConstructor @RequiredArgsConstructor
@ -35,7 +37,10 @@ public class ExitModelToRecTokenProxyResultConverter implements Converter<ExitSt
return new RecurrentTokenProxyResult(intent) return new RecurrentTokenProxyResult(intent)
.setNextState(serializer.writeByte(contextConverter.convert(exitStateModel))) .setNextState(serializer.writeByte(contextConverter.convert(exitStateModel)))
.setTrx(createTransactionInfo( .setTrx(createTransactionInfo(
exitStateModel.getProviderTrxId(), exitStateModel.getTrxExtra()) exitStateModel.getProviderTrxId(),
exitStateModel.getTrxExtra() != null
? exitStateModel.getTrxExtra()
: new HashMap<>())
); );
} }