Can't mark orders as paid nopcommerce 3.70

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hi,
May you help me please. I want to mark orders as paid in my own plugin payment but I got this error

You can't mark this order as paid
Description: An unhandled exception occurred during the execution of the current web request


This is a part of my code
if (_orderProcessingService.CanMarkOrderAsPaid(order))
                {
                    order.PaymentStatus = PaymentStatus.Paid;
                    _orderService.UpdateOrder(order);

                    _orderProcessingService.MarkOrderAsPaid(order);
                }


I used the same code with nop 3.60 and worked well.

Need your helps
Thanks
7 years ago
If your "order" is not null then there is no reason not to execute the code.
7 years ago
The "order" is not null because the payment status is marked as "Paid" but when It comes to mark as paid, I receive an exception.
I don't understand the problem. The same code works in nop 3.60
7 years ago
Please try

if (_orderProcessingService.CanMarkOrderAsPaid(order))
            {
                _orderProcessingService.MarkOrderAsPaid(order);
                _orderService.UpdateOrder(order);

            }


And the order will show as admin panel as

7 years ago
Thanks Sina.Islam. Problem solved
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.