How to block member creation until Stripe payment confirmation is received? Answered
Hi,
Is there a way to prevent a user from becoming a member until they've completed the payment step in Stripe? In testing, I noticed if I click the back arrow in Stripe without payment, then I'm still added as a member.
I would prefer that users return to the guest/logged out view in that scenario.
Comments
6 comments
Hi Jeff,
Memberstack is actually designed to create a member first, before Stripe checkout.
However, you can add a "Complete Checkout" button to your site to prompt the user to checkout. Details on how to set it up are covered in this article Return to Checkout UI.
Ok thanks Chukwudi. I saw that article but didn't know if there was an alternate workaround.
You may also want to use custom script on the page after login, to redirect users who aren't on any plan to a the pricing page. Here's a script which should work for you.
<script> document.addEventListener("DOMContentLoaded", async function () { window.$memberstackDom.getCurrentMember().then((member) => { if (member.data) { const planConnections = member.data["planConnections"]; if (planConnections.length < 1) { window.location.href = "https://example.com/pricing"; } } }); }); </script>Thank you Chukwudi Currently, I have the homepage set up as the default redirect. I also have individual welcome pages set up for each specific plans. I added those redirects to each plan.
I was wondering if I could just switch the default redirect to the Pricing page?
Yes, you can switch the default redirect to the Pricing page.
Perfect. Thanks for your help!
Please sign in to leave a comment.