RailsApps / rails-stripe-membership-saas

An example Rails 4.2 app with Stripe and the Payola gem for a membership or subscription site.
http://railsapps.github.io/rails-stripe-membership-saas
1.14k stars 232 forks source link

Credit card accepted when email is already taken #23

Closed DanielKehoe closed 11 years ago

DanielKehoe commented 11 years ago

Stripe accepts the credit card even if the account can't be created because the email is already taken.

Can we trap this before creating the Stripe customer?

mjcloutier commented 11 years ago

When I ran through the tutorial I was adding users, testing out the subscribe function and while resetting database I noticed each time I signed up it was charging the card multiple times. That situation wouldn't be an issue in production, but if there is a problem with the expire callback it may be an issue. Can you make it check if email address is already taken in both the app database and in the stripe database? That way can be sure costumers aren't double charged. I would love to help out and fix the issue myself, I'm just not confident in my programming skills yet. I gonna look at the mailers tonight, maybe I can start small and add in a thank you and invoice mailer.

DanielKehoe commented 11 years ago

We could handle this by adding a controller action that checks the database for an existing account. We'd have to add add an Ajax function to the registrations.js.erb file that connects to the application and checks for an existing email account before making the submission to Stripe.

In my judgment, the extra effort isn't warranted as it is not likely that duplicate email addresses will be added in production. It's really only an issue that arises in testing during development.

tmock12 commented 11 years ago

Daniel is the original problem "Stripe accepts the credit card even if the account can't be created because the email is already taken." fixed now?

DanielKehoe commented 11 years ago

No, I didn't add code to address this. I closed the issue because I didn't want to tackle it. Should I leave the issue open in case someone wants to contribute code? It's strictly an enhancement.