-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugs when registering with invalid card number. #116
Comments
I'm getting this same error. |
I haven't been able to reproduce this issue using the version of the app in the GitHub repo (with Ruby 2.2.0 and Rails 4.2.1). I saw this issue briefly in development when I was using an unreliable Internet connection. I assumed it was a failure to connect with Stripe. Can we identify conditions needed to reproduce this issue? |
I’m running Ruby 2.2.0 and Rails 4.2.0 I have a solid internet connection and I have tried it on a couple of different internet connections with both Chrome and Safari. I still get: "{"guid":null,"status":"pending","error":"Email can't be blank and Stripe token can't be blank”} This is my log: Started GET "/users/sign_up?plan=bronze" for ::1 at 2015-04-14 09:54:55 -0700 Started GET "/content/bronze" for ::1 at 2015-04-14 09:54:56 -0700 Started DELETE "/users/sign_out" for ::1 at 2015-04-14 09:54:59 -0700 Started GET "/" for ::1 at 2015-04-14 09:54:59 -0700 Started GET "/users/sign_up?plan=bronze" for ::1 at 2015-04-14 09:55:04 -0700 Started POST "/users" for ::1 at 2015-04-14 09:55:46 -0700 Mark
|
I have my site running on heroku too and it still gives this same error when you submit the payment on a subscription plan, as it did in development: "{"guid":null,"status":"pending","error":"Email can't be blank and Stripe token can't be blank”} Heroku logs: Mark
|
Is the error consistent or intermittent? Does it fail always or just sometimes? In development, what do you see in the Developer Tools Network tab? Are all the external scripts loading? In the Developer Tools Console are there any errors? |
The error is consistent. The credit card submission on signup has never worked. Everything in the network tab is green until I click the signup button. Then I get this in the Tools Console Network, Users Headers: Remote Address:[::1]:3000 Users Preview: error: "Email can't be blank and Stripe token can't be blank" status: "pending"Users Response: {"guid":null,"status":"pending","error":"Email can't be blank and Stripe token can't be blank"} Users Timing:
|
Clearly the error handling is inadequate for the app and we'll have to improve it. Right now I'm interested in why you're getting a failure that I can't reproduce. Can we rule out any issues with the local configuration of your Stripe public key, etc.? You could try the rails-stripe-coupons app and see if it works. @dxypher can you give us an update? Did you find the source of the error? Did you resolve the issue? |
This morning I got the "rails-stripe-membership" app to work one time randomly. Then it failed eight times in a row during various times of the day trying different things like restarting the server or my laptop, etc. I also installed a new rvm folder with new Ruby 2.2.0 and Rails 4.2 and later Rails 4.2.1 and installed the "rails-stripe-membership" app there and it failed every time again. I uploaded this new version to heroku and it failed every time there too. Next I downloaded a complete composer download of the “rails-stripe-coupons" app into the same new rvm Ruby 2.2.0 and Rails 4.2.1 setup. I tried purchasing with this app using all the same Stripe keys as my other failed apps and it worked every time during the day. I tried it six times and it worked every time. I’m an amateur in terms of troubleshooting, but I have learned a few things already from this experience so far. My hunch is that the problem has to do with the Payola-payments gem since we weren’t using that in the coupon app . Mark
|
I also asked Stripe about the error I was getting. "As for your error it looks like you are not retrieving the card token and email address properly and instead sending empty data. You'd need to make sure that you have some correct values before trying to create a customer or a charge."
|
@tmock12 suggests removing Turbolinks completely. I've merged his pull request. @mrusson please clone the current repo and try again and give us your report. |
I've removed Turbolinks, and the payments now work... but when submitting a test CC number that should be declined, Stripe sends back an appropriate error message, but the user still gets created. Even though your still on the subscription form and it appears that you haven't signed up, you can still go and sign in. |
I just cloned the app and this isn't working.
|
OK, my app is totally working now. I tried it four times in dev mode and it worked every time. Then I uploaded the solution to heroku and ran it three times and it worked every time. Here is what I did: Remove the gem 'turbolinks' line from your Gemfile. Then try it. I did not clone the new repo, I used what I had originally. In the credit card submission I used the 4242424242424242 test number. Everything confirmed and I looked in the Stripe dashboard and logs and it was all there. I’ll check everything again in the morning to make sure I wasn’t dreaming. lol
|
I'm still good on both my dev and heroku versions. So the complete removal of turbolinks solved the problem as far as I was concerned. One other observation. |
Looks like the undefined method 'cards' is a known issue with the Payola gem. |
@mrusson I also noticed that issue. We need to get the tests passing around signup, and then we can start to deal with the bugs like that one mentioned and get tests around them. I'm hoping to have some time this weekend and during RailsConf next week. |
@dxypher thanks for the note on removing turbolinks that got it going for me! |
@dxypher @mrusson @tmock12 @joesaundersak @DanielKehoe : Regarding he changes and tests now in place at PR Testsformaster #150 . I invite you to pull this branch into your working app, and take it for a spin. The four pending tests are related to this issue, Issue #116. I believe the problem I ran into is the same, in terms of not knowing how to get the stripe_token into the payola processings. Please note, the Stripe tests do not address payola's actions in any way. I leave that for others to play with. The rails-stripe-membership-saas app is priceless, this is my effort to get it tested. Any and all help is appreciated. |
I want to thank you all for this thread. It definitely helped me troubleshoot an issue I had related to this, while not @dxypher's exact problem. For me, this error was being displayed because I accidentally removed the yield(:head) from my layout template. Without this, the Payola gem's "payola/transactions/stripe_header" wasn't being included when referenced in "views/devise/registrations/new.html.erb". This is important because this include is what adds the references to the stripe v2 javascript. I was able to validate that this wasn't being loaded using the network tab of the chrome developer tools. This meant that submitting a Sign Up request would create the user, but not generate the stripe subscription and stripe token needed to register a subscription for that user. Based on the current error handling, this causes it to output the JSON error above - because the stripe token was actually NULL. If you're seeing this error, double check that the stripe JS is actually loading. Hope that helps :) |
Thanks for tips to remove turbolink and now I don't have a problem with card number but raise me an error with expiration month/year is invalid. |
So just in case anyone else finds this issue and has made the same mistake I have. The cause of the error: If the Payola javascript lib isn't loaded correctly on that page then it won't pull the data attributes from the FORM object in the HTML and send that data to Stripe, which means email, token, etc are missing. I hope this helps anyone else find their issue. 🙏🏻 |
When I try to signup for a subscription plan with a test CC number from Stripe... I get a JSON error message. It simply renders the JSON error in the browser ( the errors themselves are wrong it seems ).
The text was updated successfully, but these errors were encountered: