#eleanor
1 messages · Page 1 of 1 (latest)
Seeing this in stage/dev (subscription_update)
but this in prod (subscription_create)
It's possible that something is funky with our billing settings between test and live modes, but we can't find any issues yet, so were wondering if you knew why this might be the case! Thanks and lmk if I can provide any other info 🙂
Hey there, let let take a look. Can you share those event/invoice IDs here so I can inspect them?
oh no is it because our api version of stage is 2018... (this is the only difference I have just noticed)
yeah I can get the ids, one sec
live: evt_1NLA3OHXmgnvESxQQRXHDv2c
test: evt_1NLA3NHXmgnvESxQPp9ESmgt
it may very well be the api version thing, in which case, sorry to take up your time
Yes I think so, this is one of the things i was going to check:
https://stripe.com/docs/upgrades#2018-10-31
The billing_reason attribute of the invoice object now can take the value of subscription_create, indicating that it is the first invoice of a subscription. For older API versions, billing_reason=subscription_create is represented as subscription_update.
NP!
also wait ok so
our live mode api is on a later version and we're not sure how to change test mode, actually?
when we create our stripe client in-app, we do something like:
export const STRIPE_API_VERSION = '2022-11-15';
const stripe = new Stripe(process.env['STRIPE_SECRET_KEY']!, {
apiVersion: STRIPE_API_VERSION,
timeout: 10000,
});
But you do something different in test mode?
no, we do that for everything — though I see that even in the production/live screenshot, it says api version 2020-08-27, which also wouldn't make sense since in our code we have it as 2022? I can't find anything in the docs if there's another step we're missing somehow
Ah its because of the webhook endpoint api version.
The test mode endpoint is set for API version 2018-09-24 (predating the change)
https://dashboard.stripe.com/webhooks/we_1FcJuPHXmgnvESxQslxUiIte
While the live version is using your account default (2020-08-27)
https://dashboard.stripe.com/webhooks/we_1FfBaZHXmgnvESxQB5oTUH27
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So you should create a new test mode webhook endpoint using the API version you want to receive events in
Ah ok, there's no way to change an already-existing endpoint to the latest api version?
Hello 👋
No, there's no way to update an existing endpoint to a diff version.
You'll need to re-create it
ok, thanks!