Hello,

I have been reading various posts in the forum and someone suggested editing the OrderController.cs file.

We are using manual card payments as the customer only charges for the order once the order has been packed and weighed and the customer has been informed of the shipping cost.

I can see the "public ActionResult MarkOrderAsPaid(int id)" section and was wondering if we can modify that to change the credit card information once the "Mark as Paid" button is pressed.

I saw the "public ActionResult EditCreditCardInfo(int id, OrderModel model)" section has the code to pull the information from the order form and save the new credit card information.

What I did do was copy that code and put a modified version of it in the MarkOrderAsPaid ActionResult.

                string tmp_cardType = model.CardType;
                string tmp_cardName = string.Empty;
                string tmp_cardNumber = model.CardNumber;
                string tmp_cardCvv2 = string.Empty;
                string tmp_cardExpirationMonth = string.Empty;
                string tmp_cardExpirationYear = string.Empty;

                order.CardType = _encryptionService.EncryptText(tmp_cardType);
                order.CardName = tmp_cardName;
                order.CardNumber = _encryptionService.EncryptText(_paymentService.GetMaskedCreditCardNumber(tmp_cardNumber));
                order.CardCvv2 = tmp_cardCvv2;
                order.CardExpirationMonth = tmp_cardExpirationMonth;
                order.CardExpirationYear = tmp_cardExpirationYear;
                _orderService.UpdateOrder(order);


However when I rebuilt the file and uploaded and reset with a test order the card details are all blank after the button is pressed.

Can someone give me a pointer in the right direction as the end result I would like is to only show the card type and the card number as follows **** **** **** 1212

Thanks,

Andy