You’re not receiving notifications from this thread.
Subscriptions with Stripe Discussion
Hey Chris! Not sure if this is just me, but there seems a problem downloading the video's.
Thanks! I actually wanted a course to be released of Stripe Payment Processing since I just lost my OM account. This definitely helps me out!
I have 4 months left on GoRails and I'm excited to learn as much as possible on Stripe payment processing. I'm starting this video today and I'm really happy that you introduced this course OneMonth!
Is it possible to put the normal stripe js popup instead of a custom form????
If so, please make another screencast on that
You can swap a lot of the JS out with the Stripe Checkout button. The same process works there. You'd keep the token callback and server-side code. It's pretty much the same minus the form and the JS listener for submit. :)
The checkout.js popup is nice, but if you wish to use a coupon code, the custom form is required I believe. Maybe Chris knows a way to get around it.
So i have been following along with this screencast and i got it all to work :) I even added a select box so could choose what plan i wanted to use. However i would like to have multiple boxes each for a certain plan. What would you recommend.. checkboxes in the form of buttons.. or something else? I don't think a dropdown select box is very selling.. I would like to have 3 or 4 boxes next to each other with different length of the subscription like 1 months and 3 months and so on..
My suggestion would be to make a pricing page that have links to the checkout page and you put a "plan" in the URL with the ID of the plan to sign them up with. That way you can store the plan_id in a hidden field in the form nicely.
Oh damn, learning a lot from here. Like the devise's user_return_to method. Damn nifty!
How would I need to modify the SubscriptionsController to allow for multiple Plans (monthly, every 3 months, yearly, etc.). Let's suppose I have a Plans model and table where I store the info about my plans. Your current subscriptions controller hard codes in the plan: "monthly" input. How would that change?
Great question and I meant to make a follow up episode talking about that. I will still do that, but here's the gist:
1. You'll need a pricing page that lists the plans. When you click on the link to subscribe, you'll pass the plan ID in the URL to the checkout page.
2. The checkout page will load up the plan based on the ID to verify it exists and is allowed (makes it easy for changing things over time).
3. You'll pass the plan ID as a hidden field during checkout
4. SubscriptionsController's create action will lookup the plan again to verify it and then submits the stripe ID instead of the hardcoded "monthly" value
5. After signing up, you'll link the user to the plan as well so you can use it for your authorization and functionality of your site that they paid for access to.
That should do the trick! I'll try and record a screencast on this very soon as a follow up.
I'm getting this error. I looked around online but still hitting a wall. Thoughts? Thanks :)
Are you sure that params[:stripeToken] is set to the value from the JS? Check your params?
I'm also facing this issue, apparently it seems when we come to 'checkout' page from any other page (e.g. pricing) the JS in checkout is not loaded correctly due to which the token is not being created. If you refresh the checkout page and then submit the form it should work fine. Probably the turbolink issue.
Love this episode Chris...thanks!
One question, why did you put the `current_user_subscribed` method in the ApplicationController and not in say ApplicationHelper? That feels like something that the views will use, which is what the helpers are for, no?
Just curious to hear the logic.
Oh good question. Subtle thing here, but very important. The reason it's in the controller is because you're probably going to use the same logic to do authorization in the controller actions. You can easily expose the method as a helper using helper_method for the views, so this allows you to write it in one place and use it in both the controller and the views.
Chris, my subscription.coffee file is never getting called. Therefore, I'm getting the following error even when I comment out the #$form.get(0)submit() as you instruct around 24:31 in the video. Is this due to turbo-links? Any help on this would be much appreciated.
anybody get this error: "Uncaught SecurityError: Blocked a frame with origin "https://js.stripe.com" from accessing a frame with origin "http://localhost:3000". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match." I'm stumped.
Hi guys - i'm receiving a curios intermittent error.
When I go to /subscription/new I get the following screen:-
Please note the error, "Could not find payment information".
I'm not submitting the form, but the error is appended.
I then complete the form and select submit and get the following error:-
I suppose this is to be anticipated.
I then check my stripe test account and I have an error here:-
Any root cause analysis would be really appreciated.
Nice tutorial. Using this payment form, if form is submitted multiple times, multiple subscriptions occur for a single customer. Will stripe charge customer for all such subscriptions or only based on last one?
I am using Stripe in development just fine, but when I push up to production on AWS, the logs are telling me "Stripe::AuthenticationError (No API key provided. Set your API key using "Stripe.api_key = <api-key>". " I am using "Stripe.api_key = ENV['STRIPE_SECRET']" which is pulling from the .env file, which is of course in my .gitignore file. So it's not pushing up to AWS as intended. How do I get Stipe production ready, as least in terms of the api key? I am using "ENV['STRIPE_PUBLIC']" in the meta tag just like the video. I'm not getting an AWS error here, which confuses me as it getting the key from .env as well. Any help would be appreciated!
Hope everyone is ok.
I have question about my rails app.
I get this error in heroku
Stripe::AuthenticationError (No API key provided. Set your API key using "Stripe.api_key = <api-key>". You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email firstname.lastname@example.org if you have any questions.):
yet all is ok in localhost which I use c9.io account.
Does anyone has any idea what is going on?
if more info is needed, I gladly provid
Hope all is fine.
I recieve this error
ExecJS::RuntimeError in Listings#index
I did the following
1. ExecJS::RuntimeError in Listings#indexs did not work
2. install gmes, exechs and therubyracer did not work.
3. try to find runtimes.rb and could not
4. I get rid of //= require_tree . error goes away but after awhile it comes back
Could anyone help me to fix it?
I am learning so much from this Episode! One thing, after putting my secret/public keys in my environments/development.rb as recommended at 29:34ish, I get an uninitialized constant ActionView::CompiledTemplates::STRIPE_PUBLIC error trying to access the subscriptions#new page. Is this a common problem? It seems like I must be doing something simple wrong...
https://uploads.disquscdn.c... Just so everyone is aware.. The card details that Stripe returns in the form around 47:22 have been changed by stripe they are now:
Ive added a photo with the updated values incase anyone hits a snag retrieving data.
Happy Floundering :)