mirror of
https://github.com/valitydev/adapter-flow-lib.git
synced 2024-11-06 00:05:22 +00:00
INT-375: Fix CallbackUrlExtractor interface (add an option for processing options map) (#55)
Co-authored-by: dmitriibaikov <bdv@empayre.com>
This commit is contained in:
parent
97d85e7ee5
commit
577d4b465d
2
pom.xml
2
pom.xml
@ -12,7 +12,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>adapter-flow-lib</artifactId>
|
<artifactId>adapter-flow-lib</artifactId>
|
||||||
<version>0.1.20</version>
|
<version>0.1.21</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>adapter-flow-lib</name>
|
<name>adapter-flow-lib</name>
|
||||||
|
@ -6,8 +6,11 @@ public interface CallbackUrlExtractor {
|
|||||||
|
|
||||||
String TERMINATION_URI = "termination_uri";
|
String TERMINATION_URI = "termination_uri";
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
String extractCallbackUrl(String redirectUrl);
|
String extractCallbackUrl(String redirectUrl);
|
||||||
|
|
||||||
|
String extractCallbackUrl(Map<String, String> adapterConfigurations, String redirectUrl);
|
||||||
|
|
||||||
String getSuccessRedirectUrl(Map<String, String> adapterConfigurations, String redirectUrl);
|
String getSuccessRedirectUrl(Map<String, String> adapterConfigurations, String redirectUrl);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -48,9 +48,11 @@ public class IntentResultFactory {
|
|||||||
ThreeDsData threeDsData = exitStateModel.getThreeDsData();
|
ThreeDsData threeDsData = exitStateModel.getThreeDsData();
|
||||||
Map<String, String> params = ThreeDsDataInitializer.initThreeDsParameters(exitStateModel);
|
Map<String, String> params = ThreeDsDataInitializer.initThreeDsParameters(exitStateModel);
|
||||||
String redirectUrl = entryStateModel.getBaseRequestModel().getSuccessRedirectUrl();
|
String redirectUrl = entryStateModel.getBaseRequestModel().getSuccessRedirectUrl();
|
||||||
params.put(RedirectFields.TERM_URL.getValue(), callbackUrlExtractor.extractCallbackUrl(redirectUrl));
|
Map<String, String> adapterConfigurations = entryStateModel.getBaseRequestModel().getAdapterConfigurations();
|
||||||
|
params.put(RedirectFields.TERM_URL.getValue(),
|
||||||
|
callbackUrlExtractor.extractCallbackUrl(adapterConfigurations, redirectUrl));
|
||||||
int timerRedirectTimeoutMin = extractRedirectTimeout(
|
int timerRedirectTimeoutMin = extractRedirectTimeout(
|
||||||
entryStateModel.getBaseRequestModel().getAdapterConfigurations(),
|
adapterConfigurations,
|
||||||
timerProperties.getRedirectTimeoutMin());
|
timerProperties.getRedirectTimeoutMin());
|
||||||
return Intent.suspend(
|
return Intent.suspend(
|
||||||
new SuspendIntent(
|
new SuspendIntent(
|
||||||
@ -71,10 +73,12 @@ public class IntentResultFactory {
|
|||||||
exitStateModel.setPollingInfo(pollingInfo);
|
exitStateModel.setPollingInfo(pollingInfo);
|
||||||
|
|
||||||
String redirectUrl = entryStateModel.getBaseRequestModel().getSuccessRedirectUrl();
|
String redirectUrl = entryStateModel.getBaseRequestModel().getSuccessRedirectUrl();
|
||||||
params.put(RedirectFields.TERM_URL.getValue(), callbackUrlExtractor.extractCallbackUrl(redirectUrl));
|
Map<String, String> adapterConfigurations = entryStateModel.getBaseRequestModel().getAdapterConfigurations();
|
||||||
|
params.put(RedirectFields.TERM_URL.getValue(),
|
||||||
|
callbackUrlExtractor.extractCallbackUrl(adapterConfigurations, redirectUrl));
|
||||||
ThreeDsData threeDsData = exitStateModel.getThreeDsData();
|
ThreeDsData threeDsData = exitStateModel.getThreeDsData();
|
||||||
int timerRedirectTimeoutMin = extractRedirectTimeout(
|
int timerRedirectTimeoutMin = extractRedirectTimeout(
|
||||||
entryStateModel.getBaseRequestModel().getAdapterConfigurations(),
|
adapterConfigurations,
|
||||||
timerProperties.getRedirectTimeoutMin());
|
timerProperties.getRedirectTimeoutMin());
|
||||||
return Intent.suspend(
|
return Intent.suspend(
|
||||||
new SuspendIntent(
|
new SuspendIntent(
|
||||||
|
@ -34,9 +34,11 @@ public class RecurrentIntentResultFactory {
|
|||||||
ThreeDsData threeDsData = exitStateModel.getThreeDsData();
|
ThreeDsData threeDsData = exitStateModel.getThreeDsData();
|
||||||
Map<String, String> params = ThreeDsDataInitializer.initThreeDsParameters(exitStateModel);
|
Map<String, String> params = ThreeDsDataInitializer.initThreeDsParameters(exitStateModel);
|
||||||
String redirectUrl = entryStateModel.getBaseRequestModel().getSuccessRedirectUrl();
|
String redirectUrl = entryStateModel.getBaseRequestModel().getSuccessRedirectUrl();
|
||||||
params.put(RedirectFields.TERM_URL.getValue(), callbackUrlExtractor.extractCallbackUrl(redirectUrl));
|
Map<String, String> adapterConfigurations = entryStateModel.getBaseRequestModel().getAdapterConfigurations();
|
||||||
|
params.put(RedirectFields.TERM_URL.getValue(),
|
||||||
|
callbackUrlExtractor.extractCallbackUrl(adapterConfigurations, redirectUrl));
|
||||||
int timerRedirectTimeoutMin = extractRedirectTimeout(
|
int timerRedirectTimeoutMin = extractRedirectTimeout(
|
||||||
entryStateModel.getBaseRequestModel().getAdapterConfigurations(),
|
adapterConfigurations,
|
||||||
timerProperties.getRedirectTimeoutMin());
|
timerProperties.getRedirectTimeoutMin());
|
||||||
return RecurrentTokenIntent.suspend(
|
return RecurrentTokenIntent.suspend(
|
||||||
new SuspendIntent(
|
new SuspendIntent(
|
||||||
|
@ -16,6 +16,11 @@ public class CallbackUrlExtractorImpl implements CallbackUrlExtractor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String extractCallbackUrl(String redirectUrl) {
|
public String extractCallbackUrl(String redirectUrl) {
|
||||||
|
return extractCallbackUrl(null, redirectUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String extractCallbackUrl(Map<String, String> adapterConfigurations, String redirectUrl) {
|
||||||
return UriComponentsBuilder.fromUriString(adapterProperties.getCallbackUrl())
|
return UriComponentsBuilder.fromUriString(adapterProperties.getCallbackUrl())
|
||||||
.path(adapterProperties.getPathCallbackUrl())
|
.path(adapterProperties.getPathCallbackUrl())
|
||||||
.queryParam(TERMINATION_URI, redirectUrl).build().toUriString();
|
.queryParam(TERMINATION_URI, redirectUrl).build().toUriString();
|
||||||
|
Loading…
Reference in New Issue
Block a user