#casey_api
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/1313609075128533092
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi 👋 taking a look
I see in the Payment Intent creation request link is returned inside of payment_method_types
https://dashboard.stripe.com/logs/req_YwHPvSgokNDmGV
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Still looking, but I'm noticing that this is a livemode request, did you have this working as expected in testmode?
I think there are some misaligned parameters between your frontend and backend.
This request was made to update the Payment Intent, and it changed setup_future_usage to be on_session which Link doesn't support. So link is dropped from payment_method_types.
https://dashboard.stripe.com/logs/req_3cLla2LzHirBfl
How are you initializing Elements and the Payment Element?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Still looking, but I'm noticing that this is a livemode request, did you have this working as expected in testmode?
Nope, because Link doesn't show up when I'm in test mode. V possible I'm doing something wrong, there...but I had just assumed it was by design—ie, that Link is just never available in test mode.
Ahh, gotcha. Let me pop that file open, one second...
Yeah, so we're checking for whether or not it's a recurring setup and, if so, we update to off_session...but it's in a ternary that otherwise applies on_session (ie, for one-time gifts). So maybe just need to set it to null, in that latter case? 🤔
Also realized we're not initializing/creating the PaymentIntent with setup_future_usage at all, so it's being "added" when the PI update happens. Not sure if that matters.
It may matter depending on how you're initializing Elements and the Payment Element. Are you using the client secret of the intent to do that?
Or are you using this approach to initialize without the intent?
https://docs.stripe.com/js/elements_object/create_without_intent
Nope, the former—we're passing the PI's clientSecret into Elements, on initial page load. So yeah, that PI (and Elements) doesn't receive any setup_future_usage initially.
Gotcha, so then once you update the PI you should also update the Elements instance with those updates via elements.fetchUpdates()
https://docs.stripe.com/js/elements_object/fetch_updates
Got it, that makes sense. And I should maybe add that—if I understand setup_future_usage correctly—we don't actually need on_session in this context. Donors are all "anonymous", in the sense that they're not authenticated, so we do not need the ability to present that Link payment method again, when the donor is back in a future session. Assuming Link works with off_session and we can keep it enabled in that case, I'm wondering if we just need to update that ternary to setup_future_usage to null (instead of on_session) when it's a non-recurring gift.
I'm just thinking that, while we still presumably need to run elements.fetchUpdates() when the underlying PI is changed server-side, it wouldn't impact Link if it works correctly across off_session and null values for setup_future_usage. Am I completely off-base with that line of thinking?
That sounds reasonable. As long as you're not planning to reuse the resulting Payment Method with intents that you confirm from your server without setting off_session to true, then I think you're fine, but will always suggest testing to be sure.
For sure, that makes sense. One last confirmation, here. Should Link be available when the PI is created in test-mode?
I still see Google Pay and Card methods listed, but Link isn't available.
If the Payment Method Configuration being used has it enabled, and you don't have custom restrictions around amount in place, then probably.
Do you have an example Payment Intent where you expected to see it but didn't?
My guess here is that LInk isn't enabled for Connected Accounts, taking a closer look.
Yeah, Link is off by default in the PMC for your testmode Connect payments:
https://dashboard.stripe.com/test/settings/payment_methods/connected_accounts?config_id=pmc_1QS3xHHrYYOfoc7N6xLb2zgI
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
It is? Looks like On by default in both live and test modes.
Hm, could have sworn it wasn't. If you create a new PI now, is link there?
Huh, yep it sure is! You must've updated it for me, haha—thanks!
I somewhat weirdly don't see Google Pay now, though.
I'm pretty sure I didn't, but it doesn't mean someone else from your account wasn't fiddling with things at the same time.
See it where?
Oh, because it's now off by default. 🙃
As an available payment method option, with that latest PI.
I'm actually the only user on this account, so not sure what happened there.
Maybe I unintentionally saved or something? I'm not sure.
It won't be in payment_method_types. Apple and Google Pay are a subset of the card payment method type
Yeah, I just meant that it wasn't showing up in the Elements on the page, as an available option for the donor. I re-enabled it and just saved, will confirm it's back.
Yep, all good—GPay + Link both showing now. 👍
Perfect!
Now going to do a quick test on the setup_future_usage changes we discussed.
Sounds good! I need to step away, but my teamamte is around if there are still any questions we can help with. Best of luck with the rest of your project!
Totally fine, thank you so, so much for your help—really appreciate you all!
Yep, all set—that null/off_session combo worked exactly as I hoped/expected. Really appreciate your entire team here on Discord! I like to think I don't have to pester you all too frequently, but everytime I do, I walk away in a much better place and with a better understanding of Stripe's nuts & bolts. Gotta be some of the best dev support on the entire daggum internet, haha—you all deserve an award. 🏆 Thanks again!