djangosnippets.org: Latest snippets tagged with 'credit-card'https://djangosnippets.org/tags/credit-card/2009-08-16T17:41:03-05:00Month / Year dropdown widget2009-08-16T17:41:03-05:00gregbhttps://djangosnippets.org/snippets/1688/<p>This is an adaption of </p>
<p><a href="http://code.djangoproject.com/browser/django/trunk/django/forms/extras/widgets.py#L16">django.forms.extras.widgets.SelectDateWidget</a></p>
<p>which has no day dropdown - it still produces a date but with the day set to 1.</p>
<p>Example use</p>
<pre><code>class myForm(forms.Form):
# ...
date = forms.DateField(
required=False,
widget=MonthYearWidget(years=xrange(2004,2010))
)
</code></pre>
Freely redistributableCredit Card With Newforms2008-07-23T20:56:23-05:00MasonMhttps://djangosnippets.org/snippets/907/<p>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 ...</p>
Freely redistributableCustom DateField To Handle Credit Card Exp Date. Format: MM/YY2008-06-27T16:14:03-05:00pjshttps://djangosnippets.org/snippets/830/<p>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</p>
<blockquote>
<p>YYYY-MM-DD</p>
</blockquote>
<p>Obviously the expiration date on your credit card uses the MM/YY format. I finally got around to creating a ...</p>
Freely redistributableNewforms Validation of Credit Card Numbers2008-05-19T23:01:07-05:00humphreymurrayhttps://djangosnippets.org/snippets/764/<p>Some functions and newforms fields for validating credit card numbers, and their expiry dates.
</p>
<p>In my project, I have all of the credit card functions in a file called creditcards.py
</p>
<p>Just as an overview: To validate a credit card number there are a few steps:
1. Make sure the ...</p>
Freely redistributable