diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3a29f75..567a432 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @frederik5480 +* @dynamicweb/commerce-codeowners diff --git a/src/Dynamicweb.Ecommerce.CheckoutHandlers.QuickPayPaymentWindow.csproj b/src/Dynamicweb.Ecommerce.CheckoutHandlers.QuickPayPaymentWindow.csproj index d34b946..db1aa4f 100644 --- a/src/Dynamicweb.Ecommerce.CheckoutHandlers.QuickPayPaymentWindow.csproj +++ b/src/Dynamicweb.Ecommerce.CheckoutHandlers.QuickPayPaymentWindow.csproj @@ -1,6 +1,6 @@  - 10.1.1 + 10.1.2 1.0.0.0 QuickPay Payment Window The QuickPay Payment Window checkout handler is designed to work with QuickPay v10. diff --git a/src/QuickPayPaymentWindow.cs b/src/QuickPayPaymentWindow.cs index 720db15..d84e335 100644 --- a/src/QuickPayPaymentWindow.cs +++ b/src/QuickPayPaymentWindow.cs @@ -321,7 +321,7 @@ public override OutputResult BeginCheckout(Order order, CheckoutParameters param catch (Exception ex) { LogError(order, ex, "Unhandled exception with message: {0}", ex.Message); - return PrintErrorTemplate(order, ex.Message); + return new ContentOutputResult() { Content = "An error occurred in the callback. Check event log for error details" }; } QuickpayTemplateHelper GetTemplateHelper() => new() @@ -378,7 +378,7 @@ public override OutputResult HandleRequest(Order order) catch (Exception ex) { LogError(order, ex, "Unhandled exception with message: {0}", ex.Message); - return PrintErrorTemplate(order, ex.Message); + return new ContentOutputResult() { Content = "An error occurred in the callback. Check event log for error details" }; } } @@ -566,15 +566,21 @@ private void Callback(Order order) { lock (lockObject) { + if (Context.Current.Request.InputStream.Length == 0) + { + LogEvent(order, "Invalid callback - no InputStream or not a POST"); + return; + } + LogEvent(order, "Callback started"); - string callbackResponce; + string callbackResponse; using (StreamReader reader = new StreamReader(Context.Current.Request.InputStream, Encoding.UTF8)) { - callbackResponce = reader.ReadToEndAsync().GetAwaiter().GetResult(); + callbackResponse = reader.ReadToEndAsync().GetAwaiter().GetResult(); } - CheckedData checkedData = CheckData(order, callbackResponce ?? string.Empty, order.Price.PricePIP); + CheckedData checkedData = CheckData(order, callbackResponse ?? string.Empty, order.Price.PricePIP); string resultInfo = checkedData.Result switch { //ViaBill autocapture starts callback.