You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by jonathan gilmore <jo...@hotmail.com> on 2005/08/26 06:25:16 UTC

creditCard Validator plugin problems

Hello,

No matter what I type into my creditCard field the creditCard validator 
check allways comes back with the message Card Number is not a valid credit 
card number.  If I substitute the 'creditCard' check to a 'long' check then 
I can pass validation by placing a 16 digit long number.  Come somebody 
check my code snippets below to ensure I'm not doing anything wrong..

from validation.xml...

        <!-- Charging form validation -->
        <form name="ChargingForm">
          <field property="paymentMethod" depends="required">
             <arg0 key = "charging.paymentMethod"/>
          </field>
          <field property="cardNumber" depends="required,creditCard">
             <arg0 key = "charging.cardNumber"/>
          </field>
          <field property="expirationMonth" depends="required,date">
             <arg0 key = "charging.expirationMonth"/>
             
<var><var-name>datePattern</var-name><var-value>MM</var-value></var>
          </field>
          <field property="expirationYear" depends="required,date">
             <arg0 key = "charging.expirationYear"/>
             
<var><var-name>datePattern</var-name><var-value>yy</var-value></var>
          </field>
          <field property="cardHoldersName" depends="required">
             <arg0 key = "charging.cardHoldersName"/>
          </field>
        </form>

from struts-config.xml...

        <form-bean      name="ChargingForm"
                        type="salesportal.presentation.forms.ChargingForm">
          <form-property name="paymentMethod" type="java.lang.String"/>
          <form-property name="cardNumber" type="java.lang.String"/>
          <form-property name="expirationMonth" type="java.lang.String"/>
          <form-property name="expirationYear" type="java.lang.String"/>
          <form-property name="cardHoldersName" type="java.lang.String"/>
        </form-bean>

Thanks!



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org