#oboxodo

1 messages · Page 1 of 1 (latest)

quasi geodeBOT
fringe plinth
#

Hi there. Looking

shrewd mica
#

thanks

fringe plinth
#

Do you have the request id?

shrewd mica
#

let me find it

#

this should be it req_5tziiu3xI3eAPG

fringe plinth
#

Cool thanks

shrewd mica
fringe plinth
#

So that's why

shrewd mica
#

wait

#

I know the customer doesn't have an address

#

but that's not required to create a checkout session as long as we allow the checkout session to update the address with the customer_update.address property set to "auto", which we do

#

and as I said, this worked yesterday, also with just created customers

#

with no address

#

let me try to find an example from last night in the logs...

#

Found it

fringe plinth
#

Ok I gotcha. Yeah an existing example to compare would be great

shrewd mica
#

Look:

  1. customer being created: req_k4XN1qBOCo76tV
  2. immediately after, checkout session for that user being created: req_TjkwVpRQmB71AE

Both with 200 OK response from Stripe

fringe plinth
#

Hm yeah

#

Let me ask a colleague what might be going on here

shrewd mica
#

I suspect Stripe deployed some change since yesterday which caused this behavior change. It looks like if the API couldn't recognize that I AM setting customer_update.address = "auto"

fringe plinth
#

Can you provide an example where you just pass customer_update.address=auto

#

The second example you shared that succeeded also passed customer_update.shipping=auto

shrewd mica
#

We always pass both. The failing example I passed you first today didnn't include the shipping because I wanted to give you the shortest example possible. But it fails today even passing both. Let me show you. I'll do a new request passing both.

fringe plinth
#

Got it yeah can you share that

shrewd mica
#

Here you have a fresh failed try including both billing and shipping auto settings: req_fPswwBhgm3fEEF

#

BTW... including "billing_address_collection": "required" or not doesn't change the result.

fringe plinth
#

Ok thanks. Will get back to you when I know more

shrewd mica
#

Thanks. This is a key functionality we need.

quasi geodeBOT
shrewd mica
#

By the way... a teammate of mine who is using a separate stripe test account than mine is also experiencing the same problem. The same code stopped working for him in the last ~10 hours.

#

So this is certainly not affecting my own setup.

fringe plinth
#

Ok my colleague wants to see what would happen if you try the following:
Can they try create a session with cus_NuBYQ3YvhzjNbr and set shipping_address_collection?
You set shipping[address] on creation here: https://dashboard.stripe.com/test/logs/req_KhTjlM57YZgMBN but it's invalid for a US address. But because you're not passing shipping_address_collection, Checkout can't collect a valid address. And we always default to a shipping address for tax calculation when available.

#

So can you try doing ^ and send the request id?

shrewd mica
#

mmm... not sure I fully understand what you want but I'll try something. Give me a minute.

fringe plinth
#

Just this piece: Can they try create a session with cus_NuBYQ3YvhzjNbr and set shipping_address_collection?

#

But add shipping_address_collection

shrewd mica
#

I added this:

  shipping_address_collection: {
    allowed_countries: ["US"]
  },
fringe plinth
#

Ok cool

#

Give me a minute to explain

shrewd mica
#

but I don't understand why it worked with that today, but it wasn't needed yesterday.

fringe plinth
#

The issue is the requests you have shared aren’t the same. You created Customers with different parameters:
-The creation request for the Customer that doesn’t work with an auto tax session (cus_NuBYQ3YvhzjNbr): https://dashboard.stripe.com/test/logs/req_KhTjlM57YZgMBN
-The creation request for the Customer that did work with an auto tax session (cus_NttZ2ehQhZFhxz): https://dashboard.stripe.com/test/logs/req_k4XN1qBOCo76tV

Because the former has an invalid shipping address for tax calculations, Checkout needs new details. But in the example sessions you've shared upi weren’t passing shipping_address_collection so Checkout can’t collect new details, and as such it just errors as the existing shipping details are incorrect.

shrewd mica
#

this solution won't work for us because we don't WANT to ask for a shipping addres when the customer is only purchasing digital goods.

#

but why did this same code work until yesterday?

#

did Stripe change something yes or no?

rotund dome
#

Taking over here. The issue is you provided the shipping parameter when you created cus_NuBYQ3YvhzjNbr

#

Nothing has changed here, in fact the 2 examples you've shared are totally different and we've outlined why they're broken

rotund dome
shrewd mica
#

oh! so the problem is at the time of creating the CUSTOMER, not the checkout session.

#

I think I got it. You're saying if the customer does have a shipping address, even if it's incomplete, then the checkout session MUST include the shipping_address_collection property. Am I right?

rotund dome
#

Yes, exactly. Because you created cus_NuBYQ3YvhzjNbr (here: https://dashboard.stripe.com/test/logs/req_KhTjlM57YZgMBN) with an invalid shipping address, Checkout needs to collect new, valid address details in order to calculate tax (we will always default to a shipping address to calculate tax when available).

shrewd mica
#

ok. undeerstood.

rotund dome
shrewd mica
#

Thank you guys.

#

yes, collecting onoly billing address is what we want in 99% of the cases.

#

I gotta step out now but I'll try to find the issue in our code later and get back here.

#

thanks