This is an old revision of the document!

Copying billing names into cardholder

This code will allow you to populate the cardholder name with the billing first and last name.

  1. Log into your USAePay merchant gateway. Go to “Settings”, then “Source Keys”. Select the source key you are using and click “Edit”. Click “Edit Customization to Epay Form”.
  2. Add the follwing inbetween <head> and </head>:
    1. <script>
      function copyNameToCardholder()
      var form = document.epayform;
      	var first = form.UMbillfname.value;
      	 var space = " ";
       var last = form.UMbilllname.value;
       var cardfirst = first.concat(space);
       var cardholder = cardfirst.concat(last);
       form.UMname.value= cardholder;
  3. Next add onChange to the first and last name inputs:
    1. <tr>
       <td bgcolor="#F0F0F0" width="234" align="right"><font face="Verdana" size="2">First Name:</font></td>
       <td bgcolor="#F0F0F0" width="450">
       <input type="text" name="UMbillfname" size="20" value="[UMbillfname]"></td>
       <td bgcolor="#F0F0F0" width="234" align="right"><font face="Verdana" size="2">Last Name:</font></td>
       <td bgcolor="#F0F0F0" width="450">
       <input type="text" name="UMbilllname" size="27" value="[UMbilllname]"></td>


  1. <tr>
     <td bgcolor="#F0F0F0" width="234" align="right"><font face="Verdana" size="2">First Name:
     </font></td><td bgcolor="#F0F0F0" width="450">
     <input type="text" name="UMbillfname" size="25" value="" onChange="copyNameToCardholder()"></td>
     <td bgcolor="#F0F0F0" width="234" align="right"><font face="Verdana" size="2">Last Name:
     </font></td><td bgcolor="#F0F0F0" width="450">
     <input type="text" name="UMbilllname" size="25" value="" onChange="copyNameToCardholder()"></td>

- Remove the cardholder textbox:

 <code html>

<tr> <td bgcolor=“#F0F0F0” width=“234” align=“right”><font face=“Verdana” size=“2”>Name as on Card:</font></td> <td bgcolor=“#F0F0F0” width=“450”> <input type=“text” name=“UMname” size=“25” value=“[UMname]”></td> </tr> </code>

- Lastly add UMname to the hidden input section by finding this:

<input type="hidden" name="UMcommand" value="[UMcommand]">
<input type="hidden" name="UMamount" value="[UMamount]">
<input type="hidden" name="UMtax" value="[UMtax]">
<input type="hidden" name="UMinvoice" value="[UMinvoice]">
<input type="hidden" name="UMcustid" value="[UMcustid]">
<input type="hidden" name="UMrecurring" value="[UMrecurring]">

- And adding a this line:

<input type="hidden" name="UMname" value="">
merchant/epaymentform/copybillingnames.1473724638.txt.gz · Last modified: 2016/09/12 16:57 by charlie

Page Tools