#fygasdfgsadf-versions

1 messages · Page 1 of 1 (latest)

opaque holly
#

@west pike hi! in general setting sripe.api_version that way in your (Python?) code should work.

But the session object I get on the success page
how do you get it exactly? if you're calling stripe.checkout.Session.retrieve on a script from that page remember you need to pass api_version there as well(for the retrieve call)

#

the object itself can be retrieved using any API version, it gets returned rendered in that version, it doesn't have any specific locked version based on how it was created

west pike
#

I am receiving it via stripe.checkout.Session.retrieve , and I am setting the stripe.api_version before doing the retrieve call. Yes, I am using python.

opaque holly
#

can you share the ID of the exact session? cs_test_xxxx I think

#

also are we definitely talking about(the snippet of JSON you shared above) looking at the response you get from stripe.checkout.Session.retrieve or we are talking about the contents of a webhook request body? Since webhooks work quite differently here :p

west pike
#

cs_test_a1BQZ5BuqJ55R4k0U5qlLTbkA9wis0ZUCXPBeMQ28vKqXE8N6CPdluJYNG

#

Bit you are right, it could also be from a webhook, sorry.

#

I have to rerun the test.

opaque holly
#

yep from what I can see you are passing the header correctly

#

for webhooks though, the event is sent using the default API version of your account(it's not related to the version you make the request in)

#

what you likely want to do for testing is create the endpoint using the latest version instead, so then we send it events rendered in that version :

#

or if you use stripe-cli, it has a --stripe-version option to stripe listen

west pike
#

Ok, I will try the --stripe-version option.

#

I tried --version and --api-version ...

opaque holly
#

ah I'm wrong actually, it's just --latest

west pike
#

unknown flag: --stripe-version

opaque holly
#

yeah you want --latest, my bad

west pike
#

Ok, it works now.

#

Thank you

#

btw. When did Stripe became so confusing?

#

7 years ago it was a walk in the park. Now it is like Paypals API.

#

Or I am getting old.

opaque holly
#

thanks for the feedback! The API does support more use cases and payment methods than it did, and there's also factors like increasing use of customer authentication like 3D Secure in the industry, all of which adds complexity to the API, but this is definitely something we think about and discuss a lot internally so I appreciate the feedback.