#xiaowo_webhooks
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/1284074704935718934
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
for exampe
Hey! Taking over for my colleague. Let me catch up.
hey, can you understand my question?
No
Can you share more details ?
From what Stripe API reference you are getting these fields names ? periodEnd and periodStart, current_period_end and current_period_start ??
During the subscription webhook process, I tried to convert the resulting stripeObject to a Subscription object, but found that the conversion failed. The possible cause of my query error is that the field name returned by the webhook does not match the field name of the Subscription object. I would like to ask whether it is caused by the inconsistency of field names.โ
at this line, errors show up.
You need to update your Model to the Subscription object
Here is all the attributes:
https://docs.stripe.com/api/subscriptions/object
You need to update your Java Class to meet these attributes names. Or create a separate Class
but the Subscription Model is from java-sdk which version is 24.12.0
you means i should create a own Subscription model in my code ?
Can you share the event Id ?
evt_1PyUj0HiYvn8ZIkel0TJG9n8
No you can use the models of the SDK
Probably you have a version mismatch
The event API version is 2023-10-16
And this SDK is pinned to the same API version
https://github.com/stripe/stripe-java/blob/master/CHANGELOG.md#2400---2023-10-16:~:text=This release changes the pinned API version to 2023-10-16
Okay, thank you very much. I'll test it immedatly
Can I use version 24.12.0 in the live model to handle this webhooks?
hi, i changed my sdk version to 24.0.0, but the problem has also existed
please ingore latest message, maybe my fault, let check it again
i have changed my sdk version to 23.10.0, but the problem has also existed
@zinc shale
Yes of course, it's a minor update to the version 24.0.0
This event is invoice.paid, why you want to cast the body to Subscription model ?
You need to cast it to an Invoice instead.
oh, i get it, i misunderstand the doc, I'll test it immedatly