#Kamesh
1 messages · Page 1 of 1 (latest)
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.
if i want charges, which version should i use?
any version before 2022-11-15
Thanks. we checked and for the same code, we are getting latest_charge for one region (newly create) and charges for other reions (existing)
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', });
let me check
so for version before 2022-11-15 should we use apiVersion: '2022-11-15' ?
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
the default API version for this account is 2022-11-15
i don't think you're currently receiving charges for this account
we are receiving latest_charge for this account
this account returns charges acct_1InFvuIZA2viOdgb
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
so we pass in code the version set to 2022-08-07 ?
if that's the version you intend to use for all your accounts, then yes
Thanks