#leor_java-sdk-api-version
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1436061637445554277
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
screen show showing the charge json is in the payload
hello! fyi the server is a little busy atm but i will get back to you asap
ok
also, this code was working which was last tested several years ago with an older version of the events api (2022)
hi! sorry for the delay, looking at this now
ok
i think this often results as a difference in versions between versions in your stripe account and the version being used by your integration, like in this stackoverflow
https://stackoverflow.com/questions/73183026/why-is-dataobjectdeserializer-getobject-not-present
can you take a look at that real quick and let me know if it helps?
but I upgaded to the latest java library. Which version of library do I need to work with webhooks 2025-10-29.clover version?
hello?
hi! sorry, still juggling a few threads
ok
hmmm yeah i think that is the right version
ok
just as a sanity check can you try adding a check for Stripe.API_VERSION in your code?
yeah I can't do it very quickly because I cannot access discord from my work pc, I am on my personal pc. Can you give me a few minutes? It takes a while to recompile the large project. I'll be back in a few.
yeah no worries!
i would also add a check for event.getApiVersion() (we can see this on our end too but it might be nice to just add it in while you're at it)
OK I did the api and it shows 2025-10-29.clover. Let me add the api version brb
ok the event version and the api version are the same -2025-10-29.clover.
Hi ๐
My colleague needed to go so I'm stepping in. Can you share the event ID?
evt_3SQXeBBBKIuAStQq1aH5bfh0
I think the Java SDK you are using might still be on an old API version. Looking at the request that created this payment intent: https://dashboard.stripe.com/acct_1LamRMBBKIuAStQq/test/logs/req_TT5u5SEzOQeAy2
I am seeing an API version of 2022-11-15 and the Java SDK 22.0.0
let me try a new payment request. give me a minute. thanks.
Sure thing
here's the new charge event evt_3SQZRUBBKIuAStQq1YXnGE71
the old APi version is coming from the javascript component:
// initialize stripe API library with key and version
const stripe = Stripe(pk.publicKey, {apiVersion: '2022-11-15'});
Okay, both webhook endpoints are using 2025-10-29.clover ๐
should I change that to 2025-10-29.clover?
Yes the version is being pinned in the JS! You can see that in the confirmation request: https://dashboard.stripe.com/acct_1LamRMBBKIuAStQq/test/logs/req_ekNVFcHKW6X1hS
Starting with the .basil API verisons, we have versioned Stripe.JS too
so would that affect the event deserialization?
Hmmm... no that shouldn't
The event type being returned is 2025-10-29.clover so as long as the code doing the deserialization matches, you should be good
That being said, the Java SDK that created this payment intent was still v22.0.0 using API version 2022-11-15
OK, so what am I to do? the event api and the stripe api in the java code are the same. I cann see the "ch_.." data in the event object, so why won't it deserialize?
Based on the creation request, I think your Java SDK isn't matching still
Is there are problem using JDK 22?
The Java SDK is pinned to a specific API version.
stripe-java version 22.0.0 is explilcitly pinned to version 2022-11-15
I'm not sure I understand. 22 is a recent version I am using stripe version:
<dependency>
<groupId>com.stripe</groupId>
<artifactId>stripe-java</artifactId>
<version>30.1.0</version>
</dependency>
Ah, no I didn't mean Java version
I mean that the requests you are generating are using the stripe-java SDK version 22.0.0
Regardless of what your maven? dependency appears to show
Each Stripe SDK sends the version being used for every API request
OK, so you are saying that even though my maven shows 30.10.0, it is using stripe version 22 still?
Correct
OK that I odd. I have recompiled everything.
Yeah I just have a very basic Java integration that uses build.gradle to specify dependencies. It's not production ready but it allows me to run Java code snippets.
oh, wait. I understand what is going on now. I am running my application locally to get the local events but the payment page is bein run from my hosted environment. That has not been updated. I think I am good now. I need to get our hosted app to use version 30.1.0 then,
Okay but wait. So you are listening to events on your local environment?
yes
And that local env is using the Java SDK 30.1.0
Then you should be able to successfully de-serialize the JSON payload to the correct Java object
correct. but I cannot.
Can you tweak your local dev environment to create/confirm Payment Intents and generate the charge.succeeded event?
no, I can't create a payment intent from my local environment. That will take me a while. Let me try that, and I will open a new ticket when I am back. can I reference this chat in a new chat?
Yup
ok thanks for your help
Our bot that starts a new thread will link to any recent threads you've had on this server
so when you create a new chat, check the second message in the thread and you will see a link to this thread you can reference
ok thanks