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

Creates Stripe-hosted Checkout sessions. More...

#include <Client.h>

Public Types

using CreateCompletion = std::function<void(CallbackResult<CheckoutSession>)>
 Completion callback for the callback form of create().

Public Member Functions

virtual ~CheckoutSessions ()=default
 Destroys the API instance.
virtual Task< CheckoutSession > create_async (const CreateCheckoutSessionRequest &request, const RequestOptions &options={})=0
 Creates a Checkout session.
virtual void create (const CreateCheckoutSessionRequest &request, const RequestOptions &options, CreateCompletion completion)=0
 Creates a Checkout session, reporting the result through a callback.

Detailed Description

Creates Stripe-hosted Checkout sessions.

Reach an instance through StripeClient::checkout(). Checkout is a payment page Stripe hosts: create a session, redirect the customer to CheckoutSession::url, and Stripe collects the card details.

See also
https://docs.stripe.com/api/checkout/sessions

Definition at line 223 of file Client.h.

Member Typedef Documentation

◆ CreateCompletion

Completion callback for the callback form of create().

Definition at line 226 of file Client.h.

Constructor & Destructor Documentation

◆ ~CheckoutSessions()

virtual stripekit::CheckoutSessions::~CheckoutSessions ( )
virtualdefault

Destroys the API instance.

Member Function Documentation

◆ create_async()

virtual Task< CheckoutSession > stripekit::CheckoutSessions::create_async ( const CreateCheckoutSessionRequest & request,
const RequestOptions & options = {} )
pure virtual

Creates a Checkout session.

Parameters
requestDetails of the session to create.
optionsPer-request settings. Set an idempotency key so a retry cannot start a second subscription.
Returns
A task producing the session, whose url is where the customer should be sent.
Exceptions
StripeApiExceptionStripe rejected the request.

◆ create()

virtual void stripekit::CheckoutSessions::create ( const CreateCheckoutSessionRequest & request,
const RequestOptions & options,
CreateCompletion completion )
pure virtual

Creates a Checkout session, reporting the result through a callback.

The callback is invoked exactly once, and may run on a different thread than the caller.

Parameters
requestDetails of the session to create.
optionsPer-request settings such as an idempotency key.
completionReceives the created session or the failure.

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