Hi, i have been struggling with getting the DNN Store (02.01.17) to increase the cart number/order id after i have finnished talking to my payment service. However, DNN Store reuses the same order id when i make a new order, why? What i found documentation about and what i thought i need to do is the following:
- Implement the code needed to talk to my payment service
- Once i have done whatever i needed to do, just call "invokePaymentSucceeded();" and DNN Store will update all its internal data and everyone will be happy... but it doesnt.
The following is the code that follows after i have received a "OK" from the payment service:
//Adds the order to the db... why should i need to do this in the payment provider code??
OrderInfo orderInfo = CheckoutControl.GetFinalizedOrderInfo();
// Update the order status to Paid
OrderController orderController = new OrderController();
orderController.UpdateOrder(orderInfo.OrderID, orderInfo.OrderDate, orderInfo.OrderNumber, orderInfo.ShippingAddressID, orderInfo.BillingAddressID, orderInfo.Tax, orderInfo.ShippingCost, true, (int)OrderInfo.OrderStatusList.Paid, orderInfo.CustomerID);
// Clear the cart, why doesnt the store do this?
CurrentCart.ClearItems(PortalId);
// Found documentation that this was the only thing left to do...
invokePaymentSucceeded();
// Hide the graphics controls
CheckoutControl.Hide();
PanelSoEasyPayPayment.Visible = false;
Please, what am i doing wrong and is there some documentation or source code regarding what i need to do? Right now i am fumbling in the dark because i cant find any real source code to a real and working payment gateway provider implementation.
UPDATE:
In order for the Order ID to increase, you have to "Delete" the current cart.
Replace
CurrentCart.ClearItems(PortalId);
with
CurrentCart.DeleteCart(PortalId);