pub struct CheckoutSession {Show 53 fields
pub id: CheckoutSessionId,
pub after_expiration: Option<PaymentPagesCheckoutSessionAfterExpiration>,
pub allow_promotion_codes: Option<bool>,
pub amount_subtotal: Option<i64>,
pub amount_total: Option<i64>,
pub automatic_tax: PaymentPagesCheckoutSessionAutomaticTax,
pub billing_address_collection: Option<CheckoutSessionBillingAddressCollection>,
pub cancel_url: Option<String>,
pub client_reference_id: Option<String>,
pub client_secret: Option<String>,
pub consent: Option<PaymentPagesCheckoutSessionConsent>,
pub consent_collection: Option<PaymentPagesCheckoutSessionConsentCollection>,
pub created: Timestamp,
pub currency: Option<Currency>,
pub currency_conversion: Option<PaymentPagesCheckoutSessionCurrencyConversion>,
pub custom_fields: Vec<PaymentPagesCheckoutSessionCustomFields>,
pub custom_text: PaymentPagesCheckoutSessionCustomText,
pub customer: Option<Expandable<Customer>>,
pub customer_creation: Option<CheckoutSessionCustomerCreation>,
pub customer_details: Option<PaymentPagesCheckoutSessionCustomerDetails>,
pub customer_email: Option<String>,
pub expires_at: Timestamp,
pub invoice: Option<Expandable<Invoice>>,
pub invoice_creation: Option<PaymentPagesCheckoutSessionInvoiceCreation>,
pub line_items: Option<List<CheckoutSessionItem>>,
pub livemode: bool,
pub locale: Option<CheckoutSessionLocale>,
pub metadata: Option<Metadata>,
pub mode: CheckoutSessionMode,
pub payment_intent: Option<Expandable<PaymentIntent>>,
pub payment_link: Option<Expandable<PaymentLink>>,
pub payment_method_collection: Option<CheckoutSessionPaymentMethodCollection>,
pub payment_method_configuration_details: Option<PaymentMethodConfigBizPaymentMethodConfigurationDetails>,
pub payment_method_options: Option<CheckoutSessionPaymentMethodOptions>,
pub payment_method_types: Vec<String>,
pub payment_status: CheckoutSessionPaymentStatus,
pub phone_number_collection: Option<PaymentPagesCheckoutSessionPhoneNumberCollection>,
pub recovered_from: Option<String>,
pub redirect_on_completion: Option<CheckoutSessionRedirectOnCompletion>,
pub return_url: Option<String>,
pub setup_intent: Option<Expandable<SetupIntent>>,
pub shipping_address_collection: Option<PaymentPagesCheckoutSessionShippingAddressCollection>,
pub shipping_cost: Option<PaymentPagesCheckoutSessionShippingCost>,
pub shipping_details: Option<Shipping>,
pub shipping_options: Vec<PaymentPagesCheckoutSessionShippingOption>,
pub status: Option<CheckoutSessionStatus>,
pub submit_type: Option<CheckoutSessionSubmitType>,
pub subscription: Option<Expandable<Subscription>>,
pub success_url: Option<String>,
pub tax_id_collection: Option<PaymentPagesCheckoutSessionTaxIdCollection>,
pub total_details: Option<PaymentPagesCheckoutSessionTotalDetails>,
pub ui_mode: Option<CheckoutSessionUiMode>,
pub url: Option<String>,
}
checkout
only.Expand description
The resource representing a Stripe “Session”.
For more details see https://stripe.com/docs/api/checkout/sessions/object
Fields§
§id: CheckoutSessionId
Unique identifier for the object.
after_expiration: Option<PaymentPagesCheckoutSessionAfterExpiration>
When set, provides configuration for actions to take if this Checkout Session expires.
allow_promotion_codes: Option<bool>
Enables user redeemable promotion codes.
amount_subtotal: Option<i64>
Total of all items before discounts or taxes are applied.
amount_total: Option<i64>
Total of all items after discounts and taxes are applied.
automatic_tax: PaymentPagesCheckoutSessionAutomaticTax
§billing_address_collection: Option<CheckoutSessionBillingAddressCollection>
Describes whether Checkout should collect the customer’s billing address.
cancel_url: Option<String>
If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.
client_reference_id: Option<String>
A unique string to reference the Checkout Session.
This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems.
client_secret: Option<String>
Client secret to be used when initializing Stripe.js embedded checkout.
consent: Option<PaymentPagesCheckoutSessionConsent>
Results of consent_collection
for this session.
consent_collection: Option<PaymentPagesCheckoutSessionConsentCollection>
When set, provides configuration for the Checkout Session to gather active consent from customers.
created: Timestamp
Time at which the object was created.
Measured in seconds since the Unix epoch.
currency: Option<Currency>
Three-letter ISO currency code, in lowercase.
Must be a supported currency.
currency_conversion: Option<PaymentPagesCheckoutSessionCurrencyConversion>
Currency conversion details for automatic currency conversion sessions.
custom_fields: Vec<PaymentPagesCheckoutSessionCustomFields>
Collect additional information from your customer using custom fields.
Up to 3 fields are supported.
custom_text: PaymentPagesCheckoutSessionCustomText
§customer: Option<Expandable<Customer>>
The ID of the customer for this Session.
For Checkout Sessions in subscription
mode or Checkout Sessions with customer_creation
set as always
in payment
mode, Checkout
will create a new customer object based on information provided
during the payment flow unless an existing customer was provided when
the Session was created.
customer_creation: Option<CheckoutSessionCustomerCreation>
Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
customer_details: Option<PaymentPagesCheckoutSessionCustomerDetails>
The customer details including the customer’s tax exempt status and the customer’s tax IDs.
Only the customer’s email is present on Sessions in setup
mode.
customer_email: Option<String>
If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file.
To access information about the customer once the payment flow is complete, use the customer
attribute.
expires_at: Timestamp
The timestamp at which the Checkout Session will expire.
invoice: Option<Expandable<Invoice>>
ID of the invoice created by the Checkout Session, if it exists.
invoice_creation: Option<PaymentPagesCheckoutSessionInvoiceCreation>
Details on the state of invoice creation for the Checkout Session.
line_items: Option<List<CheckoutSessionItem>>
The line items purchased by the customer.
livemode: bool
Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
locale: Option<CheckoutSessionLocale>
The IETF language tag of the locale Checkout is displayed in.
If blank or auto
, the browser’s locale is used.
metadata: Option<Metadata>
Set of key-value pairs that you can attach to an object.
This can be useful for storing additional information about the object in a structured format.
mode: CheckoutSessionMode
The mode of the Checkout Session.
payment_intent: Option<Expandable<PaymentIntent>>
The ID of the PaymentIntent for Checkout Sessions in payment
mode.
payment_link: Option<Expandable<PaymentLink>>
The ID of the Payment Link that created this Session.
payment_method_collection: Option<CheckoutSessionPaymentMethodCollection>
Configure whether a Checkout Session should collect a payment method.
payment_method_configuration_details: Option<PaymentMethodConfigBizPaymentMethodConfigurationDetails>
Information about the payment method configuration used for this Checkout session if using dynamic payment methods.
payment_method_options: Option<CheckoutSessionPaymentMethodOptions>
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
payment_method_types: Vec<String>
A list of the types of payment methods (e.g.
card) this Checkout Session is allowed to accept.
payment_status: CheckoutSessionPaymentStatus
The payment status of the Checkout Session, one of paid
, unpaid
, or no_payment_required
.
You can use this value to decide when to fulfill your customer’s order.
phone_number_collection: Option<PaymentPagesCheckoutSessionPhoneNumberCollection>
§recovered_from: Option<String>
The ID of the original expired Checkout Session that triggered the recovery flow.
redirect_on_completion: Option<CheckoutSessionRedirectOnCompletion>
Applies to Checkout Sessions with ui_mode: embedded
.
By default, Stripe will always redirect to your return_url after a successful confirmation.
If you set redirect_on_completion: 'if_required'
, then we will only redirect if your user chooses a redirect-based payment method.
return_url: Option<String>
Applies to Checkout Sessions with ui_mode: embedded
.
The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site.
setup_intent: Option<Expandable<SetupIntent>>
The ID of the SetupIntent for Checkout Sessions in setup
mode.
shipping_address_collection: Option<PaymentPagesCheckoutSessionShippingAddressCollection>
When set, provides configuration for Checkout to collect a shipping address from a customer.
shipping_cost: Option<PaymentPagesCheckoutSessionShippingCost>
The details of the customer cost of shipping, including the customer chosen ShippingRate.
shipping_details: Option<Shipping>
Shipping information for this Checkout Session.
shipping_options: Vec<PaymentPagesCheckoutSessionShippingOption>
The shipping rate options applied to this Session.
status: Option<CheckoutSessionStatus>
The status of the Checkout Session, one of open
, complete
, or expired
.
submit_type: Option<CheckoutSessionSubmitType>
Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.
submit_type
can only be specified on Checkout Sessions in payment
mode.
If blank or auto
, pay
is used.
subscription: Option<Expandable<Subscription>>
The ID of the subscription for Checkout Sessions in subscription
mode.
success_url: Option<String>
The URL the customer will be directed to after the payment or subscription creation is successful.
tax_id_collection: Option<PaymentPagesCheckoutSessionTaxIdCollection>
§total_details: Option<PaymentPagesCheckoutSessionTotalDetails>
Tax and discount details for the computed total amount.
ui_mode: Option<CheckoutSessionUiMode>
The UI mode of the Session.
Can be hosted
(default) or embedded
.
url: Option<String>
The URL to the Checkout Session.
Redirect customers to this URL to take them to Checkout.
If you’re using Custom Domains, the URL will use your subdomain.
Otherwise, it’ll use checkout.stripe.com.
This value is only present when the session is active.
Implementations§
Source§impl CheckoutSession
impl CheckoutSession
Sourcepub fn list(
client: &Client,
params: &ListCheckoutSessions<'_>,
) -> Response<List<CheckoutSession>>
pub fn list( client: &Client, params: &ListCheckoutSessions<'_>, ) -> Response<List<CheckoutSession>>
Returns a list of Checkout Sessions.
Sourcepub fn create(
client: &Client,
params: CreateCheckoutSession<'_>,
) -> Response<CheckoutSession>
pub fn create( client: &Client, params: CreateCheckoutSession<'_>, ) -> Response<CheckoutSession>
Creates a Session object.
Source§impl CheckoutSession
impl CheckoutSession
Sourcepub fn retrieve(
client: &Client,
id: &CheckoutSessionId,
expand: &[&str],
) -> Response<CheckoutSession>
pub fn retrieve( client: &Client, id: &CheckoutSessionId, expand: &[&str], ) -> Response<CheckoutSession>
Retrieves a Session object.
For more details see https://stripe.com/docs/api/checkout/sessions/retrieve.
Sourcepub fn expire(
client: &Client,
id: &CheckoutSessionId,
) -> Response<CheckoutSession>
pub fn expire( client: &Client, id: &CheckoutSessionId, ) -> Response<CheckoutSession>
Expires a checkout session.
For more details see https://stripe.com/docs/api/checkout/sessions/expire.
Sourcepub fn retrieve_line_items(
client: &Client,
id: &CheckoutSessionId,
params: &RetrieveCheckoutSessionLineItems,
) -> Response<List<CheckoutSessionItem>>
pub fn retrieve_line_items( client: &Client, id: &CheckoutSessionId, params: &RetrieveCheckoutSessionLineItems, ) -> Response<List<CheckoutSessionItem>>
Retrieves a Checkout Session’s line items
For more details see https://docs.stripe.com/api/checkout/sessions/line_items
Trait Implementations§
Source§impl Clone for CheckoutSession
impl Clone for CheckoutSession
Source§fn clone(&self) -> CheckoutSession
fn clone(&self) -> CheckoutSession
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more