#daniel_best-practices
1 messages · Page 1 of 1 (latest)
👋 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/1315741082046304367
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- daniel_docs, 5 days ago, 14 messages
Hello! Regarding your first question, SDK versions and API versions are generally different things. Some SDK versions are pinned to a specific API version, but those versions are still independent of each other. Also, Stripe.js does't really have versions (you should always be loading the latest directly from Stripe every time) and uses the default API version set on your account.
Regarding your second question, it sounds like it might be better for you to keep track of the cart on your end and only create a Payment Intent when someone actually wants to pay.
Hi, that makes sense… so my default API version is on 2022 so the JS file is always attached to that?
No way of me specifying a version for the JS file manually as we are not ready to upgrade the account API version yet 😦
No, there's not. Why do you want to change the API version, though? Are you experiencing a specific issue?
Just trying to get everything on the latest latest and was bugging me seeing the version difference in the logs 🙂
Gotcha. If you're not seeing any issues I recommend you leave it as-is. There's no need for you to upgrade just for the sake of upgrading.
Just thought… is it okay then to have the SDK on the latest version and the JS/account default on a previous?
Like, should i downgrade the SDK in that case? The one i’m testing in development
Okay, do you mean the “pay now” button is clicked?
It's generally fine to have the default API version on your account be something different than the API version your SDK is using.
What pay now button are you referring to?
Oh, I see.
Yeah, wait to create the Payment Intent until the customer is actually trying to pay.
Thats similar to most of the examples over on 4242.io
I did read…
We recommend creating a PaymentIntent as soon as you know the amount, such as when the customer begins the checkout process, to help track your purchase funnel. If the amount changes, you can update its amount.
Candidly, I recommend you ignore that. 🙂
You probably want the deferred flow, or some variant of it, which you can see in action here: https://4242.io/test/payment-element-deferred/
See also the associated docs: https://docs.stripe.com/payments/accept-a-payment-deferred
Okay, brill… i love that 4242 website, just a shame they all have the “code isn’t production ready” as would love to just copy paste most of it over ideally 🙂
The production ready code would have a lot of error handling and other stuff that would get in the way of understanding the core Stripe concepts. 🙂
Okay… i’ll do some testing on all this later and probably be back on here if it doesn’t work 🙈