StripeKit 0.1.1
Stripe integration toolkit for C++
Loading...
Searching...
No Matches
stripekit::webhooks Namespace Reference

Webhooks.h. More...

Classes

struct  ConstructEventOptions
 Tuning for construct_event(). More...
struct  ProcessEventOptions
 Tuning for process_event_once(). More...
struct  ProcessEventOnceResult
 What happened to a webhook delivery. More...

Typedefs

using Event = EventEnvelope
 A verified Stripe webhook event.
using ProcessResult = EventDispatchResult
 What a handler reports back about an event.
using EventHandler = std::function<Task<ProcessResult>(const Event&)>
 The application's webhook handler.

Functions

Event construct_event (std::string_view payload, std::string_view signature_header, std::string_view endpoint_secret, ConstructEventOptions options={})
 Checks that a webhook delivery really came from Stripe, and parses it.
Task< ProcessEventOnceResult > process_event_once (const Event &event, WebhookDedupStore &dedup_store, EventHandler handler, ProcessEventOptions options={})
 Runs the handler for an already-verified event unless it was already completed.
Task< ProcessEventOnceResult > process_event_once (std::string_view payload, std::string_view signature_header, std::string_view endpoint_secret, WebhookDedupStore &dedup_store, EventHandler handler, ProcessEventOptions options={})
 Verifies a webhook delivery and handles it unless it was already completed.

Detailed Description

Webhooks.h.

Stripe-style webhook construction and de-duplicated processing helpers.

Author
Hans de Ruiter
License:
See LICENSE for details.