StripeKit 0.1.1
Stripe integration toolkit for C++
Loading...
Searching...
No Matches
stripekit::EventDispatcher Class Referenceabstract

Handles verified webhook events, for applications using WebhookProcessor. More...

#include <Events.h>

Public Member Functions

virtual ~EventDispatcher ()=default
 Destroys the dispatcher instance.
virtual EventDispatchResult dispatch (const VerifiedEventSignal &signal)=0
 Handles one verified event.

Detailed Description

Handles verified webhook events, for applications using WebhookProcessor.

Implement this when webhook handling is better expressed as a class than as a callback; otherwise use stripekit::webhooks::EventHandler.

dispatch() is called after the signature has been checked and the event id claimed. Completed events are skipped; failed or interrupted attempts may run again, so make the handler safe to retry. It must return quickly, since Stripe treats a slow endpoint as a failed delivery.

Definition at line 62 of file Events.h.

Constructor & Destructor Documentation

◆ ~EventDispatcher()

virtual stripekit::EventDispatcher::~EventDispatcher ( )
virtualdefault

Destroys the dispatcher instance.

Member Function Documentation

◆ dispatch()

virtual EventDispatchResult stripekit::EventDispatcher::dispatch ( const VerifiedEventSignal & signal)
pure virtual

Handles one verified event.

Parameters
signalThe event and its delivery details.
Returns
What happened, which decides what Stripe is told. Returning EventDispatchResult::RetryableFailure asks Stripe to deliver again later.

The documentation for this class was generated from the following file: