Skip to content

Commit

Permalink
remove extra backslash for possdk
Browse files Browse the repository at this point in the history
  • Loading branch information
jillingk committed Sep 30, 2024
1 parent d9344b5 commit 987f2ef
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Adyen/Service/AbstractService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ private static string ConstructLiveUrl(Config config, string url)
// Change base url for Live environment
if (url.Contains(PaymentPrefix))
{
// TODO these errors are not easy catchable for some reason, should be fixed first
if (config.LiveEndpointUrlPrefix == default)
{
throw new InvalidOperationException(ExceptionMessages.MissingLiveEndpointUrlPrefix);
Expand All @@ -111,11 +110,20 @@ private static string ConstructLiveUrl(Config config, string url)
{
throw new InvalidOperationException(ExceptionMessages.MissingLiveEndpointUrlPrefix);
}

url = url.Replace("https://checkout-test.adyen.com/",
"https://" + config.LiveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/");

if (url.Contains("possdk"))
{
url = url.Replace("https://checkout-test.adyen.com/",
"https://" + config.LiveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/");
}
else
{
url = url.Replace("https://checkout-test.adyen.com/",
"https://" + config.LiveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/");
}
}


// If no prefix is required just replace "test" -> "live"
url = url.Replace("-test", "-live");
return url;
Expand Down

0 comments on commit 987f2ef

Please sign in to comment.