#ing32_api
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ing32_subscriptions-payment-element, 1 day ago, 46 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1234941283198308423
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Is there any efficient way to solve this besides checking on unload (i'm using react & typescript) or on other pages continously if the customer's subscription ID is incomplete and cancel it manually?
The solution I provided above can be an issue if someone, for example, refreshes the page 5000 times and creates 5000 subscription intents. Then I would have to cancel 5000 subscriptions which can affect my code. (and prob rate limit my stripe account)
So there's no subscription intents resource on Stripe's API. Are you referring to subscription object?
Just trying to make sure I am on the same page ๐
Yes. I refer to it as an intent because I got used to payment intents LOL. I am using stripe.subscriptions.create with payment_behavior: "default_incomplete" option.
If i have multiple of this active in one currency (or at least one), if the client goes back in the menu and tries to change the currency, my error fails with this error:
You cannot combine currencies on a single customer. This customer has an active subscription, subscription schedule, discount, quote, or invoice item with currency ron.
And I don't want to start working on this using an inefficient way, so I am curious if there's any way to handle this with stripe?
Have you looked into defer intent approach instead?
https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription
This allows you to collect payment method details without needing an Intent. The flow also supports subscription. So in this flow, you don't create a subscription until after payment method has been collected and customer clicks on subscribe
Oh that's cool, I did not know I can do that
let me check something, ill be right back
So if I can select the mode, I would not require to create those "intents" in the back end, right?
What other modes are there except "subscription"?
Thanks.
However I am not sure about one thing, how would I transfer all the specific things I need using this method? Do I not need a product id for example? The subscription is created based on what?
You still create the subscription on server-side like you do with the current flow.
The flow just uses the collected payment method to confirm it. See: https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription&lang=node#create-intent
Got it. Thanks for the links, I'll read through them and come back if I still have issues! Thanks a lot for the help.
Ty!
Hey Hanzo! You can close this thread.
I've read through the defer intent docs, however I'd have to change a lot. I'm thinking of using a subscriptions check approach, and if the user has incompleted subscription objects and a currency change is detected (compared to last subscription object, if existent) then I just delete his incompleted intents. Not the most efficient way but I think is alright for a MVP (that I can improve later).
As long as it's possible to delete "incompleted" subscriptions then I can try to fix it this way for the moment, but I'll definitely save those docs so I can improve the system later.
Thanks once again.
NP! ๐ Good luck