#koziejoff-unpaid-sub

1 messages ยท Page 1 of 1 (latest)

graceful badge
#

Hello ๐Ÿ‘‹
Give me a moment to catch up and I'll respond as soon as I can ๐Ÿ™‚ Thanks

graceful badge
#

Why is your code creating a new Subscription on page load? Shouldn't you trigger this when customer submits a form or clicks on a button or something?

hot agate
#

Actually, I've followed with this tutorial - https://www.youtube.com/watch?v=5aI0hJX_XXM

In this video, you'll learn how to add a custom form to a Remix application to accept a one time payment with react-stripe-js. We'll start from npx create-remix and show how to set environment variables for your Stripe API keys, how to configure the Elements provider, and ultimately the PaymentElement in order to accept a one-time payment.We'll ...

โ–ถ Play video
#

So I'm wondering how I can make it so that when a user refreshes, they can't create a dozen subscriptions that they won't pay for anyway (especially since they don't disappear from the dashboard after 24 hours).

graceful badge
#

ah I haven't tried this flow myself so I can't say for sure but maybe you'd want to refactor your code to only create a sub on user interaction and not on page load

hot agate
#

It's a bit complicated, it'll probably take me a while yet, but thanks for the help!

graceful badge
#

NP! ๐Ÿ™‚ another option is to save previously created subscription in your localStorage and checking it before making a request on page load

hot agate
#

I had completely forgotten about it. That's a great idea. THANK YOU SO MUCH