merchant:epaymentform:radioamount

Radio amount buttons with a textbox to type in an ammount

This will allow your customers to select from a list of predefined amounts or select other and enter an amount.

  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. Insert this code into the document head:
    1. <script>
            function getamount() 
            {
            var radioAmount = document.epayform.RadioAmount.value ; 
            var otherAmount = document.epayform.OtherAmount.value ;
       
       
            if(radioAmount =='other'){
      		  if(isNaN(otherAmount)|| otherAmount ==0){
      	     	 alert("Please enter an Amount.");
      		 	 return false
      		  }
      		  else{
      		  	var total = otherAmount;
      		  }
      	  }
      	  else{
      		  var total = radioAmount;
      	  }
            document.epayform.UMamount.value = total ;
            return true;
            }
      </script>
  3. Next find this:
    1. <tr>
       <td bgcolor="#F0F0F0" width="234" align="right"><font size="2" face="Verdana">Order Amount:</font></td>
       <td bgcolor="#F0F0F0" width="450">[UMamount]
       </td>
      </tr>
  4. Replace it with this:
    1. <tr>
            <td bgcolor="#F0F0F0" width="234" align="right"><font size="2" face="Verdana">Payment Amount:</font></td>
            <td bgcolor="#F0F0F0" width="450">
             <input type="radio" name="RadioAmount" value="10.00" checked="checked"> $10<br />
              <input type="radio" name="RadioAmount" value="40.00"> $40<br />
              <input type="radio" name="RadioAmount" value="100.00"> $100<br />
              <input type="radio" name="RadioAmount" value="other"> <input name="OtherAmount" type="text" size=10><br />                               
            </td>
            </tr>
  5. And add as many preset amounts as you need by adding more of these lines and changing the amounts:
    1. <input type="radio" name="RadioAmount" value="25.00"> $25<br />
  6. Lastly find this at the bottom of the form:
    1. <input type="submit" name="submitbutton" value="Process Payment &gt;&gt;">
  7. And Replace it with this:
    1. <input type="submit" name="submitbutton" value="Process Payment &gt;&gt;" onclick="return getamount();">
merchant/epaymentform/radioamount.txt · Last modified: 2016/09/14 14:31 by charlie

Page Tools