#alex-from-fuxam_code
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/1231914139052408884
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
you want to prefill the customer's card in the Checkout Session page?
if so, this is explained here: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-customer
A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer’s card details.
yess
They fill in the billing address, billing name and billing email on the checkout the first time they do it
and then they have to do it again
👋 taking over for my colleague. Let me catch up.
checking out the documentation right now
let me know if you need any more help
Yes i do. I'm following the dcumentation and the user still has to fill in everything twice
or at least i thiknk i am
would you mind sharing the checkout session ID?
one second
take your time
can you please check if you have "Preferences" enabled in https://stripe.com/cookie-settings
you should test from the start
got it
create a new checkout session
I just tried again and it didn't work. Is it possible that i have to enable this in test mode somehow?
Also, just fyi: I use thiss same procedure `
payment_intent_data: {
application_fee_amount: roundedApplicationFee,
setup_future_usage: "off_session",
}, in a different part of my app and it saves the customer for the next checkout... not sure why that is
Also: This process, exactly as i had it, worked a couple months ago without any issue
dont know if that helps, just trying to give more input
so the issue is that the information(billing address) from the pre-existing Customer you pass to customer is not showing up in the Checkout page?
correct. I want to make it easier for the user to reuse the checkout session
that only gets prefilled in certain circumstances like if the Customer was previously created through Checkout
this is the case
on second go they should just have to confirm terms and then click purchase and be ready to go
hmm, not sure then, maybe something changed or there's an experiment/flag happening. I'll flag it internally and you can open a support case too
do you have a link for me to do that? and can i link this conversation?
https://support.stripe.com/?contact=true and no we don't have a flow for that Discord->suport case today
Should i just go through the intercom then?
intercom?
to clarify the one thing I'm not sure about here is you created the Customer yourself and passed it into the first session, which saved the card. I'm not sure if that is meant to then prefill in the second session or if the feature only works when you let Checkout create the Customer instead of passing your own pre-existing one.
but if you say you used this exact flow before and it worked then we can dig into it. Overall this pre-fill feature is not something I tend to rely on as it has so many nuances unfortuantely(we're working on better/more explicit customer re-use products)
yeah like 99% sure that we didn't change anything since we deployed this last time that would mess this up.
the support bubble in the bottom right on the link you sent
The customer is created through stripe checkout -> We save the customer Id from this checkout sesh -> On next checkout session we retrieve the customer id if there is any -> checkout session should have existing user data
The customer is created through stripe checkout -
no they're not, you created them explicitly and then passed to the first Checkout
oh true true
if i dont pass a customerId, the customer is created through the checkout session, correct?
cause i could try that
like I said maybe it only works if you use a Customer that Checkout explicitly creates. That's my memory of how this feature works
I don't think it gets created since it's just payment mode, you'd need to pass https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-customer_creation "always" to have one created
okay got it. Is there anyway i can add metadata to the user that gets created in the checkout session?
no; you'd have to call Update Customer later e.g. when handling the webhook
I just double-checkedb whether its possible that this is the issue and it cant be the issue because there's another part where I also create the customer before the checkout session and there it works that the user gets remembered
but this could be the problem
testing this now
actually this can't be the issue either then, i just realized. Because as things currently stand, the customer gets created before the checkout session, so this value wouldn't impact anything because we're not creating a customer
well what I mean is, the default way this prefill feature works is like
- create Session A. That creates a Customer(in old API versions that always happened, since 2022 you have to opt in with
customer_creation) - create Session B passing
customer:cus_fromsession_a. The information gets prefilled
I don't know if it works if you create the Customer separately and pass it into A and then B, which is what is happening in the example you shared.
my guess is maybe it doesn't but if you're sure you used the exact same flow and it did prefill maybe something changed. I asked internally but given timezones and things the answer will be a bit async
BUt i have another part of my app which does:
- Create Customer A with metadata, create session A and add customer_update{...:"auto"}
- Create Session B, the information gets prefilled.
So since this is already working, i couldn't imagine the user not getting autocrreated in session A being the issue here
yeah makes sense, really appreciate your help!
oh apparently we have changed this recently https://support.stripe.com/questions/prefilling-saved-cards-in-checkout , someone has just told me
so yeah it's that apparently, there's a new https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-saved_payment_method_options-payment_method_save parameter you have to pass on Session A to explicitly say that the saved payment method should be made available in future payments.
Since your connected account was created after Apri 18 it gets this behaviour by default now
unfortunately I have to run for lunch so will handover to @thorny cave
Okay coool thank you ! One more question. I cant see the payment-method-save option. I'm assuming this is because I don't have the latest stripe version. Do i have to upgrade it in the package.json in order to give it a different date? Are there any risky changes this will introduce? my api version 1.5 years old Figured this out
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
Alright, please let me know if you have any follow up questions.
Glad to hear that!