Added logs (#21)

Co-authored-by: Inal Arsanukaev <inalarsanukaev@MacBook-Pro-Inal.local>
This commit is contained in:
Inal Arsanukaev 2020-05-19 18:30:01 +03:00 committed by GitHub
parent 998c87a9ab
commit 128916014e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.rbkmoney</groupId> <groupId>com.rbkmoney</groupId>
<artifactId>adapter-bank-payout-spring-boot-starter</artifactId> <artifactId>adapter-bank-payout-spring-boot-starter</artifactId>
<version>1.0.7</version> <version>1.0.8</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Adapter-bank-payout-spring-boot-starter</name> <name>Adapter-bank-payout-spring-boot-starter</name>

View File

@ -12,6 +12,7 @@ public class EntryStateModel {
private String currencyCode; private String currencyCode;
@ToString.Exclude @ToString.Exclude
private String pan; private String pan;
@ToString.Exclude
private Map<String, String> options; private Map<String, String> options;
private AdapterState state; private AdapterState state;

View File

@ -34,13 +34,16 @@ public class PayoutAdapterService<T extends EntryStateModel, X extends ExitState
public ProcessResult processWithdrawal(Withdrawal withdrawal, Value state, Map<String, String> options) throws TException { public ProcessResult processWithdrawal(Withdrawal withdrawal, Value state, Map<String, String> options) throws TException {
validator.validate(withdrawal, state, options); validator.validate(withdrawal, state, options);
T entryStateModel = withdrawalToEntryStateConverter.convert(withdrawal, state, options); T entryStateModel = withdrawalToEntryStateConverter.convert(withdrawal, state, options);
log.info("EntryStateModel: {}", entryStateModel);
entryStateModel.getState().setStep(resolver.resolveEntry(entryStateModel)); entryStateModel.getState().setStep(resolver.resolveEntry(entryStateModel));
X exitStateModel = handlers.stream() X exitStateModel = handlers.stream()
.filter(h -> h.isHandle(entryStateModel)) .filter(h -> h.isHandle(entryStateModel))
.findFirst() .findFirst()
.orElseThrow(UnsupportedMethodException::new) .orElseThrow(UnsupportedMethodException::new)
.handle(entryStateModel); .handle(entryStateModel);
log.info("ExitStateModel: {}", exitStateModel);
exitStateModel.getNextState().setStep(resolver.resolveExit(exitStateModel)); exitStateModel.getNextState().setStep(resolver.resolveExit(exitStateModel));
log.info("Step changing: {} -> {}", entryStateModel.getState().getStep(), exitStateModel.getNextState().getStep());
return exitStateToProcessResultConverter.convert(exitStateModel); return exitStateToProcessResultConverter.convert(exitStateModel);
} }