#alex-from-fuxam_code

1 messages · Page 1 of 1 (latest)

hasty valeBOT
#

👋 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.

hexed violetBOT
whole sphinx
#

hi there!

#

you want to prefill the customer's card in the Checkout Session page?

hasty valeBOT
merry jay
#

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

mint mulch
#

👋 taking over for my colleague. Let me catch up.

merry jay
#

checking out the documentation right now

mint mulch
#

let me know if you need any more help

merry jay
#

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

merry jay
# merry jay

this is what im doing right nnow to save the user data

mint mulch
#

would you mind sharing the checkout session ID?

merry jay
#

one second

mint mulch
#

take your time

mint mulch
merry jay
#

i enabled it now

#

should i test again?

mint mulch
#

you should test from the start

merry jay
#

got it

mint mulch
#

create a new checkout session

merry jay
#

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

mint mulch
#

I'm not sure to be honest why it's not working

#

let me double check something here

merry jay
#

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

ripe jetty
#

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?

merry jay
ripe jetty
#

that only gets prefilled in certain circumstances like if the Customer was previously created through Checkout

merry jay
ripe jetty
#

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

merry jay
#

do you have a link for me to do that? and can i link this conversation?

ripe jetty
merry jay
#

Should i just go through the intercom then?

ripe jetty
#

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)

merry jay
merry jay
merry jay
ripe jetty
#

The customer is created through stripe checkout -
no they're not, you created them explicitly and then passed to the first Checkout

merry jay
#

oh true true

#

if i dont pass a customerId, the customer is created through the checkout session, correct?

#

cause i could try that

ripe jetty
#

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

ripe jetty
merry jay
ripe jetty
#

no; you'd have to call Update Customer later e.g. when handling the webhook

merry jay
merry jay
#

testing this now

hexed violetBOT
merry jay
#

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

ripe jetty
#

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

merry jay
#

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
merry jay
ripe jetty
#

unfortunately I have to run for lunch so will handover to @thorny cave

merry jay
#

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

thorny cave
#

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.

merry jay
#

thank you ! trying to test this now

#

It workedddd 🙌 thank you

thorny cave
#

Glad to hear that!