Stripe webhook account.updated never triggered, whenever an connected account status changes - stripe-payments

I have a Stripe Connect integration with custom account.
When I create a Custom account, the account status is "Restricted". Then I fill the onboarding form and it changes to "Complete" (ready for payments and payouts).
Even though I have a webhook setup for the account.updated event, it's never triggered.
Following Stripe documentation it should be triggered for all the connected account, whenever a status changes.
However, as we can see here, no event was triggered since one week:
Do you have an idea why? (please note that I'm in test mode right now)

Is your webhook endpoint a Connect webhook endpoint? There are 2 types. I would make sure this webhook endpoint was created as a Connect one. If it is and you've configured it for account.updated events, then I would reach out to Stripe's support to see what's going on.

Related

Testing Stripe webhooks that require data on localhost

The guide here says to monitor the invoice.paid event via webhook in order to provision a customers account when the payment is successful. How can I test fire the invoice.paid event with data? I need to be able to access the customer id and see what plan they purchased to provision it correctly.
I am able to test fire these events via the Stripe CLI, but I don't know how to fire them with mock data.
With the Stripe CLI you can trigger a invoice.payment_suceeded webhook event (which is almost exactly the same as invoice.paid):
stripe trigger invoice.payment_succeeded
That event will contain mock data. If you want to provide your own data, you'd have to mimic the event yourself. In that case you could do that by creating a new subscription in test mode, which will create an invoice and trigger the invoice.paid event.

At which stripe event should I update my db to grant subscriber access

I have a SaaS MERN app which is using Stripe for subscriptions. I'm using the new checkout feature of Stripe to handle all the payments. I have the stripe CLI installed to see the events that occur when a subscription is made. I have a few questions regarding the events that are emitted and how to handle them in my stripe webhook.
Which event below indicate that the payment was successful so that I can update my database.
Why is it that the payment_intent.succeeded occurs before payment_intent.created.
Why is a customer.subscription.updated event happening (I'm assuming it should just be the customer.subscription.created event that should occur on first purchase)
I use the customer.subscription.updated event in my webhook to allow customers to turn autoRenewal on and off. Because the customer.subscription.updated event is also shot off at initial payment when subscribing, how can I differentiate what to do as the same event is fired off in both cases.
This is not as important, but if anyone knows what that POST error is at the bottom, I would appreciate some insight. [EDIT] I fixed this by moving my res.status(200).json({received: true}) further up my code. Initially it was placed at the very end of my webhook, so I think it was timing out.
Thank you :)
If you specifically want to provision the subscription on successful payment, then you should listen for payment_intent.succeeded
Stripe doesn't guarantee the order of webhook events, it's possible to receive them out of order: https://stripe.com/docs/webhooks/best-practices#event-ordering
The subscription's status would be updated to show that the latest invoice was successfully paid, which triggers and update event
You probably want to use invoice.upcoming instead: https://stripe.com/docs/api/events/types?lang=java#event_types-invoice.upcoming
You'd have to debug this on your end to see where it came from. Looks like perhaps your local server wasn't running and so the Stripe CLI couldn't forward on the webhook event.

DocuSign webhook never retried

I am using the official DocuSign java client 3.2.0. I have set the envelope level notification as listed below. Say the webhook URL is https://A.
EventNotification eventNotification = new EventNotification();
eventNotification.setIncludeHMAC("true");
eventNotification.setIncludeDocuments("true");
eventNotification.setRequireAcknowledgment("true");
eventNotification.setUrl("https://A");
EnvelopeEvent envelopeEvent = new EnvelopeEvent();
envelopeEvent.setEnvelopeEventStatusCode("completed");
eventNotification.setEnvelopeEvents(Arrays.asList(envelopeEvent));
envelopeDefinition.setEventNotification(eventNotification);
I am trying to test the retry logic for this webhook. After few successful push requests, I intentionally made the service to return non 200 code (Example 404) for one of the request. Then I reverted the logic, so that the service continue to return 200 response for new requests.
I checked after more than 24 hours, the failed request was never retried.
Is there any reason why the request was never retried eventhough there were successful requests after the failure?
I also have a connect listener configured to push the complete notification for all the envelopes to webhook URL https://B
Currently we have come issue with this webhook URL, so all the push notification to https://B is getting failed.
Is the continuous failure with the https://B connect webhook stop retries to envelope level notification webhook https://A ?
Also Is there any difference between the connect retry vs envelope notification retries?
For for global account events (all users and envelopes) make sure "Require Acknowledgement" option is selected in your Connect settings for the specific webhook for the failed to be re-pushed.
Connect webhook is global (all users and envelopes) for the account and you can select when is triggered for example "Envelope Sent", "Envelope Voided" etc. In this way you can have multiple webhooks handling different account events.
In your case you are setting webhook notification only for the specified envelope.
Also this could help you
https://developers.docusign.com/docs/esign-rest-api/reference/Connect/ConnectEvents/
Connect retries at the account level for Aggregate Messages (the default) after 24 hours after a subsequent message is sent. I will ask about envelope-level connect retries.
Better is to switch to Send Intermediate Messages (SIM) queuing. It retries faster.
Best is to have a 100% always up listener (server). An easy and cheap (free) technique for this is to use AWS PaaS to receive and enqueue the messages. See blog post and sample code. We also have sample code for Google Cloud and Azure.

If I cancel user's subscription manually in Stripe dashboard, should a webhook endpoint I set up on my web server be notified of that?

I am currently in test mode with Stripe.
I cancelled a users subscription is Stripe dashboard, but the webhook I set up on my site's web server (which uses Laravel Cashier) does not fire i.e. the subscription data is unaffected on my site's web server.
I thought this should happen. The webhook is otherwise tested and working.
Whenever a subscription is canceled, the event customer.subscription.deleted will be generated on your account and sent to your webhook endpoint (assuming it listens for it). This is true whether the subscription is canceled automatically after too many failures, via the API or manually in the dashboard.
You can easily confirm this in the dashboard by looking at the Events section for your customer and see this event.
It's likely an issue in the configuration for your webhook or the code server-side with Cashier.
For testing: also make sure, that you set "cancel subscription immediately" instead of at the end of the billing period otherwise it won't fire instantly.
You could also test it with a test clock properly :)

