pinax / pinax-stripe-light

a payments Django app for Stripe
MIT License
684 stars 284 forks source link

django.db.utils.IntegrityError: null value in column "cvc_check" violates not-null constraint when running ./manage.py sync_customers #240

Closed gumaerc closed 8 years ago

gumaerc commented 8 years ago

Hey there,

I'm working on a new website for my company using django with django-cms, oscar (e-commerce) and was thinking of adding this project to support Stripe payments. I was doing a test today after installing and configuring pinax-stripe in which I created a customer in the pinax_stripe_customer table with information matching my test user and a test customer in the stripe test database. For some reason, one of the sources on this test customer is coming back with the cvc_check field having a null value. I don't think there's anything particularly strange about the test cards I added, as I used the ones from the Stripe test documentation. The error went away after removing the null constraint on the cvc_check column, but this obviously isn't optimal. I wonder if this is expected behavior from Stripe in certain scenarios or if it is a bug on their end.

paltman commented 8 years ago

@gumaerc i think you were right on the nose. cvc_check is not always provided and can be null in the API. I'm going to update the CharField to be blank=True and the code to coalesce None to "".