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

The StripeClient implementation, built on any HTTPClient. More...

#include <StripeApiClient.h>

Inheritance diagram for stripekit::StripeApiClient:
[legend]

Public Member Functions

 StripeApiClient (HTTPClient &http_client)
 Creates a client that decodes responses with JsonCpp.
 StripeApiClient (HTTPClient &http_client, const StripeResponseParser &response_parser)
 Creates a client that decodes responses with a parser of your own.
 ~StripeApiClient () override
 Destroys the client and its operation groups.
 StripeApiClient (const StripeApiClient &)=delete
StripeApiClient & operator= (const StripeApiClient &)=delete
Customers & customers () override
 Returns the customer operations.
Checkout & checkout () override
 Returns the Checkout operations.
Subscriptions & subscriptions () override
 Returns the subscription operations.
BillingPortal & billing_portal () override
 Returns the billing portal operations.
Public Member Functions inherited from stripekit::StripeClient
virtual ~StripeClient ()=default
 Destroys the client instance.

Detailed Description

The StripeClient implementation, built on any HTTPClient.

This is what turns an adapter's transport into a working Stripe client: it builds the requests, sends them through the supplied HTTPClient, parses the responses, and raises StripeApiException on failure. An adapter's factory function constructs one of these, so applications rarely need to.

Construct it directly when you need to supply a custom response parser:

stripekit::drogon::HTTPClient http_client("sk_test_...");
stripekit::StripeApiClient stripe(http_client, custom_parser);
The StripeClient implementation, built on any HTTPClient.
Sends Stripe API requests through Drogon's HTTP client.
Definition Drogon.h:143

The HTTP client and parser are referenced, not owned, so both must outlive the client. Safe to use from several threads.

Definition at line 160 of file StripeApiClient.h.

Constructor & Destructor Documentation

◆ StripeApiClient() [1/2]

stripekit::StripeApiClient::StripeApiClient ( HTTPClient & http_client)
explicit

Creates a client that decodes responses with JsonCpp.

Parameters
http_clientTransport to send requests through. Must outlive the client.

◆ StripeApiClient() [2/2]

stripekit::StripeApiClient::StripeApiClient ( HTTPClient & http_client,
const StripeResponseParser & response_parser )

Creates a client that decodes responses with a parser of your own.

Parameters
http_clientTransport to send requests through. Must outlive the client.
response_parserDecoder for Stripe's responses. Must outlive the client.

◆ ~StripeApiClient()

stripekit::StripeApiClient::~StripeApiClient ( )
override

Destroys the client and its operation groups.

Member Function Documentation

◆ customers()

Customers & stripekit::StripeApiClient::customers ( )
overridevirtual

Returns the customer operations.

Returns
A reference valid for the lifetime of this client.

Implements stripekit::StripeClient.

◆ checkout()

Checkout & stripekit::StripeApiClient::checkout ( )
overridevirtual

Returns the Checkout operations.

Returns
A reference valid for the lifetime of this client.

Implements stripekit::StripeClient.

◆ subscriptions()

Subscriptions & stripekit::StripeApiClient::subscriptions ( )
overridevirtual

Returns the subscription operations.

Returns
A reference valid for the lifetime of this client.

Implements stripekit::StripeClient.

◆ billing_portal()

BillingPortal & stripekit::StripeApiClient::billing_portal ( )
overridevirtual

Returns the billing portal operations.

Returns
A reference valid for the lifetime of this client.

Implements stripekit::StripeClient.


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