November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Cart and order are separate and you are right, cart id is not order id. There is no way to retain the order, except if you convert to the order before sending the information to the payment gateway
another way is to generate an unique id (guid perhaps?) and use that as the "order number", which you will set to your order once it's created.
Hi Nikhil,
When you convert a cart to a Purchase Order, the purchase order entity is a new row in the database so the OrderGroupId will not be maintained.
Consider the following approach:
public string GenerateOrderNumber(IOrderGroup orderGroup)
{
var orderGroupId = orderGroup.OrderLink.OrderGroupId;
var orderTrackingNumber = _purchaseOrderTrackingReferenceRepository.GetByOrderGroupId(orderGroupId);
return FormatOrderTrackingNumber(orderTrackingNumber);
}
var orderNumber = _purchaseOrderTrackingReferenceRepository.CreateOrderNumberByOrderGroupId(form.OrderGroupId)
// Load current order number
string orderNumber = _webOrderNumberProvider.GenerateOrderNumber(cart);
// Set order / tracking number
((PurchaseOrder)purchaseOrder).TrackingNumber = orderNumber;
There are different ways of meeting this requirement. The best way would depend on your website implementation. I hope this example helps.
Thanks
We had the similar requirement for our payment provider using Chase Paymentech. We used OrderGroup.OrderLink.OrderGroupId during authorization and saved it into payment.TransactionId after the successful authorization. During capture we retrieved the transactionId and used that to interact with payment provider. Every time you are going to refer back to the exact transaction, you can use that payment.TransactionId to interact with the payment provider, be it Capture, Credit or Void transaction.
cardPayment.TransactionID = string.Format("{0}", OrderGroup.OrderLink.OrderGroupId);
To retrieve
string orderId = payment.TransactionID;
~ Sujit
Hi team,
We find that the orderId obtained from the cart differs from the orderId when the cart is saved as purchase order.
We have obtained the OrderId from cart as follows :
OrderGroupId = cart.OrderLink.OrderGroupId.
We need to send the order id to the credit card transaction before the cart is converted into purchase order.
Now we find the orderId of purchase order and orderId from cart to be differnt.
Can you please let us know what we are missing or is there any other way to obtain the OrderId before it is converted into purchase order.
Thanks in advance,
Nikhil