Hi @hugoalves
I have done this in numerous client projects. The process doesn’t require URL parameters.
In your workflows, you have a button that is clicked to purchase. On that button click trigger (ie: when button purchase is clicked) you will need to have a conditional on the trigger itself, which is ‘when current user is logged in is yes’ and run the flow for navigating to Stripe, which from sounds of it, is already working, but just may be missing the conditional trigger to get your desired function working fully.
Then, create another trigger for when button purchase is clicked and add a conditional for ‘when current user is logged in is no’, and that trigger should show the popup for signup…now, there are considerations about what to do next, that I do not know the answers to because I do not know if your signup popup on the page is a reusable element or is a popup you created just for the page.
One way to go about it, regardless of whether the signup popup is a reusable element or a popup on the page, you can add to the popup a custom state, which is ‘payment-mode’ and is a yes/no value…no means it is regular loging/signup, but a yes value is the user is needing to login/signup for the purposes of making a payment. Then on the reusable element or page (again, not sure how your signup popup is setup), add a workflow for when the popup is closed with conditional when user is logged in is yes, and payment mode is yes…that workflow will need to navigate the user to the checkout URL of Stripe.
To make it so the popup knows what the URL of Stripe is, you’ll want to add a custom state called URL of type text…Now, we need to backtrack a bit, because on that trigger for when button purchase is clicked and the current user is logged out, where you are showing the login popup, you’ll need to set the custom of the Stripe URL, so, in that same workflow series, you’ll need to run your API call to create the checkout session, then set custom state on popup of the payment mode is yes and URL to equal the URL from the API call.
So the setup will make it so once the login popup is closed and the user is logged in and the URL custom state value is set properly and the payment mode custom state is yes, the user will be redirected to the Stripe hosted checkout session.
If, you are doing things with the Stripe checkout that require a customer object to already be present in the API call, then you’ll need to tweak things so that you can, when the popup is closed and the payment mode custom state is yes, to capture the now logged in users stripe customer ID to run the API call and navigate to Stripe checkout page in workflow for when the popup is closed.