Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @frederik5480
* @dynamicweb/commerce-codeowners
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>10.1.1</VersionPrefix>
<VersionPrefix>10.1.2</VersionPrefix>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Title>QuickPay Payment Window</Title>
<Description>The QuickPay Payment Window checkout handler is designed to work with QuickPay v10.</Description>
Expand Down
16 changes: 11 additions & 5 deletions src/QuickPayPaymentWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
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()
Expand Down Expand Up @@ -378,7 +378,7 @@
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" };
}
}

Expand Down Expand Up @@ -566,15 +566,21 @@
{
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.
Expand Down Expand Up @@ -777,7 +783,7 @@
* To make it work (temporarily), we use Response.Redirect here
*/
if (PassToCart(order) is RedirectOutputResult redirectResult)
Context.Current.Response.Redirect(redirectResult.RedirectUrl, redirectResult.IsPermanent);

Check warning on line 786 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'IResponse.Redirect(string, bool)' is obsolete: 'Do not use'

Check warning on line 786 in src/QuickPayPaymentWindow.cs

View workflow job for this annotation

GitHub Actions / call-workflow / Build

'IResponse.Redirect(string, bool)' is obsolete: 'Do not use'

return string.Empty;
}
Expand Down