Hi,
In the PayPalStandardController the cancelorder methods loose the CurrentCustomer if you are already logged.
I test the plugin with my admin account (normally authenticated) but in case of cancel order _workContext.CurrentCustomer.Id contains a new Id of Customer.
For this reason SearchOrders does not works and I am unable to go to OrderDetails but always on HomePage.
We had the same issue in version 3.9 actaully in production in my case.
Any idea or solution?
public IActionResult CancelOrder()
{
var order = _orderService.SearchOrders(_storeContext.CurrentStore.Id,
customerId: _workContext.CurrentCustomer.Id, pageSize: 1).FirstOrDefault();
if (order != null)
return RedirectToRoute("OrderDetails", new { orderId = order.Id });
return RedirectToRoute("Homepage");
}
Thanks in advance