Page 1 of 1

automatically fill name on card field

Posted: Fri Oct 03, 2008 1:31 pm
by meer2005
In the admin when you add an additional payment, it automatically fills the field with the bill to name.

CardName.Text = _Order.BillToFirstName + " " + _Order.BillToLastName;

Does anyone know the call out name of the 'name on card' field so it will automatically fill the name the customer actually entered previously for the name on card field. They bill to name and name on card do not always match.

Re: automatically fill name on card field

Posted: Fri Oct 03, 2008 2:47 pm
by jmestep
I couldn't find that it is stored anywhere, so it wouldn't be available later.

Re: automatically fill name on card field

Posted: Mon Oct 06, 2008 6:28 am
by mazhar
Edit theWebsite\Admin\Orders\Payments\ucProcessPayment.ascx file and locate the following line in it

Code: Select all

CardName.Text = _Order.BillToFirstName + " " + _Order.BillToLastName;
and make it look like as below

Code: Select all

if (_Order.Payments.Count > 0)
        {
            AccountDataDictionary aacountDataDic = new AccountDataDictionary(_Order.Payments[0].AccountData);
            CardName.Text = aacountDataDic["AccountName"];
        }
        else    
            CardName.Text = _Order.BillToFirstName + " " + _Order.BillToLastName;