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

Creates billing portal sessions. More...

#include <Client.h>

Public Types

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

Public Member Functions

virtual ~BillingPortalSessions ()=default
 Destroys the API instance.
virtual Task< BillingPortalSession > create_async (const CreateBillingPortalSessionRequest &request, const RequestOptions &options={})=0
 Creates a billing portal session.
virtual void create (const CreateBillingPortalSessionRequest &request, const RequestOptions &options, CreateCompletion completion)=0
 Creates a billing portal session, reporting the result through a callback.

Detailed Description

Creates billing portal sessions.

Reach an instance through StripeClient::billing_portal(). The billing portal is a Stripe-hosted page where customers update their card, download invoices, and cancel — which saves building any of that.

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

Definition at line 373 of file Client.h.

Member Typedef Documentation

◆ CreateCompletion

Completion callback for the callback form of create().

Definition at line 376 of file Client.h.

Constructor & Destructor Documentation

◆ ~BillingPortalSessions()

virtual stripekit::BillingPortalSessions::~BillingPortalSessions ( )
virtualdefault

Destroys the API instance.

Member Function Documentation

◆ create_async()

virtual Task< BillingPortalSession > stripekit::BillingPortalSessions::create_async ( const CreateBillingPortalSessionRequest & request,
const RequestOptions & options = {} )
pure virtual

Creates a billing portal session.

Sessions are short-lived, so create one per visit rather than storing the URL.

Parameters
requestThe customer to create the session for, and where to return them afterwards.
optionsPer-request settings such as a timeout.
Returns
A task producing the session, whose url is where the customer should be sent.
Exceptions
StripeApiExceptionStripe rejected the request. A common cause is the billing portal not yet being configured in the dashboard.

◆ create()

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

Creates a billing portal session, reporting the result through a callback.

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

Parameters
requestThe customer to create the session for, and where to return them afterwards.
optionsPer-request settings such as a timeout.
completionReceives the created session or the failure.

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