From 987f2ef50db0d3033f4cd8e80ac94061b93046e5 Mon Sep 17 00:00:00 2001 From: jilling Date: Mon, 30 Sep 2024 09:28:40 +0200 Subject: [PATCH] remove extra backslash for possdk --- Adyen/Service/AbstractService.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Adyen/Service/AbstractService.cs b/Adyen/Service/AbstractService.cs index 9649493a..517317c1 100644 --- a/Adyen/Service/AbstractService.cs +++ b/Adyen/Service/AbstractService.cs @@ -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); @@ -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;