Skip to content
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

Quick start guide missing info on how to initiate and charge payments #171

Open
brentpicasso opened this issue Oct 30, 2019 · 5 comments
Open

Comments

@brentpicasso
Copy link

Hi - this is a great gem, thanks for creating it and maintaining it!

First time user of Stripe, and it looks like the quick start is missing some steps right in the middle on how to initiate and complete a charge, such as for a subscription.
https://stripe.com/docs/billing/subscriptions/payment

Looks like we have:

  • Creating creating products / plans
  • Including the stripe elements JS for collecting CC info
  • ??? (this part is missing - selecting the product / plan and doing the charge)
  • Handling callbacks from Stripe

Questions:

  • Is there an end-end example available that uses stripe-rails?
  • Do we use the standard stripe gem to complete the missing steps?

Thank you again!

@brentpicasso
Copy link
Author

It looks like this gem also includes the regular stripe gem, and provides the necessary keys to it for authentication. If I get things figured out, I will update the README to fill out the ??? section.

Cheers,
-Brent

@vfonic
Copy link
Contributor

vfonic commented Nov 6, 2019

👍

I'd also add that I haven't heard of Stripe products before and it was confusing for me to see that there are Stripe plans and Stripe products. It would be great if README pointed to Stripe documentation, as I had trouble finding it there as well.

@tansengming
Copy link
Owner

Thanks for the feedback folks! I understand your frustration but I am a little hesitant about adding the missing parts (about selecting the product / plan and doing the charge) to the readme. The readme in my view is a guide to using the gem, not a guide to integrating Stripe to Rails. The Stripe docs are a really good place for that https://stripe.com/docs/

This gem is best thought of as a bunch of helpers to make it easier to work with Stripe on Rails not necessarily a guide for how to integrate Stripe on Rails.

Having said that, I have noticed the gap you mentioned and have tried to fill it with another gem at https://github.com/tansengming/stripe-subscribe/ . This other gem is more of a full fledged rails engine (with controllers, views etc) that can be integrated onto an existing rails app to make it easier get started with recurring payments on Rails. @brentpicasso if you follow the controllers on that gem it'll give you a better picture of how to integrate the Stripe API and plans on your app. Basically you need a token that is returned from the Stripe form and the name of the plan to create your first charge.

@vfonic I've found the official documentation a great place to understand the relationship between plans and products. This is a relatively new concept in Stripe (they used to only have plans) that makes it a little more flexible but also more confusing.

I do think it's a good idea to point folks to Stripe documents on the readme to help other folks so please keep the PRs coming if you have any good ideas on how to do that.

@Tectract
Copy link

Hi there. I'm working with this gem and I'm attempting to figure out how to set up a "plan" with a recurring payment, for my customers.

I don't really want to hack another bigger gem that comes with views and controllers and everything, I would just like an explanation of what I need to do to attach a plan with a recurring charge to a customer. I have tested the webhooks, they seem working ok for me.

So, do I need to create a "customer" and then add the "plan" to an "invoice", and then charge for the invoice? It seems Stripe has updated everything to use a formal subscriptions object instead of the "plan" object so is this gem deprecated because of that? Can I still manage subscriptions for my customers using "plans"?

I have gone over and over the official stripe documentation but I still don't understand how a "plan" created using this gem would get added to a customer, and then managed / cancelled on demand by a site admin or user. Can you PLEASE help fill in the blanks a bit here? I really really really need this working as soon as possible, I'm stuck on it.

@Tectract
Copy link

From here:

https://stripe.com/docs/billing/prices-guide

It seems that in order to create a subscription for a customer, I need to create a plan, and then add it to an invoice, attached to a stripe customer ID. So I can't just use the Stripe::Charge.create() function example given in the readme. I need to do things like create customers with a default payment method, create invoices, and then charge an invoice which may include both subscription and non-subscription items. None of this is covered in the readme, so I'm having to work it all out myself here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants