[Answered ]-Stripe – 'exp_month' parameter should be an integer (instead, is 02 ) in Django View

2👍

'02' is a string so it needs to be converted to an int before getting passed to stripe. You might just need to do:

        exp_month = int(request.POST.get('exp_month', ''))
        exp_year = int(request.POST.get('exp_year', ''))

0👍

You should be accessing the data via the form.cleaned_data dict rather than directly from the POST. Among other things, the form takes care of converting into the right data type.

Leave a comment