Replies: 2 comments
-
Yep, that's how Stripe works. Either create the Checkout Sessions ahead of time, or make each button go to Rails action that creates the checkout session and redirects to Stripe's URL for the session. I would recommend the second option. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ok. I see the flow you have with GoRails so I know what to do now. Thanks for your help. On Sep 1, 2023, at 5:20 PM, Chris Oliver ***@***.***> wrote:
Yep, that's how Stripe works. Either create the Checkout Sessions ahead of time, or make each button go to Rails action that creates the checkout session and redirects to Stripe's URL for the session. I would recommend the second option.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
scervera
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a rails app in which I have a page that shows two subscription plans: Monthly and Annual. The way I have it now is that there is a button for each plan with a link_to tag pointing to my checkouts controller like this:
<%= link_to "Subscribe", checkout_path( line_items: 'price_1NlCw**********rvujOXJt', payment_mode: 'subscription' ) %>
This then takes the customer to the show page of my checkouts controller where the checkout_button is provided by Pay. The user must then click this button (another click after they already clicked the plan they wanted) before they get to the Stripe payment form.
I would like to implement a solution that utilizes the Pay checkout_button partial directly in each of the subscription plan sections. But it appears I need to create the @checkout_session with corresponding subscription plan price_id before the customer clicks the button of the desired subscription the plan. Can you provide some guidance on how to accomplish this? It seems like a common scenario. I'm trying to eliminate unnecessary clicks to get to the payment form.
Beta Was this translation helpful? Give feedback.
All reactions