Closed viveksp closed 10 years ago
What happens if you clone the project directly from the GitHub repo? We know the version in the repo works if you set it up with valid Stripe keys.
That works perfectly well. Thanks a bunch. But I would be interested to know why the generate failed.
Use a file compare tool to look for differences between your version and the "known good" version from the repo.
I'm having the same issue, did you find out what was causing the error?
Same issue here. I notice in registrations.js
, that it is linking to https://js.stripe.com/v1/
; while Stripe's documentation says to use /v2
; has anything changed on their end? I cloned the repo and set things up from there; had a successful db:create, migrate, and seed. Application.yml variables are set right with the keys. But my error message shows a blank value for the "stripe_token"=>""
when signing up a non-example user (with Stripe in test mode, trying to test subscriptions)
I also did a comprehensive comparison of the cloned repo vs the generated one (from command line, the rails new rails-stripe-membership-saas -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb -T
choosing sass/stripe site), and there were very few differences, mainly a couple of extra files for Teaspoon testing… So It's a bit confusing as to why the token isn't loading when it seems to be right there. Also, all rspec tests passed, fwiw
Upon closer inspection, in new.html.erb
there is the following code block (in both cloned and generated):
<% content_for :head do %> <%= tag :meta, :name => "stripe-key", :content => STRIPE_PUBLIC_KEY %> <% end %>
However, when viewing the page source, the meta tag is not generated in the final html. Wondering if this is a recent Rails version issue, but looking further. Definitely seems to be part of the problem, as I can pull the STRIPE_PUBLIC_KEY as present in the console/debugger.
Javascript error confirms this:
Error: You did not set a valid publishable key. Call Stripe.setPublishableKey() with your publishable key. For more info, see…
---- EDIT
Adding the following line under the existing META tag(s) in application.html.erb
header made the key available in meta tag, and thus passed on to registration.js's code; and fixed the issue:
<%= yield :head %>
Hi,
Few disclaimers - I have gone through all the issues discussed for "Stripe token not present". None of them were helpful in my case I am newbie in rails.
I followed the step by step instructions for setup.
When I run this app in local host and try to add an new user, I get "stripe token not present" error. When i looked at the logs, the variable is null.
This is for any other email except example.com. If i use somename@example.com, It works fine(it wont hit stipe. Just create a user in database)
I have used tools to check on the client side and ensure that registrations.js is loading. I dont see that js.stripe.com is being called from logs.
Please note. I have not made any changes to the code anywhere. I have just followed the instructions.
What am i missing here.
Please help