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

Per-call settings accepted by every client operation. More...

#include <RequestOptions.h>

Public Attributes

std::optional< std::string > idempotency_key
 Makes the call safe to retry.
std::optional< std::chrono::milliseconds > timeout
 Overrides the adapter's default timeout for this call.
std::unordered_map< std::string, std::string > headers
 Extra HTTP headers, merged over the adapter's defaults.

Detailed Description

Per-call settings accepted by every client operation.

options.idempotency_key = "checkout-for-order-1234";
options.timeout = std::chrono::seconds(30);
Per-call settings accepted by every client operation.
std::optional< std::string > idempotency_key
Makes the call safe to retry.
std::optional< std::chrono::milliseconds > timeout
Overrides the adapter's default timeout for this call.

Definition at line 30 of file RequestOptions.h.

Member Data Documentation

◆ idempotency_key

std::optional<std::string> stripekit::RequestOptions::idempotency_key

Makes the call safe to retry.

If a response is lost and the same key is sent again, Stripe returns the original result instead of performing the work twice. Set this on anything that creates or charges, and derive the key from something stable in the application, such as an order id.

See also
https://docs.stripe.com/api/idempotent_requests

Definition at line 41 of file RequestOptions.h.

◆ timeout

std::optional<std::chrono::milliseconds> stripekit::RequestOptions::timeout

Overrides the adapter's default timeout for this call.

Definition at line 46 of file RequestOptions.h.

◆ headers

std::unordered_map<std::string, std::string> stripekit::RequestOptions::headers

Extra HTTP headers, merged over the adapter's defaults.

Mostly useful for pinning "Stripe-Version" to a known API version.

Definition at line 53 of file RequestOptions.h.


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