PayPal Canceled Orders looks like completed orders.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Debugging PayPal plugin can be challenging because the return can't find your local dev PC.  See

https://www.nopcommerce.com/boards/t/58185/paypal-standard-plugin-rediretion-problem.aspx#221350



Deactivate OrderPlaced Message Template is the easy workaround.  No code changes.  Unless you get lots of cancellations, it may not be worth the effort to change the code, but if you do, please share as feedback, so that the nopC team can consider it for next release ;)
5 years ago
@New York,

As FEEDBACK to my discussion on Order Cancellation Email conflicts, I was able to get it to work, taking the following approach to send an Order Cancellation Email to the User as well as canceling the order on the Shopping Cart, when a Client decides to cancel the order after reaching the PayPal interface and then decides not to continue with the purchase (excuse my very long sentence).  My solution involves making some changes to the CancelOrder() method within Nop.Plugin.Payments.PayPalStandard / PaymentPayPalStandardController.cs



        public IActionResult CancelOrder()
        {
            var order = _orderService.SearchOrders(storeId: _storeContext.CurrentStore.Id, customerId: _workContext.CurrentCustomer.Id).FirstOrDefault();

            if (order != null)
            {
                if (_orderProcessingService.CanCancelOrder(order))
                {
                    _orderService.UpdateOrder(order);
                    _orderProcessingService.CancelOrder(order, true);
                }
                return RedirectToRoute("OrderDetails", new { orderId = order.Id });
            }

            return RedirectToRoute("HomePage");
        }




I do agree with you on the additional steps to disable the OrderPlaced.CustomerNotification and OrderPlaced.StoreOwnerNotification messages to avoid getting these confusing notes from the app.
5 years ago
Thanks for sharing.

I don't think you need
  _orderService.UpdateOrder(order);

The other code snippets were doing that because they modified a property of the order.
5 years ago
@New York,  Thank You!  I removed the extra step from CancelOrder().
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.