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

The entry point for talking to Stripe. More...

#include <Client.h>

Inheritance diagram for stripekit::StripeClient:
[legend]

Public Member Functions

virtual ~StripeClient ()=default
 Destroys the client instance.
virtual Customers & customers ()=0
 Returns the customer operations.
virtual Checkout & checkout ()=0
 Returns the Checkout operations.
virtual Subscriptions & subscriptions ()=0
 Returns the subscription operations.
virtual BillingPortal & billing_portal ()=0
 Returns the billing portal operations.

Detailed Description

The entry point for talking to Stripe.

Operations are grouped the way Stripe's own API reference groups them, so checkout().sessions().create_async() corresponds to Stripe's "Create a Checkout Session" endpoint.

Obtain one from an adapter's factory function, such as stripekit::drogon::make_stripe_client(). One client is enough for the whole application: it is safe to share across threads and reuses connections to Stripe, so creating one per request only adds latency.

auto stripe = stripekit::drogon::make_stripe_client({.api_key = "sk_test_..."});
const auto customer = co_await stripe->customers().create_async({.email = "a@b.com"});
std::unique_ptr< StripeClient > make_stripe_client(ClientOptions options)
Creates a Stripe client that talks through Drogon.
See also
Quickstart

Definition at line 455 of file Client.h.

Constructor & Destructor Documentation

◆ ~StripeClient()

virtual stripekit::StripeClient::~StripeClient ( )
virtualdefault

Destroys the client instance.

Member Function Documentation

◆ customers()

virtual Customers & stripekit::StripeClient::customers ( )
pure virtual

Returns the customer operations.

Returns
A reference owned by the client; it stays valid as long as the client does.

Implemented in stripekit::StripeApiClient.

◆ checkout()

virtual Checkout & stripekit::StripeClient::checkout ( )
pure virtual

Returns the Checkout operations.

Returns
A reference owned by the client; it stays valid as long as the client does.

Implemented in stripekit::StripeApiClient.

◆ subscriptions()

virtual Subscriptions & stripekit::StripeClient::subscriptions ( )
pure virtual

Returns the subscription operations.

Returns
A reference owned by the client; it stays valid as long as the client does.

Implemented in stripekit::StripeApiClient.

◆ billing_portal()

virtual BillingPortal & stripekit::StripeClient::billing_portal ( )
pure virtual

Returns the billing portal operations.

Returns
A reference owned by the client; it stays valid as long as the client does.

Implemented in stripekit::StripeApiClient.


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