#felipe_code
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/1332343297699614820
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- felipe_api, 2 hours ago, 33 messages
- felipe_code, 2 days ago, 24 messages
- felipe_code, 2 days ago, 16 messages
val subscription = event.data.object as Subscription
this way is depracated but the new one in documentation returns me null object
Hi, let me help you with this.
What article are you looking at?
Weird, since this example still tells you to use .getObject(): https://docs.stripe.com/webhooks?lang=java#example-endpoint
sorry I said it wrong
if (dataObjectDeserializer.getObject().isPresent()) {
stripeObject = dataObjectDeserializer.getObject().get();
} else {
// Deserialization failed, probably due to an API version mismatch.
// Refer to the Javadoc documentation on EventDataObjectDeserializer for
// instructions on how to handle this case, or return an error here.
}
i used exactly this command
but my stripeObject variable is empty
actually, my dataObjectDeserializer variable is empty as well
as you can see on the print
Could you please share the full handler code?
Both
alright
Depracated
Here is the new one, my dataObjectDeserializer always have the object as null
And the Deprecated one works, right?
Hey! Taking over for my colleague. Could you please share the SDK version you are using ?
It seems like you're not calling the method actually:
- event.dataObjectDeserializer
+ event.dataObjectDeserializer()
okay
can you wait 5min for me to check?
- event.dataObjectDeserializer()
Don't think thats how it works in kotlin actually
I'm not doing it wrong cause of that
sdk current java
Using java version 11.0.17-tem
What Java SDK are you using ?
felipeduarte@Felipes-MacBook-Air backend % java -version
openjdk version "11.0.17" 2022-10-18
OpenJDK Runtime Environment Temurin-11.0.17+8 (build 11.0.17+8)
OpenJDK 64-Bit Server VM Temurin-11.0.17+8 (build 11.0.17+8, mixed mode)
Thanks, and what is the Stripe Java SDK version you are using ?
// stripe
implementation("com.stripe:stripe-java:28.2.0")
Thanks for sharing, checking...
The main issue here is that you are using the latest Java SDK while your webhook event is using an old version
First thing to do here, is to update your webhook endpoint to use the latest API version too 2024-12-18.acacia
Java is a strong typed prog language, so you need to always make sure that your using the correct API version pinned to the SDK version employed in your integration.
you mean on my build.gradle, right:
No I mean here, you need to receive the event with the corresponding API version of the sdk used
hm, not sure where do I change that
No worries. How are you listening to the events
is this a webhook endpoint or using Stripe cli ?
webhook endpoint
actually, both
i'm testing on stripe cli
but the goal is webhook endpoint
For Stripe Cli, you have two options:
- Use the fla --latest https://docs.stripe.com/cli/listen#listen-latest
- Or upgrade your default API version to the latest one (in your Stripe dashboard)
For webhook endpoint:
- If you upgraded your default API version, then you can simply create the endpoint from your Stripe Dashboard:
- If you don't want to upgrade your default API version, then you need to register the endpoint via API and sepcify the target version: https://docs.stripe.com/api/webhook_endpoints/create#create_webhook_endpoint-api_version
where do i upgrade the default api version
Recommend reading that guide thoroughly. This can cause breaking changes in your integration