All threads / How to use Stripe Checkout in Rails Discussion

Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to use Stripe Checkout in Rails Discussion

Reply

Hi Chris! Thank you for the super timely tutorial! Everything work fine and I have only one question:

How do I add a trial period to a subscription checkout request?

def show
current_user.processor = :stripe
current_user.customer
@checkout_session = current_user.payment_processor.checkout(
mode: "subscription",
line_items: "price_11111222223333344444",
-> TRIAL PARAMETER GOES HERE
)
end

Is there a way to do this somehow?
Thanks!

Reply

After webhooks have updated the Pay::Charge model, how do i check if payment was successful. Is this state saved in billable model ?

Reply

Hey Chris,
Way to go on an awesome gem. It was super easy to get it all set up!!

How do you add multiple line_items to your checkout?

It would be nice to see an example of an online shop too. 😀

Reply
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 45,185+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.