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

Describes the Checkout session to create. More...

#include <Client.h>

Public Attributes

std::string customer_id
 Id of an existing Stripe customer to bill.
std::string mode = "subscription"
 Mode of the Checkout session: "subscription" or "payment".
std::string price_id
 Id of an existing Stripe Price.
std::string product_name
 Product name, for inline pricing.
std::string currency = "usd"
 ISO currency code for inline pricing, for example "usd".
std::int64_t unit_amount = 0
 Amount per unit for inline pricing, in the currency's smallest unit.
std::string recurring_interval = "month"
 Billing interval for inline pricing in subscription mode: "day", "week", "month", or "year".
std::string success_url
 Where Stripe sends the customer's browser after a successful checkout.
std::string cancel_url
 Where Stripe sends the customer's browser if they abandon checkout.
std::int64_t quantity = 1
 Number of units of the item to bill for.
std::unordered_map< std::string, std::string > metadata
 Free-form key/value pairs to store on the session.

Detailed Description

Describes the Checkout session to create.

StripeKit creates Checkout sessions for subscriptions (mode = "subscription") or one-time payments (mode = "payment"). Price the item one of two ways: set price_id to reuse a Price already configured in the Stripe dashboard, or leave it empty and fill in product_name, currency, unit_amount, and (for subscriptions) recurring_interval to define the price inline.

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

Definition at line 63 of file Client.h.

Member Data Documentation

◆ customer_id

std::string stripekit::CreateCheckoutSessionRequest::customer_id

Id of an existing Stripe customer to bill.

Optional for one-time payments.

Definition at line 65 of file Client.h.

◆ mode

std::string stripekit::CreateCheckoutSessionRequest::mode = "subscription"

Mode of the Checkout session: "subscription" or "payment".

Defaults to "subscription". Use "payment" for one-time purchases.

Definition at line 72 of file Client.h.

◆ price_id

std::string stripekit::CreateCheckoutSessionRequest::price_id

Id of an existing Stripe Price.

Leave empty to price the line item inline.

Definition at line 75 of file Client.h.

◆ product_name

std::string stripekit::CreateCheckoutSessionRequest::product_name

Product name, for inline pricing.

Ignored when price_id is set.

Definition at line 78 of file Client.h.

◆ currency

std::string stripekit::CreateCheckoutSessionRequest::currency = "usd"

ISO currency code for inline pricing, for example "usd".

Definition at line 81 of file Client.h.

◆ unit_amount

std::int64_t stripekit::CreateCheckoutSessionRequest::unit_amount = 0

Amount per unit for inline pricing, in the currency's smallest unit.

That means cents for USD, so 1499 is $14.99.

Definition at line 88 of file Client.h.

◆ recurring_interval

std::string stripekit::CreateCheckoutSessionRequest::recurring_interval = "month"

Billing interval for inline pricing in subscription mode: "day", "week", "month", or "year".

Ignored when mode is "payment".

Definition at line 95 of file Client.h.

◆ success_url

std::string stripekit::CreateCheckoutSessionRequest::success_url

Where Stripe sends the customer's browser after a successful checkout.

Reaching this URL is not proof of payment; the customer may close the tab first, and anyone can visit the URL directly. Grant access from the checkout.session.completed or invoice.paid webhook instead.

Definition at line 104 of file Client.h.

◆ cancel_url

std::string stripekit::CreateCheckoutSessionRequest::cancel_url

Where Stripe sends the customer's browser if they abandon checkout.

Definition at line 107 of file Client.h.

◆ quantity

std::int64_t stripekit::CreateCheckoutSessionRequest::quantity = 1

Number of units of the item to bill for.

Definition at line 110 of file Client.h.

◆ metadata

std::unordered_map<std::string, std::string> stripekit::CreateCheckoutSessionRequest::metadata

Free-form key/value pairs to store on the session.

Definition at line 113 of file Client.h.


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