try to mark order as paid from code behind - but not working ?

Friday, April 26, 2024 7:26:03 AM
  • Posted: Tuesday, February 19, 2019 8:44 AM
  • 44
Hi

please i have try to mark order as paid from code behind after user return from payment gateway i have add this part to my code (same code in admin)

 _orderProcessingService.MarkOrderAsPaid(order);


but nothing happen - i can set order only as paid throw admin

so please how can i make it works - i don't get any error ??!!  
0
  • Posted: Tuesday, February 19, 2019 4:22 PM
  • 44
note: it works local fine - problem online only on the same database with the same configurations ?

i try to update 2 fields only

OrderStatusId and PaymentStatusId they don't updated too

                // update order
                // save payment data
                var order = _orderService.GetOrderByNumber(Convert.ToInt32(model.OrderId));
                order.CardType = paymentType; // Saved
                order.AuthorizationTransactionCode = model.hash; // Saved
                order.AuthorizationTransactionResult = model.payid; // Saved and its CAPTURED as i set if condition
                order.CaptureTransactionId = model.PaymetRef; // Saved
                order.CaptureTransactionResult = model.result.ToUpper(); // Saved


                // set paid if done
                if (model.result == "CAPTURED")
                {
                    order.PaymentStatusId = Convert.ToInt32(PaymentStatus.Paid); // not saved
                    order.OrderStatusId = Convert.ToInt32(OrderStatus.Processing); // not saved

                    // To Do Mail
                }

                _orderService.UpdateOrder(order);


so please what is the problem ?
0
  • Posted: Tuesday, February 19, 2019 5:25 PM
  • 44
Thanks Solved
0
back to top
Filters