Hello,
I'm having a wee' issue on this problem of introducing the credit card
checks.
Below is my verification class:
class ClientNewForm(formencode.Schema):
allow_extra_fields = True
filter_extra_fields = True
firstname = formencode.validators.String(not_empty=True)
lastname = formencode.validators.String(not_empty=True)
cardType = formencode.validators.String(not_empty=True)
cardNumber = formencode.validators.String(not_empty=True)
ccType=cardType
ccNumber=cardNumber
cc = formencode.validators.CreditCardValidator()
Essentially this results in three missing fields being show i.e
ccType,ccNumber and cc.
Could somebody be so kind and enlighten me on the correct syntax for
this method?
Much appreciated,
Garyc
On 1 Jan, 08:12, gazza <[email protected]> wrote:
> Much appreciated the response Mike. Happy New Year.
>
> On Dec 31 2009, 12:16 pm, Mike Orr <[email protected]> wrote:
>
>
>
> > On Thu, Dec 31, 2009 at 6:33 AM, gazza <[email protected]> wrote:
> > > Hello,
>
> > > I am trying to allow a user to enter credit card information i.e card
> > > type,card number and expiration.
> > > Are there any standard fields available to handle these common types?
>
> > > I was doing:
>
> > > ${.field("cardnumber",
> > > h.text(name="cardnumber"),
> > > required=True,
> > > )}
>
> > > I can use the below, but its kinda lame as my son would say.
>
> > > Much appreciated any assistance on this.
>
> > There are three validators for credit card types in formencode.validators:
>
> > - CreditCardValidator: checks that the card number is within the range
> > for the specified CC company, and that it passes the checksum.
> > - CreditCardExpires: checks that the expiration month & year is in the
> > future.
> > - CreditCardSecurityCode: checks that the card verification code has
> > the correct number of digits for the specified CC company.
>
> > You can add additional features to the form with Javasacript, but
> > Pylons does not recommend a particular Javascript library because they
> > change frequently and sometimes one is better and sometimes another.
>
> > --
> > Mike Orr <[email protected]>- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.