#mink4501_webhooks
1 messages · Page 1 of 1 (latest)
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.
- mink4501_webhooks, 15 hours ago, 6 messages
- mink4501_webhooks, 16 hours ago, 13 messages
- mink4501_webhooks, 2 days ago, 5 messages
- mink4501_webhooks, 2 days ago, 9 messages
👋 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. Thank you for your patience!
⏱️ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.
🔗 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/1213040601289859113
📝 Have more to share? You can add more detail below, including code, screenshots, videos, etc.
Hi.
I want to use both payments and subscriptions through the Checkout Session feature.
Q1. When the charge.refunded webhook event is sent, how do I know if it's a refund for a one-time payment?
Q2. How do I know if the charge.refunded webhook event is sent for a refund of a payment made on a subscription?
Q3. Webhooks are sent when I create and manipulate a payment or subscription in the Stripe console. I can also create a payment or subscription via the API. How can I tell if a payment or subscription was created via the API or in the Stripe console?
Q1. When the charge.refunded webhook event is sent, how do I know if it's a refund for a one-time payment?
Q2. How do I know if the charge.refunded webhook event is sent for a refund of a payment made on a subscription?
You can see if the Charge is linked to an Invoice from https://docs.stripe.com/api/charges/object#charge_object-invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Q3. Webhooks are sent when I create and manipulate a payment or subscription in the Stripe console. I can also create a payment or subscription via the API. How can I tell if a payment or subscription was created via the API or in the Stripe console?
The easiest solution is to explicitly pass metadata when you create an object indicating that this comes from your code. This means that when you create a customer in the dashboard for example you won’t add metadata. The webhook handler can then check the metadata on the object to determine if it comes from the code or not.
It has limitations though as if you update a customer in the Dashboard, it would have the metadata already and you would make the wrong assumption.
Another solution is to track all requests made by your code so that you can associated them with the events you receive. Some of our SDKs support the ability to retrieve the id of each API request you make, req_1234. You can then match it to the request id coming back in the event in request[id] and be sure that your code did cause that event.
This is more complex to implement but would be foolproof as you are sure this is your own code. This is currently supported in java, node, php, ruby and .net
Thank you so much alex!
Q4. Will a one-time payment not generate an invoice, but only if the payment is from a subscription?
Q5. I've considered passing metadata, but since the metadata can be modified in the Stripe Console, I feel very vulnerable relying on metadata. If someone modifies the metadata, it will cause problems. Is there a better solution?
Q4. Will a one-time payment not generate an invoice, but only if the payment is from a subscription?
Are you generating post-payment invoices for the one-time payment via a Checkout Session?
Q5. I've considered passing metadata, but since the metadata can be modified in the Stripe Console, I feel very vulnerable relying on metadata. If someone modifies the metadata, it will cause problems. Is there a better solution?
unfortunately no, not really
Are you generating post-payment invoices for the one-time payment via a Checkout Session?
No
A one-time payment generated via Checkout Sessions won't have an Invoice related to it then
unfortunately no, not really
The reason I ask these questions is because, by default, Stripe webhooks will automatically stop if they don't get an HTTP 200 response.
If it's a Stripe payment or subscription created in the Console, as opposed to a Stripe payment or subscription created through the API, it will return a 404 as the response because this is information that is not registered with the server.
This is causing the webhook to freeze as a result.
However, Stripe webhooks don't guarantee sending events in the order they happen, so we can't give them an HTTP 200 response.
Let's say you want to refund a payment after it has been made.
But if the payment refund event is sent before the payment completion event is properly processed, we need to retry it, and to do that we need to return a 4xx response, not a 200 response.
If we return an HTTP 200 response, the event will be lost. How should we handle this?
We received this email.
We’ve attempted to send event notifications to this endpoint 3 times since the first failure on February 26, 2024 at 3:27:49 PM UTC. If this endpoint is important to your application, please try and fix the issue. If you do not need this webhook endpoint, you can remove it from your Stripe webhook settings. We will stop sending event notifications to this webhook endpoint by March 6, 2024 at 3:27:49 PM UTC.
Here is the summary of errors we received while attempting to send webhook events:
3 requests returned HTTP 404, indicating the URL doesn’t exist. You should verify the endpoint URL is correct in your Stripe webhook settings.
When you receive the webhook event, you can retrieve the original object and then check if it was created via your server based off the metadata
I don't know how your app works in detail, but if the original object doesn't exist yet, you can retrieve the object and then process / create it in your own server
Is it possible to make metadata fields unmodifiable, or are there fields that are the same concept as metadata but are unmodifiable?
I apologize for bothering you.
unfortunately no, metadata fields are modifiable at the moment. If you would like to see support for this feature, I'd suggest writing to https://support.stripe.com/?contact=true to explain your use case/feature request as that helps the product team capture demand for prioritisation
The only advice i can offer at this point in time is that you would probably need to be very careful about what roles you grant access to your Stripe Dashboard and which ones are able to edit the metadata
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Thank you so much for your help.
I'd like to ask you a final question.
Q10. Where can I adjust the permissions to edit metadata in the Stripe Dashboard?
Q11. Which permissions can edit metadata in the Stripe Dashboard?
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
Hi!
My team doesn't know much about such Dashboard-specific features. But I feel like it might not provide such level of granularity.
Okay thank you !