If you load with contactid, all placed purchase orders will be return. So probably you can look into the latest one?
The common practice is to delete the cart after the PO was created, so it's impossible to get the PO from the cart id.
Commonly when do we create the purchase order?
Is it after the payment success?
Our situation the payment is happing on the Adyen payment gateway.
We didn’t create the purchaseorder on the checkout page. We created the purchaseorder after the payment
Notification comes from adyen.
If we create purchase order before redirecting to adyen gateway, then how do we update the payment reference number received from adyen to purchase order?
It will appreciate if give me the right way of implementation when to create purchase order.
I would recommend creating the purchaseorder before going to the payment gateway.
To go to the payment gateway while you still have the cart opens up for possibilities to alter the cart while the payment is being processed.
There is no problem updating a purchaseorder after it has been created, works in same way as the cart.
I am not familiar with Adyen but most payment gateways allow you to send in your own identification(order group id) and will return that together with their new payment reference number, so you can easily find you order and update the payment with their ref.
How do we update the PurchaseOrder for the same cart.
if i use the SaveAsPurchaseOrder for the same cart it creates new purchase order.
what is method to update the purchase order.
It is the new purchase order created by SaveAsPurchaseOrder that you use, once you created that one the cart is no longer interesting and can/should be deleted.
IOrderRepository.Save(purchaseOrder); //saves the updated purchase order.
How would you handle the customer changing their mind and wanting a different payment method? Such as sending them to DIBS (credit card payment gateway), they click cancel, and then want to be invoiced or something else?
I'm upgrading a 7.5 site to 11.*, and the old site doesn't create a purchase order until payment has been made, i.e. the customer is redirected to the cart checkout page if they fail/cancel DIBS payment. The added benefit to this is that the customer can change the cart before re-trying the checkout process.
In that scenario I would cancel the purchase order and restore the cart. Whenever they are on the checkout page the customer should have a cart but as soon as they start the checkout process you should create a PO.
How to retrive purchaseorder using cart id not with order groupid.
If I load the purchaseorder with contactid. which purchase order it will loaded if I have more that one inprogress purchase order.
After creating the purchase order using SaveAsPurchaseOrder, is that possible to update the purchase order.
Note:- I am new to episerver