Add trs id from respnse (#41)

This commit is contained in:
struga 2022-06-17 21:28:15 +03:00 committed by GitHub
parent 4c64ebaa3b
commit 7c2237f9c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -12,7 +12,7 @@
</parent> </parent>
<artifactId>adapter-flow-lib</artifactId> <artifactId>adapter-flow-lib</artifactId>
<version>0.1.11</version> <version>0.1.12</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>adapter-flow-lib</name> <name>adapter-flow-lib</name>

View File

@ -7,6 +7,7 @@ import dev.vality.adapter.flow.lib.model.ExitStateModel;
import dev.vality.adapter.flow.lib.utils.ErrorUtils; import dev.vality.adapter.flow.lib.utils.ErrorUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
@Slf4j @Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
@ -21,7 +22,10 @@ public class RetryProcessor implements Processor<ExitStateModel, BaseResponseMod
log.debug("Start redirect process response: {} entryStateModel: {}", response, entryStateModel); log.debug("Start redirect process response: {} entryStateModel: {}", response, entryStateModel);
ExitStateModel exitStateModel = new ExitStateModel(); ExitStateModel exitStateModel = new ExitStateModel();
exitStateModel.setLastOperationStatus(response.getStatus()); exitStateModel.setLastOperationStatus(response.getStatus());
exitStateModel.setProviderTrxId(entryStateModel.getBaseRequestModel().getProviderTrxId()); exitStateModel.setProviderTrxId(
StringUtils.hasText(response.getProviderTrxId())
? response.getProviderTrxId()
: entryStateModel.getBaseRequestModel().getProviderTrxId());
exitStateModel.setTrxExtra(response.getSaveData()); exitStateModel.setTrxExtra(response.getSaveData());
exitStateModel.setAdditionalTrxInfo(response.getAdditionalTrxInfo()); exitStateModel.setAdditionalTrxInfo(response.getAdditionalTrxInfo());
log.debug("Finish redirect process response: {} entryStateModel: {}", response, entryStateModel); log.debug("Finish redirect process response: {} entryStateModel: {}", response, entryStateModel);