#cgy
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- cgy, 3 hours ago, 46 messages
Hi, how can I help?
You'll get your answer faster if you can get me a summary of what you want to achive/ problem you want to solve.
OK
My qusetinon is complicated
My backend library of Stripe dose't match API version
Now I follow suggestion of your team member "river" to create a new Webhook and specific version
But I found there are two question.
- My library of Stripe is; 24.2.0 and new webhook API version is 2023-10-16
But the code: dataObjectDeserializer.getObject().isPresent() get result "false"
You haven't told me what problem you are trying to solve
- The new webhook does not contain the old webhook events, why is that. "river" told me it contain
1 and 2 is my problem
You have an event ID that I can take a look at?
pi_3OCG6mLDjQX4i1o11VDdMa65
evt_3OCG6mLDjQX4i1o11budQtZA
If the code get false I will return HTTP code 400 and after some time my webhook will be suspended
https://dashboard.stripe.com/test/logs/req_ysYDxFcFZZRKN7 you explicitly set the api-version in this request, isn't this the api version that you want the events to be rendered to?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
And for question 2, previous_attributes are only presented in *.updated events. see https://stripe.com/docs/api/events/object?lang=node#event_object-data-previous_attributes
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
For first question, I think you send me with this red line right?
So why the code get false?
Give me the full code
This line bro
I follow instruction of your docs around one year ago and this year we upgrade library to 22.0.0 to use billing sdk and subscription. But I did't know there will be a question in API version and library match. So I concated with your team for 3 weeks. But it doesn't help. Now I have to upgrade my library to the latest and API version also the latest. But it still not work !!!
There's no need to shout, I'm here to help you
Sorry I do not shout..
Your team is professional. Everytime I reaches your team I can fix my problem quickly. I just pushed by my customer a lot. Sorry.
No worries. What's the previous version that you are using? did you follow this migration guide to upgrade to v22? https://github.com/stripe/stripe-java/wiki/Migration-guide-for-v22
No, I mean the Stripe-Java SDK version
22.0.0
OK, so you didn't change the Stripe-Java SDK vesrion, you just updated the Stripe API version and now the code dataObjectDeserializer.getObject().isPresent() always return false?
No, today I upgrade my Java SDK to latest one and create a new webhook use API version 2023-10-16
and this line return false.
The best is I don't need to upgrade my Java SDK and can match the API version 20 and 23
Because several use API version 20 and one of them find it didn't work. So I ask him to upgrade API version and this one's API version is 23
Let me summarize, you want your webhook events to be rendered in PI version 2023-10-16, and that's why you updated the Stripe Java SDK to 24.2.0
Yes, I want to test if this can match and later I will test if API version 20 can match Java SDK 24.2.0
Serveral customer use different API version
What's API version 20 ? there's no such API version
That's an old version, and you should use the SDK version that pinned to this API version
First time my java SDK is 20.66.0 but when do billing function I have to upgrade to 22.0.0
So cause this problem
May I kindly ask you a suggestion how can I match 2020-08-27 and 2023-10-16 two API version?
No it's impossible. Java is a static typed language and you can't have a Java runtime to process data rendred in two different Stripe API versions.
So if I upgrade to 24.2.0 and webhook send with API version 2023-10-16 isPresent() still return false.
Second, the old webhook event will lost.
- Can you send me the complete code?
- Not sure what you mean
May I know why fist problem return false? And I to deal with second problem.
OK
wait
Hello, can you see any problem int this code ?
No, it's exactly the copy-and-paste from https://stripe.com/docs/webhooks/quickstart?lang=java
Yes, one year ago I copy from your docs.
Can you put a breakpoint and see what the event object contains?
Ok, so the event data is constructed successfully, but there's a problem in deserializing it, can you double check your Stripe Java SDK version is 24.2.0, and make sure your Java app is compiled with the right SDK version?
Ok, let me check again.
I make sure is 24.2.0 and compiled again. But meet another error.
andler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.stripe.net.ApiResource
This line: event = ApiResource.GSON.fromJson(payload, Event.class);
Hmm, looks Stripe SDK wasn't imported successfully in your project. You might want to make sure Stripe SDK is avaible in the runtime.