#ferret13_webhooks

1 messages ยท Page 1 of 1 (latest)

potent steepleBOT
#

๐Ÿ‘‹ 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/1306796163369799710

๐Ÿ“ 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.

gray rapids
prime rock
gray rapids
#

It is correct, but it could depends on your environment / framework settings. It's easier to just try a downloaded full project

prime rock
prime rock
gray rapids
#

Can you simply just use the example and Play to test your accout first?

prime rock
#

webhook errors

gray rapids
#

That's the most common errored part

#

The json variable your are taking

#

vs the request.body() from the example code, is different

prime rock
gray rapids
#

The most common error in webhook is your web framework trying to modify the incoming content (via a middleware or setup in the framework) and it has changed

#

And that's specific to SpringBoot

prime rock
gray rapids
#

Can you show the exact diff you made?

#

switch (event.getType()) should be after doing the getObject().isPresent()

prime rock
prime rock
#

webhook with successes

gray rapids
#

Okie but on your server log, what do you get?

#

Do you get the "Unable to deserialize ...."

prime rock
gray rapids
#

Can you try to move the ...getObject().get() to above the switch, and then in switch case, start to cast to each type of object

#

exactly like the sample code

#

And see how Checkout Session works vs. PaymentIntent

prime rock
gray rapids
#

I too don't get that's different for your Checkout Session

#

can you share the code when you did that?

prime rock
prime rock
gray rapids
#

Okie move back to the code where it works, then log out eventDataObjectDeserializer.getObject() before and after the switch

#

to see how it value changes there

#

Now we are seeing it has isPresent() is true before the swtch but false inside the switch

#

I am sorry, running out of idea. Just some general debugging curiousity

prime rock
gray rapids
#

Will open until we change staff. But don't worry, my colleague can always see the past threads

prime rock
# gray rapids Will open until we change staff. But don't worry, my colleague can always see th...

Nothing is working now since we update com.google.code.gson from 2.8.9 to 2.11.0

java.lang.IllegalStateException: Unable to deserialize event data object for charge.succeeded
java.lang.IllegalStateException: Unable to deserialize event data object for payment_intent.succeeded
java.lang.IllegalStateException: Unable to deserialize event data object for payment_intent.created
java.lang.IllegalStateException: Unable to deserialize event data object for charge.updated

gray rapids
#

Even with the Check Session and the old working code?

#

I think that's the library and SpringBoot settings

#

that modified the json content

prime rock
potent steepleBOT
cursive ledge
#

Hello! stepping in to take over from orakaro.

prime rock
cursive ledge
#

I noticed that in testmode, you're using stripe-java 26.5.1 . This is pinned to the Stripe API version 2024-06-20

Now, it looks like you are using the Stripe CLI to forward events on to your local webhook endpoint. The Stripe event API version is 2020-08-27.

With our strongly-typed libraries each library version is pinned to a specific Stripe API version - so if your webhook event is using a different API version than your library, it will have trouble deserializing the object.

It's unfortunate, but the Stripe CLI will always use your Stripe account's default API version which is currently 2020-08-27 for sending webhook events. You might want to setup a webhook endpoint to explicitly use the API version 2024-06-20, and use a service like ngrok to forward the webhook events to your endpoint, and see if you are still running into the same issue

prime rock
prime rock
#

<dependency>
<groupId>com.stripe</groupId>
<artifactId>stripe-java</artifactId>
<version>20.87.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>

prime rock
cursive ledge
#

sorry, which portal specifically?

prime rock
cursive ledge
#

I wouldn't update your default API version immediately. It's going to affect your existing webhook endpoints cause it uses your default account API version.

cursive ledge