Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

How to add Cart Payment to Purchase Order Payment Option

$
0
0

Hi all,

please help me to get on from this. I have requirement to add Payment from cart to Purchase order. 

For this I tried as below

 var purchaseOrder = _orderRepository.Load(orderRef);

 var cartPayment = cart.GetFirstForm().Payments.FirstOrDefault();

 var POPayment = purchaseOrder.GetFirstForm().Payments.FirstOrDefault();

  1. purchaseOrder.GetFirstForm().Payments.Add(cartPayment);
  2. purchaseOrder.AddPayment((IOrderForm)purchaseOrder.GetFirstForm(), (IPayment)cartPayment);

In both case its getting exception as " Value cannot be null".  

Help me to achieve the same.

Thank You!!


Viewing all articles
Browse latest Browse all 9076

Trending Articles