Skip to content

Commit ad0159d

Browse files
committed
Fixes redirecting within checkout may have displayed an incorrect URL in the browser
1 parent 4dd880f commit ad0159d

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

changelog.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Release Notes
1+
# Release Notes
22

33
## SmartStore.NET 3.2
44

@@ -34,7 +34,8 @@
3434
* #1447 Checkout button payment methods (Amazon, PayPal Express) won't work in conjunction with mandatory checkout attributes
3535
* When creating a topic, the widget zone input shows System.String[]
3636
* Switching the language always redirected to the home page if SEO friendly URLs was deactivated.
37-
* Fixes file upload of a checkout attribute was not stored on cart page.
37+
* File upload of a checkout attribute was not stored on cart page.
38+
* Redirecting within checkout may have displayed an incorrect URL in the browser.
3839

3940

4041
## SmartStore.NET 3.1.5

src/Plugins/SmartStore.AmazonPay/Services/AmazonPayService.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,9 @@ public PreProcessPaymentResult PreProcessPayment(ProcessPaymentRequest request)
988988
{
989989
// Must be redirected to checkout payment page.
990990
_httpContext.Session["AmazonPayFailedPaymentReason"] = id;
991-
_httpContext.Response.RedirectToRoute(new { Controller = "Checkout", Action = "PaymentMethod", Area = "" });
991+
992+
var urlHelper = new UrlHelper(_httpContext.Request.RequestContext);
993+
_httpContext.Response.Redirect(urlHelper.Action("PaymentMethod", "Checkout", new { area = "" }));
992994
}
993995
}
994996
}
@@ -1125,7 +1127,9 @@ public ProcessPaymentResult ProcessPayment(ProcessPaymentRequest request)
11251127
{
11261128
// Must be redirected to checkout payment page.
11271129
_httpContext.Session["AmazonPayFailedPaymentReason"] = reason;
1128-
_httpContext.Response.RedirectToRoute(new { Controller = "Checkout", Action = "PaymentMethod", Area = "" });
1130+
1131+
var urlHelper = new UrlHelper(_httpContext.Request.RequestContext);
1132+
_httpContext.Response.Redirect(urlHelper.Action("PaymentMethod", "Checkout", new { area = "" }));
11291133
}
11301134
}
11311135
}

src/Plugins/SmartStore.PayPal/Providers/PayPalRestApiProviderBase.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Web;
4+
using System.Web.Mvc;
45
using System.Web.Routing;
56
using SmartStore.Core.Configuration;
67
using SmartStore.Core.Domain.Orders;
@@ -102,7 +103,8 @@ public override ProcessPaymentResult ProcessPayment(ProcessPaymentRequest proces
102103
result.AddError(T("Plugins.SmartStore.PayPal.SessionExpired"));
103104

104105
// Redirect to payment wall and create new payment (we need the payment id).
105-
HttpContext.Response.RedirectToRoute(new { Controller = "Checkout", Action = "PaymentMethod", Area = "" });
106+
var urlHelper = new UrlHelper(HttpContext.Request.RequestContext);
107+
HttpContext.Response.Redirect(urlHelper.Action("PaymentMethod", "Checkout", new { area = "" }));
106108

107109
return result;
108110
}

0 commit comments

Comments
 (0)