Try our conversational search powered by Generative AI!

Missing payment information in SerializableCart

Found in

EPiServer.Commerce 11.0.0

Fixed in

EPiServer.Commerce 11.4.1

(Or a related package)

Created

Oct 04, 2017

Updated

Oct 19, 2018

Area

Core

State

Closed, Fixed and tested


Description

When adding a payment to a SerializableCart, after saving and loading, the payment will be SerializablePayment, and all properties are lost.

var payment = orderGroup.CreateCardPayment(_orderGroupFactory);
 
payment.CardType = CardType;
payment.PaymentMethodId = PaymentMethodId;
payment.PaymentMethodName = SystemKeyword;
payment.Amount = amount;
payment.CreditCardNumber = CreditCardNumber;
payment.CreditCardSecurityCode = CreditCardSecurityCode;
payment.ExpirationMonth = ExpirationMonth;
payment.ExpirationYear = ExpirationYear;
payment.Status = PaymentStatus.Pending.ToString();
payment.CustomerName = CreditCardName;
payment.TransactionType = TransactionType.Sale.ToString();
cart.AddPayment(payment, _orderGroupFactory);
 
_orderRepository.Save(cart);

Reported from: http://world.episerver.com/forum/developer-forum/Episerver-Commerce/Thread-Container/2017/10/how-to-make-serializable-carts-to-work-with-icreditcardpayment-authorize.net/