#Kamesh

1 messages · Page 1 of 1 (latest)

cosmic saddleBOT
unkempt bone
#

hello! it depends on what API versions your Stripe account / SDK is using - https://stripe.com/docs/upgrades#2022-11-15. From v2022-11-15, the charges property on PaymentIntent has been removed and you would use the latest_charge property instead.

Keep track of changes and upgrades to the Stripe API.

glad scaffold
#

if i want charges, which version should i use?

unkempt bone
#

any version before 2022-11-15

glad scaffold
#

Thanks. we checked and for the same code, we are getting latest_charge for one region (newly create) and charges for other reions (existing)

unkempt bone
#

that's because a Stripe account will always use the latest version (at the time the account is created) as the Stripe account's default API version. If you're not using a strongly typed language (where the API version is tied to the SDK version), then you should explicitly define what API version you use in your code

#

e.g. const stripe = new Stripe('sk_test_...', { apiVersion: '2023-08-16', });

glad scaffold
#

let me check

#

so for version before 2022-11-15 should we use apiVersion: '2022-11-15' ?

unkempt bone
#

can you share an account id for which you're receiving charges?

#

i'll take a look to see what's the API version for that account id

#

the version just before 2022-11-15 is 2022-08-01

glad scaffold
#

thanks. let me check account id

#

acct_1N8Z1NAbyUDQHodH

unkempt bone
#

the default API version for this account is 2022-11-15

#

i don't think you're currently receiving charges for this account

glad scaffold
#

we are receiving latest_charge for this account

#

this account returns charges acct_1InFvuIZA2viOdgb

unkempt bone
#

the default API version for acct_1InFvuIZA2viOdgb is 2020-08-27

#

you'd probably want to ensure all your accounts are using the same API version

#

so that you don't get different behaviour

glad scaffold
#

so we pass in code the version set to 2022-08-07 ?

unkempt bone
#

if that's the version you intend to use for all your accounts, then yes

glad scaffold
#

Thanks