|
StripeKit 0.1.1
Stripe integration toolkit for C++
|
The adapter for the Drogon web framework. More...
Classes | |
| struct | stripekit::drogon::EventLoopOptions |
| Chooses which event loop outbound Stripe requests run on. More... | |
| struct | stripekit::drogon::ClientOptions |
| Settings for make_stripe_client(). More... | |
| struct | stripekit::drogon::WebhookHandlerOptions |
| Settings for register_webhook_handler(). More... | |
| class | stripekit::drogon::HTTPClient |
| Sends Stripe API requests through Drogon's HTTP client. More... | |
| class | stripekit::drogon::WebhookEndpoint |
| A Drogon route that receives Stripe webhook deliveries. More... | |
| class | stripekit::drogon::LogBridge |
| Sends StripeKit's log entries through Drogon's logging. More... | |
Functions | |
| std::unique_ptr< StripeClient > | stripekit::drogon::make_stripe_client (ClientOptions options) |
| Creates a Stripe client that talks through Drogon. | |
| void | stripekit::drogon::register_webhook_handler (WebhookHandlerOptions options) |
| Adds a Stripe webhook route to the Drogon application. | |
The adapter for the Drogon web framework.
| std::unique_ptr< StripeClient > stripekit::drogon::make_stripe_client | ( | ClientOptions | options | ) |
Creates a Stripe client that talks through Drogon.
This is the usual way to get a stripekit::StripeClient in a Drogon application. One client is enough for the whole application: it is safe to share across threads and reuses connections to Stripe.
| options | The API key, and optionally the base URL and event loop. |
| ConfigurationException | The API key is missing, or the requested event loop is not available. |
| void stripekit::drogon::register_webhook_handler | ( | WebhookHandlerOptions | options | ) |
Adds a Stripe webhook route to the Drogon application.
The route verifies Stripe's signature, reserves the event id in the store, and only then calls the handler. Completed events are skipped; failed or interrupted attempts may run again, so the handler must be safe to retry. Replies 200 when handled or already handled, 500 on handler or store failures, and 400 when the signature does not check out.
Call this before Drogon starts running.
| options | The route, signing secret, store, and handler. The store must outlive the running application. |