Login

Tag "expiration-date"

Snippet List

Credit Card With Newforms

Alternative version of newform code for handling credit cards. Unlike the other two credit-card snippets (http://www.djangosnippets.org/snippets/764/ and http://www.djangosnippets.org/snippets/830/), this uses two drop-down boxes instead of text fields for the expiration date, which is a bit friendlier. It doesn't do as much checking as snippet #764 since we rely on the payment gateway for doing that. We only accept Mastercard, Visa, and American Express, so the validation code checks for that.

  • newforms
  • datefield
  • credit-card
  • expiration-date
Read More

Custom DateField To Handle Credit Card Exp Date. Format: MM/YY

As users would login to their accounts to update their CC info, the expiration date always threw them off. The default format for displaying a datetime.date object is >YYYY-MM-DD Obviously the expiration date on your credit card uses the MM/YY format. I finally got around to creating a custom field/widget to handle this particular piece of data. Use like so... class CustomerForm(forms.ModelForm): cc_exp = DateFieldCCEXP() class Meta: model = Customer

  • datefield
  • credit-card
  • expiration-date
Read More
Author: pjs
  • 1
  • 3

2 snippets posted so far.