CheckoutSession class final

Session

A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through [Checkout](https://stripe.com/docs/payments/checkout) or [Payment Links](https://stripe.com/docs/payments/payment-links). We recommend creating a new Session each time your customer attempts to pay. Once payment is successful, the Checkout Session will contain a reference to the [Customer](https://stripe.com/docs/api/customers), and either the successful [PaymentIntent](https://stripe.com/docs/api/payment_intents) or an active [Subscription](https://stripe.com/docs/api/subscriptions). You can create a Checkout Session on your server and redirect to its URL to begin Checkout. Related guide: [Checkout quickstart](https://stripe.com/docs/checkout/quickstart)

Implemented types

Constructors

CheckoutSession({CheckoutSessionAfterExpiration? afterExpiration, bool? allowPromotionCodes, int? amountSubtotal, int? amountTotal, required PaymentPagesCheckoutSessionAutomaticTax automaticTax, CheckoutSessionBillingAddressCollection? billingAddressCollection, String? cancelUrl, String? clientReferenceId, String? clientSecret, CheckoutSessionConsent? consent, CheckoutSessionConsentCollection? consentCollection, required DateTime created, String? currency, CheckoutSessionCurrencyConversion? currencyConversion, required List<PaymentPagesCheckoutSessionCustomFields> customFields, required PaymentPagesCheckoutSessionCustomText customText, BankAccountCustomerOrId? customer, CheckoutSessionCustomerCreation? customerCreation, CheckoutSessionCustomerDetails? customerDetails, String? customerEmail, required DateTime expiresAt, required String id, InvoiceOrId? invoice, CheckoutSessionInvoiceCreation? invoiceCreation, CheckoutSessionLineItems? lineItems, required bool livemode, CheckoutSessionLocale? locale, Map<String, String>? metadata, required CheckoutSessionMode mode, PaymentIntentOrId? paymentIntent, PaymentLinkOrId? paymentLink, CheckoutSessionCustomerCreation? paymentMethodCollection, CheckoutSessionPaymentMethodConfigurationDetails? paymentMethodConfigurationDetails, CheckoutSessionPaymentMethodOptions? paymentMethodOptions, required List<String> paymentMethodTypes, required CheckoutSessionPaymentStatus paymentStatus, PaymentPagesCheckoutSessionPhoneNumberCollection? phoneNumberCollection, String? recoveredFrom, CheckoutSessionRedirectOnCompletion? redirectOnCompletion, String? returnUrl, SetupIntentOrId? setupIntent, CheckoutSessionShippingAddressCollection? shippingAddressCollection, CheckoutSessionShippingCost? shippingCost, ChargeShipping? shippingDetails, required List<PaymentPagesCheckoutSessionShippingOption> shippingOptions, CheckoutSessionStatus? status, CheckoutSessionSubmitType? submitType, SubscriptionOrId? subscription, String? successUrl, PaymentPagesCheckoutSessionTaxIdCollection? taxIdCollection, CheckoutSessionTotalDetails? totalDetails, CheckoutSessionUiMode? uiMode, String? url})
Session
const
CheckoutSession.fromJson(Object? json)
factory

Properties

afterExpiration → CheckoutSessionAfterExpiration?
When set, provides configuration for actions to take if this Checkout Session expires.
final
allowPromotionCodes → bool?
final
amountSubtotal → int?
final
amountTotal → int?
final
automaticTax → PaymentPagesCheckoutSessionAutomaticTax
final
billingAddressCollection → CheckoutSessionBillingAddressCollection?
final
cancelUrl → String?
final
clientReferenceId → String?
final
clientSecret → String?
final
Results of `consent_collection` for this session.
final
consentCollection → CheckoutSessionConsentCollection?
When set, provides configuration for the Checkout Session to gather active consent from customers.
final
created → DateTime
final
currency → String?
final
currencyConversion → CheckoutSessionCurrencyConversion?
Currency conversion details for automatic currency conversion sessions
final
customer → BankAccountCustomerOrId?
final
customerCreation → CheckoutSessionCustomerCreation?
final
customerDetails → CheckoutSessionCustomerDetails?
The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions in `setup` mode.
final
customerEmail → String?
final
customFields → List<PaymentPagesCheckoutSessionCustomFields>
final
customText → PaymentPagesCheckoutSessionCustomText
final
expiresAt → DateTime
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
final
invoice → InvoiceOrId?
final
invoiceCreation → CheckoutSessionInvoiceCreation?
Details on the state of invoice creation for the Checkout Session.
final
lineItems → CheckoutSessionLineItems?
PaymentPagesCheckoutSessionListLineItems
final
livemode → bool
final
locale → CheckoutSessionLocale?
final
metadata → Map<String, String>?
final
mode → CheckoutSessionMode
final
object → String
The resource's type.
final
paymentIntent → PaymentIntentOrId?
final
final
paymentMethodCollection → CheckoutSessionCustomerCreation?
final
paymentMethodConfigurationDetails → CheckoutSessionPaymentMethodConfigurationDetails?
Information about the payment method configuration used for this Checkout session if using dynamic payment methods.
final
paymentMethodOptions → CheckoutSessionPaymentMethodOptions?
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
final
paymentMethodTypes → List<String>
final
paymentStatus → CheckoutSessionPaymentStatus
final
phoneNumberCollection → PaymentPagesCheckoutSessionPhoneNumberCollection?
final
recoveredFrom → String?
final
redirectOnCompletion → CheckoutSessionRedirectOnCompletion?
final
returnUrl → String?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
setupIntent → SetupIntentOrId?
final
shippingAddressCollection → CheckoutSessionShippingAddressCollection?
When set, provides configuration for Checkout to collect a shipping address from a customer.
final
shippingCost → CheckoutSessionShippingCost?
The details of the customer cost of shipping, including the customer chosen ShippingRate.
final
shippingDetails → ChargeShipping?
final
shippingOptions → List<PaymentPagesCheckoutSessionShippingOption>
final
status → CheckoutSessionStatus?
final
submitType → CheckoutSessionSubmitType?
final
subscription → SubscriptionOrId?
final
successUrl → String?
final
taxIdCollection → PaymentPagesCheckoutSessionTaxIdCollection?
final
totalDetails → CheckoutSessionTotalDetails?
Tax and discount details for the computed total amount.
final
uiMode → CheckoutSessionUiMode?
final
url → String?
final

Methods

encodeWith<V>(Encoder<V> encoder) → V
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
override
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

encode<V>(CheckoutSession instance, Encoder<V> encoder) → V