Stripe: "charge.succeeded" webhook not firing for connected account. Wrong event type name?

I suppose that a fundamental question I really ought to be asking, before I get into the details below, might be:
As a vendor/service-provider with a standalone Stripe account that's been connected to a platform account, is it possible for me to set up a webhook that will be called when the platform makes a successful charge on my behalf?
In any case, that's what I'm trying to do, with a webhook that I set up on the recipient account, configured to be called for any of the following events:
Test invocations of the webhook from my dashboard cause it to fire as expected.
But when when I create a charge through the platform, setting destination to reference the connected account, the webhook doesn't fire -- even though the charge is successfully created, along with an accompanying event, in the connected account.
One big fat clue -- that I don't know how to interpret -- is that the type of the event shown in the dashboard's "Events & Webhooks" tab isn't charge.succeeded or charge.captured -- it's payment.created (!).
But:
there's no event type with that name listed in the webhook configuration menu;
nor, as far as I can tell, does the API define a payment object type (and indeed, the type of the object referenced in the event is charge):
So:
Is this just a naming glitch in the API implementation that Stripe simply needs to fix?
Or is there some more fundamental problem that I'm failing to grasp with the idea of setting a webhook on a connected standalone account that I own?
(Or am I just doin' it wrong?)
At the moment, the payment.created event is not visible in the list of selectable events, so you'd have to check "Send me all events" when creating the webhook endpoint in order to receive those.
extending Dmitry's comment in the post, I was able to solve it by adding my endpoint and webhook event type to Endpoints receiving events from your account section in the Stripe dashboard.
The other section called Endpoints receiving events from Connect applications is for events with a Connect Account associated with it. The event object will have an account property, as long as it is an event generated from a Connect Account. These events will go in the Endpoints receiving events from Connect applications section of the Webhooks page in the Dashboard.

Resources