#hugues-webhook-java

1 messages · Page 1 of 1 (latest)

frank mesaBOT
#

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.

peak wind
#

Which line returns a null object

#

This? stripeObject = dataObjectDeserializer.getObject().get()

magic wave
#

No! It's the if clause that returns false.

peak wind
#

Ok

#

But the event = Webhook.constructEvent( payload, sigHeader, endpointSecret );
call was successful right?

#

That's usually the troublesome one

magic wave
#

Yes, Webhook.constructEvent appeared to be successful.

peak wind
#

Ok hm looking

frank mesaBOT
peak wind
#

So the versions you refer to in your question are the sdk versions not api versions

#

So what api version is your webhook endpoint set to?

#

And what version is your java sdk using?

ashen kestrel
#

hugues-webhook-java

magic wave
#

Let me check the documentation that you've sent me & I'll get back to you.

#

The version 24.5.0 is the one of the com.stripe.stripe-java library included in my pom file.

ashen kestrel
#

okay so that one expects the latest API version which is <2023-10-16> so you need to make sure you have a WebhookEndpoint that is configured with that specific API version

magic wave
#

How can I ensure this?

#

It looks like I can specify a date to an endpoint

#

If so can you explain how?

ashen kestrel
magic wave
#

Let me check...

#

This is something new: I never created the so-called WebhookEndpoint. Is is something done on the server side? Is there a guide about this?

ashen kestrel
#

did you just get started today?

#

I see you're using the Stripe CLI but I thought it was just to debug.

magic wave
#

No I did not get started today. I succeeded in creating a PaymentIntent and since I invoked stripe listen --forward-to localhost:8080/stripe/events in the Stripe CLI, I could receive events in my StripeWebhookController. All I'm asking is how to reconcile this version problem. Soo far, I've never heard about this WebhookEndpoint creation.

ashen kestrel
#

yeah sorry I mean did you just start with the webhook part today

#

It's totally fine if so, it's just to know what I need to explain

magic wave
#

OK, I understand. I've been experiencing with webhooks before. It's just the first time I'm doing it with Spring. So far, I've been using your tutorials and they were working fine. I thinks it had to do with the fact that the code and the API version provided in the pom of the tutorials were compatible.

ashen kestrel
#

okay so the Stripe CLI is really just a developer debugging tool

#

it's not supposed to be used in production. In production you create a real WebhookEndpoint on your account that points to the URL that Stripe will make an HTTPS request to whenever it sends an Event

#

It's only in development when testing locally that you would use the Stripe CLI. Does that make sense?

magic wave
#

Yea sure. That's why I've never heard about the WebhookEndpoint creation: I'm still not ready to deploy it on production. So, how do I make the versions match between the CLI and my server?

ashen kestrel
#

use that flag and try again!

magic wave
#

Thanks, I'll try it.

#

It worked for me. Thanks again.

ashen kestrel
#

amazing 🙂

#

And so whenever you go and create a real WebhookEndpoint in the future make sure to use real code and set that API version