Class: Stripe::Checkout::Session
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Checkout::Session
- Extended by:
- APIOperations::Create, APIOperations::List
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/checkout/session.rb
Overview
A Checkout Session represents your customer’s session as they pay for one-time purchases or subscriptions through [Checkout](docs.stripe.com/payments/checkout) or [Payment Links](docs.stripe.com/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](docs.stripe.com/api/customers), and either the successful [PaymentIntent](docs.stripe.com/api/payment_intents) or an active [Subscription](docs.stripe.com/api/subscriptions).
You can create a Checkout Session on your server and redirect to its URL to begin Checkout.
Related guide: [Checkout quickstart](docs.stripe.com/checkout/quickstart)
Defined Under Namespace
Classes: AdaptivePricing, AfterExpiration, AutomaticTax, BrandingSettings, CollectedInformation, Consent, ConsentCollection, CurrencyConversion, CustomField, CustomText, CustomerDetails, Discount, InvoiceCreation, NameCollection, OptionalItem, PaymentMethodConfigurationDetails, PaymentMethodOptions, Permissions, PhoneNumberCollection, PresentmentDetails, SavedPaymentMethodOptions, ShippingAddressCollection, ShippingCost, ShippingOption, TaxIdCollection, TotalDetails, WalletOptions
Constant Summary collapse
- OBJECT_NAME =
"checkout.session"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#adaptive_pricing ⇒ Object
readonly
Settings for price localization with [Adaptive Pricing](docs.stripe.com/payments/checkout/adaptive-pricing).
-
#after_expiration ⇒ Object
readonly
When set, provides configuration for actions to take if this Checkout Session expires.
-
#allow_promotion_codes ⇒ Object
readonly
Enables user redeemable promotion codes.
-
#amount_subtotal ⇒ Object
readonly
Total of all items before discounts or taxes are applied.
-
#amount_total ⇒ Object
readonly
Total of all items after discounts and taxes are applied.
-
#automatic_tax ⇒ Object
readonly
Attribute for field automatic_tax.
-
#billing_address_collection ⇒ Object
readonly
Describes whether Checkout should collect the customer’s billing address.
-
#branding_settings ⇒ Object
readonly
Attribute for field branding_settings.
-
#cancel_url ⇒ Object
readonly
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 ⇒ Object
readonly
A unique string to reference the Checkout Session.
-
#client_secret ⇒ Object
readonly
The client secret of your Checkout Session.
-
#collected_information ⇒ Object
readonly
Information about the customer collected within the Checkout Session.
-
#consent ⇒ Object
readonly
Results of ‘consent_collection` for this session.
-
#consent_collection ⇒ Object
readonly
When set, provides configuration for the Checkout Session to gather active consent from customers.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#currency ⇒ Object
readonly
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase.
-
#currency_conversion ⇒ Object
readonly
Currency conversion details for [Adaptive Pricing](docs.stripe.com/payments/checkout/adaptive-pricing) sessions created before 2025-03-31.
-
#custom_fields ⇒ Object
readonly
Collect additional information from your customer using custom fields.
-
#custom_text ⇒ Object
readonly
Attribute for field custom_text.
-
#customer ⇒ Object
readonly
The ID of the customer for this Session.
-
#customer_account ⇒ Object
readonly
The ID of the account for this Session.
-
#customer_creation ⇒ Object
readonly
Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
-
#customer_details ⇒ Object
readonly
The customer details including the customer’s tax exempt status and the customer’s tax IDs.
-
#customer_email ⇒ Object
readonly
If provided, this value will be used when the Customer object is created.
-
#discounts ⇒ Object
readonly
List of coupons and promotion codes attached to the Checkout Session.
-
#excluded_payment_method_types ⇒ Object
readonly
A list of the types of payment methods (e.g., ‘card`) that should be excluded from this Checkout Session.
-
#expires_at ⇒ Object
readonly
The timestamp at which the Checkout Session will expire.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#invoice ⇒ Object
readonly
ID of the invoice created by the Checkout Session, if it exists.
-
#invoice_creation ⇒ Object
readonly
Details on the state of invoice creation for the Checkout Session.
-
#line_items ⇒ Object
readonly
The line items purchased by the customer.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#locale ⇒ Object
readonly
The IETF language tag of the locale Checkout is displayed in.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object.
-
#mode ⇒ Object
readonly
The mode of the Checkout Session.
-
#name_collection ⇒ Object
readonly
Attribute for field name_collection.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#optional_items ⇒ Object
readonly
The optional items presented to the customer at checkout.
-
#origin_context ⇒ Object
readonly
Where the user is coming from.
-
#payment_intent ⇒ Object
readonly
The ID of the PaymentIntent for Checkout Sessions in ‘payment` mode.
-
#payment_link ⇒ Object
readonly
The ID of the Payment Link that created this Session.
-
#payment_method_collection ⇒ Object
readonly
Configure whether a Checkout Session should collect a payment method.
-
#payment_method_configuration_details ⇒ Object
readonly
Information about the payment method configuration used for this Checkout session if using dynamic payment methods.
-
#payment_method_options ⇒ Object
readonly
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
-
#payment_method_types ⇒ Object
readonly
A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
-
#payment_status ⇒ Object
readonly
The payment status of the Checkout Session, one of ‘paid`, `unpaid`, or `no_payment_required`.
-
#permissions ⇒ Object
readonly
This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object.
-
#phone_number_collection ⇒ Object
readonly
Attribute for field phone_number_collection.
-
#presentment_details ⇒ Object
readonly
Attribute for field presentment_details.
-
#recovered_from ⇒ Object
readonly
The ID of the original expired Checkout Session that triggered the recovery flow.
-
#redirect_on_completion ⇒ Object
readonly
This parameter applies to ‘ui_mode: embedded`.
-
#return_url ⇒ Object
readonly
Applies to Checkout Sessions with ‘ui_mode: embedded` or `ui_mode: custom`.
-
#saved_payment_method_options ⇒ Object
readonly
Controls saved payment method settings for the session.
-
#setup_intent ⇒ Object
readonly
The ID of the SetupIntent for Checkout Sessions in ‘setup` mode.
-
#shipping_address_collection ⇒ Object
readonly
When set, provides configuration for Checkout to collect a shipping address from a customer.
-
#shipping_cost ⇒ Object
readonly
The details of the customer cost of shipping, including the customer chosen ShippingRate.
-
#shipping_options ⇒ Object
readonly
The shipping rate options applied to this Session.
-
#status ⇒ Object
readonly
The status of the Checkout Session, one of ‘open`, `complete`, or `expired`.
-
#submit_type ⇒ Object
readonly
Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.
-
#subscription ⇒ Object
readonly
The ID of the [Subscription](docs.stripe.com/api/subscriptions) for Checkout Sessions in ‘subscription` mode.
-
#success_url ⇒ Object
readonly
The URL the customer will be directed to after the payment or subscription creation is successful.
-
#tax_id_collection ⇒ Object
readonly
Attribute for field tax_id_collection.
-
#total_details ⇒ Object
readonly
Tax and discount details for the computed total amount.
-
#ui_mode ⇒ Object
readonly
The UI mode of the Session.
-
#url ⇒ Object
readonly
The URL to the Checkout Session.
-
#wallet_options ⇒ Object
readonly
Wallet-specific configuration for this Checkout Session.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.create(params = {}, opts = {}) ⇒ Object
Creates a Checkout Session object.
-
.expire(session, params = {}, opts = {}) ⇒ Object
A Checkout Session can be expired when it is in one of these statuses: open.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of Checkout Sessions.
-
.list_line_items(session, params = {}, opts = {}) ⇒ Object
When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.
- .object_name ⇒ Object
-
.update(session, params = {}, opts = {}) ⇒ Object
Updates a Checkout Session object.
Instance Method Summary collapse
-
#expire(params = {}, opts = {}) ⇒ Object
A Checkout Session can be expired when it is in one of these statuses: open.
-
#list_line_items(params = {}, opts = {}) ⇒ Object
When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items.
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::Save
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#adaptive_pricing ⇒ Object (readonly)
Settings for price localization with [Adaptive Pricing](docs.stripe.com/payments/checkout/adaptive-pricing).
2113 2114 2115 |
# File 'lib/stripe/resources/checkout/session.rb', line 2113 def adaptive_pricing @adaptive_pricing end |
#after_expiration ⇒ Object (readonly)
When set, provides configuration for actions to take if this Checkout Session expires.
2115 2116 2117 |
# File 'lib/stripe/resources/checkout/session.rb', line 2115 def after_expiration @after_expiration end |
#allow_promotion_codes ⇒ Object (readonly)
Enables user redeemable promotion codes.
2117 2118 2119 |
# File 'lib/stripe/resources/checkout/session.rb', line 2117 def allow_promotion_codes @allow_promotion_codes end |
#amount_subtotal ⇒ Object (readonly)
Total of all items before discounts or taxes are applied.
2119 2120 2121 |
# File 'lib/stripe/resources/checkout/session.rb', line 2119 def amount_subtotal @amount_subtotal end |
#amount_total ⇒ Object (readonly)
Total of all items after discounts and taxes are applied.
2121 2122 2123 |
# File 'lib/stripe/resources/checkout/session.rb', line 2121 def amount_total @amount_total end |
#automatic_tax ⇒ Object (readonly)
Attribute for field automatic_tax
2123 2124 2125 |
# File 'lib/stripe/resources/checkout/session.rb', line 2123 def automatic_tax @automatic_tax end |
#billing_address_collection ⇒ Object (readonly)
Describes whether Checkout should collect the customer’s billing address. Defaults to ‘auto`.
2125 2126 2127 |
# File 'lib/stripe/resources/checkout/session.rb', line 2125 def billing_address_collection @billing_address_collection end |
#branding_settings ⇒ Object (readonly)
Attribute for field branding_settings
2127 2128 2129 |
# File 'lib/stripe/resources/checkout/session.rb', line 2127 def branding_settings @branding_settings end |
#cancel_url ⇒ Object (readonly)
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.
2129 2130 2131 |
# File 'lib/stripe/resources/checkout/session.rb', line 2129 def cancel_url @cancel_url end |
#client_reference_id ⇒ Object (readonly)
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.
2133 2134 2135 |
# File 'lib/stripe/resources/checkout/session.rb', line 2133 def client_reference_id @client_reference_id end |
#client_secret ⇒ Object (readonly)
The client secret of your Checkout Session. Applies to Checkout Sessions with ‘ui_mode: embedded` or `ui_mode: custom`. For `ui_mode: embedded`, the client secret is to be used when initializing Stripe.js embedded checkout.
For `ui_mode: custom`, use the client secret with [initCheckout](https://docs.stripe.com/js/custom_checkout/init) on your front end.
2136 2137 2138 |
# File 'lib/stripe/resources/checkout/session.rb', line 2136 def client_secret @client_secret end |
#collected_information ⇒ Object (readonly)
Information about the customer collected within the Checkout Session.
2138 2139 2140 |
# File 'lib/stripe/resources/checkout/session.rb', line 2138 def collected_information @collected_information end |
#consent ⇒ Object (readonly)
Results of ‘consent_collection` for this session.
2140 2141 2142 |
# File 'lib/stripe/resources/checkout/session.rb', line 2140 def end |
#consent_collection ⇒ Object (readonly)
When set, provides configuration for the Checkout Session to gather active consent from customers.
2142 2143 2144 |
# File 'lib/stripe/resources/checkout/session.rb', line 2142 def end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
2144 2145 2146 |
# File 'lib/stripe/resources/checkout/session.rb', line 2144 def created @created end |
#currency ⇒ Object (readonly)
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).
2146 2147 2148 |
# File 'lib/stripe/resources/checkout/session.rb', line 2146 def currency @currency end |
#currency_conversion ⇒ Object (readonly)
Currency conversion details for [Adaptive Pricing](docs.stripe.com/payments/checkout/adaptive-pricing) sessions created before 2025-03-31.
2148 2149 2150 |
# File 'lib/stripe/resources/checkout/session.rb', line 2148 def currency_conversion @currency_conversion end |
#custom_fields ⇒ Object (readonly)
Collect additional information from your customer using custom fields. Up to 3 fields are supported.
2150 2151 2152 |
# File 'lib/stripe/resources/checkout/session.rb', line 2150 def custom_fields @custom_fields end |
#custom_text ⇒ Object (readonly)
Attribute for field custom_text
2152 2153 2154 |
# File 'lib/stripe/resources/checkout/session.rb', line 2152 def custom_text @custom_text end |
#customer ⇒ Object (readonly)
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.
2158 2159 2160 |
# File 'lib/stripe/resources/checkout/session.rb', line 2158 def customer @customer end |
#customer_account ⇒ Object (readonly)
The ID of the account for this Session.
2160 2161 2162 |
# File 'lib/stripe/resources/checkout/session.rb', line 2160 def customer_account @customer_account end |
#customer_creation ⇒ Object (readonly)
Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
2162 2163 2164 |
# File 'lib/stripe/resources/checkout/session.rb', line 2162 def customer_creation @customer_creation end |
#customer_details ⇒ Object (readonly)
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.
2164 2165 2166 |
# File 'lib/stripe/resources/checkout/session.rb', line 2164 def customer_details @customer_details end |
#customer_email ⇒ Object (readonly)
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.
2170 2171 2172 |
# File 'lib/stripe/resources/checkout/session.rb', line 2170 def customer_email @customer_email end |
#discounts ⇒ Object (readonly)
List of coupons and promotion codes attached to the Checkout Session.
2172 2173 2174 |
# File 'lib/stripe/resources/checkout/session.rb', line 2172 def discounts @discounts end |
#excluded_payment_method_types ⇒ Object (readonly)
A list of the types of payment methods (e.g., ‘card`) that should be excluded from this Checkout Session. This should only be used when payment methods for this Checkout Session are managed through the [Stripe Dashboard](dashboard.stripe.com/settings/payment_methods).
2174 2175 2176 |
# File 'lib/stripe/resources/checkout/session.rb', line 2174 def excluded_payment_method_types @excluded_payment_method_types end |
#expires_at ⇒ Object (readonly)
The timestamp at which the Checkout Session will expire.
2176 2177 2178 |
# File 'lib/stripe/resources/checkout/session.rb', line 2176 def expires_at @expires_at end |
#id ⇒ Object (readonly)
Unique identifier for the object.
2178 2179 2180 |
# File 'lib/stripe/resources/checkout/session.rb', line 2178 def id @id end |
#invoice ⇒ Object (readonly)
ID of the invoice created by the Checkout Session, if it exists.
2180 2181 2182 |
# File 'lib/stripe/resources/checkout/session.rb', line 2180 def invoice @invoice end |
#invoice_creation ⇒ Object (readonly)
Details on the state of invoice creation for the Checkout Session.
2182 2183 2184 |
# File 'lib/stripe/resources/checkout/session.rb', line 2182 def invoice_creation @invoice_creation end |
#line_items ⇒ Object (readonly)
The line items purchased by the customer.
2184 2185 2186 |
# File 'lib/stripe/resources/checkout/session.rb', line 2184 def line_items @line_items end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
2186 2187 2188 |
# File 'lib/stripe/resources/checkout/session.rb', line 2186 def livemode @livemode end |
#locale ⇒ Object (readonly)
The IETF language tag of the locale Checkout is displayed in. If blank or ‘auto`, the browser’s locale is used.
2188 2189 2190 |
# File 'lib/stripe/resources/checkout/session.rb', line 2188 def locale @locale end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
2190 2191 2192 |
# File 'lib/stripe/resources/checkout/session.rb', line 2190 def end |
#mode ⇒ Object (readonly)
The mode of the Checkout Session.
2192 2193 2194 |
# File 'lib/stripe/resources/checkout/session.rb', line 2192 def mode @mode end |
#name_collection ⇒ Object (readonly)
Attribute for field name_collection
2194 2195 2196 |
# File 'lib/stripe/resources/checkout/session.rb', line 2194 def name_collection @name_collection end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
2196 2197 2198 |
# File 'lib/stripe/resources/checkout/session.rb', line 2196 def object @object end |
#optional_items ⇒ Object (readonly)
The optional items presented to the customer at checkout.
2198 2199 2200 |
# File 'lib/stripe/resources/checkout/session.rb', line 2198 def optional_items @optional_items end |
#origin_context ⇒ Object (readonly)
Where the user is coming from. This informs the optimizations that are applied to the session.
2200 2201 2202 |
# File 'lib/stripe/resources/checkout/session.rb', line 2200 def origin_context @origin_context end |
#payment_intent ⇒ Object (readonly)
The ID of the PaymentIntent for Checkout Sessions in ‘payment` mode. You can’t confirm or cancel the PaymentIntent for a Checkout Session. To cancel, [expire the Checkout Session](docs.stripe.com/api/checkout/sessions/expire) instead.
2202 2203 2204 |
# File 'lib/stripe/resources/checkout/session.rb', line 2202 def payment_intent @payment_intent end |
#payment_link ⇒ Object (readonly)
The ID of the Payment Link that created this Session.
2204 2205 2206 |
# File 'lib/stripe/resources/checkout/session.rb', line 2204 def payment_link @payment_link end |
#payment_method_collection ⇒ Object (readonly)
Configure whether a Checkout Session should collect a payment method. Defaults to ‘always`.
2206 2207 2208 |
# File 'lib/stripe/resources/checkout/session.rb', line 2206 def payment_method_collection @payment_method_collection end |
#payment_method_configuration_details ⇒ Object (readonly)
Information about the payment method configuration used for this Checkout session if using dynamic payment methods.
2208 2209 2210 |
# File 'lib/stripe/resources/checkout/session.rb', line 2208 def payment_method_configuration_details @payment_method_configuration_details end |
#payment_method_options ⇒ Object (readonly)
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
2210 2211 2212 |
# File 'lib/stripe/resources/checkout/session.rb', line 2210 def end |
#payment_method_types ⇒ Object (readonly)
A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
2213 2214 2215 |
# File 'lib/stripe/resources/checkout/session.rb', line 2213 def payment_method_types @payment_method_types end |
#payment_status ⇒ Object (readonly)
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.
2216 2217 2218 |
# File 'lib/stripe/resources/checkout/session.rb', line 2216 def payment_status @payment_status end |
#permissions ⇒ Object (readonly)
This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object.
For specific permissions, please refer to their dedicated subsections, such as ‘permissions.update_shipping_details`.
2220 2221 2222 |
# File 'lib/stripe/resources/checkout/session.rb', line 2220 def end |
#phone_number_collection ⇒ Object (readonly)
Attribute for field phone_number_collection
2222 2223 2224 |
# File 'lib/stripe/resources/checkout/session.rb', line 2222 def phone_number_collection @phone_number_collection end |
#presentment_details ⇒ Object (readonly)
Attribute for field presentment_details
2224 2225 2226 |
# File 'lib/stripe/resources/checkout/session.rb', line 2224 def presentment_details @presentment_details end |
#recovered_from ⇒ Object (readonly)
The ID of the original expired Checkout Session that triggered the recovery flow.
2226 2227 2228 |
# File 'lib/stripe/resources/checkout/session.rb', line 2226 def recovered_from @recovered_from end |
#redirect_on_completion ⇒ Object (readonly)
This parameter applies to ‘ui_mode: embedded`. Learn more about the [redirect behavior](docs.stripe.com/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`.
2228 2229 2230 |
# File 'lib/stripe/resources/checkout/session.rb', line 2228 def redirect_on_completion @redirect_on_completion end |
#return_url ⇒ Object (readonly)
Applies to Checkout Sessions with ‘ui_mode: embedded` or `ui_mode: custom`. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site.
2230 2231 2232 |
# File 'lib/stripe/resources/checkout/session.rb', line 2230 def return_url @return_url end |
#saved_payment_method_options ⇒ Object (readonly)
Controls saved payment method settings for the session. Only available in ‘payment` and `subscription` mode.
2232 2233 2234 |
# File 'lib/stripe/resources/checkout/session.rb', line 2232 def end |
#setup_intent ⇒ Object (readonly)
The ID of the SetupIntent for Checkout Sessions in ‘setup` mode. You can’t confirm or cancel the SetupIntent for a Checkout Session. To cancel, [expire the Checkout Session](docs.stripe.com/api/checkout/sessions/expire) instead.
2234 2235 2236 |
# File 'lib/stripe/resources/checkout/session.rb', line 2234 def setup_intent @setup_intent end |
#shipping_address_collection ⇒ Object (readonly)
When set, provides configuration for Checkout to collect a shipping address from a customer.
2236 2237 2238 |
# File 'lib/stripe/resources/checkout/session.rb', line 2236 def shipping_address_collection @shipping_address_collection end |
#shipping_cost ⇒ Object (readonly)
The details of the customer cost of shipping, including the customer chosen ShippingRate.
2238 2239 2240 |
# File 'lib/stripe/resources/checkout/session.rb', line 2238 def shipping_cost @shipping_cost end |
#shipping_options ⇒ Object (readonly)
The shipping rate options applied to this Session.
2240 2241 2242 |
# File 'lib/stripe/resources/checkout/session.rb', line 2240 def end |
#status ⇒ Object (readonly)
The status of the Checkout Session, one of ‘open`, `complete`, or `expired`.
2242 2243 2244 |
# File 'lib/stripe/resources/checkout/session.rb', line 2242 def status @status end |
#submit_type ⇒ Object (readonly)
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.
2246 2247 2248 |
# File 'lib/stripe/resources/checkout/session.rb', line 2246 def submit_type @submit_type end |
#subscription ⇒ Object (readonly)
The ID of the [Subscription](docs.stripe.com/api/subscriptions) for Checkout Sessions in ‘subscription` mode.
2248 2249 2250 |
# File 'lib/stripe/resources/checkout/session.rb', line 2248 def subscription @subscription end |
#success_url ⇒ Object (readonly)
The URL the customer will be directed to after the payment or subscription creation is successful.
2251 2252 2253 |
# File 'lib/stripe/resources/checkout/session.rb', line 2251 def success_url @success_url end |
#tax_id_collection ⇒ Object (readonly)
Attribute for field tax_id_collection
2253 2254 2255 |
# File 'lib/stripe/resources/checkout/session.rb', line 2253 def tax_id_collection @tax_id_collection end |
#total_details ⇒ Object (readonly)
Tax and discount details for the computed total amount.
2255 2256 2257 |
# File 'lib/stripe/resources/checkout/session.rb', line 2255 def total_details @total_details end |
#ui_mode ⇒ Object (readonly)
The UI mode of the Session. Defaults to ‘hosted`.
2257 2258 2259 |
# File 'lib/stripe/resources/checkout/session.rb', line 2257 def ui_mode @ui_mode end |
#url ⇒ Object (readonly)
The URL to the Checkout Session. Applies to Checkout Sessions with ‘ui_mode: hosted`. Redirect customers to this URL to take them to Checkout. If you’re using [Custom Domains](docs.stripe.com/payments/checkout/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.
2260 2261 2262 |
# File 'lib/stripe/resources/checkout/session.rb', line 2260 def url @url end |
#wallet_options ⇒ Object (readonly)
Wallet-specific configuration for this Checkout Session.
2262 2263 2264 |
# File 'lib/stripe/resources/checkout/session.rb', line 2262 def end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates a Checkout Session object.
2265 2266 2267 2268 2269 2270 2271 2272 |
# File 'lib/stripe/resources/checkout/session.rb', line 2265 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/checkout/sessions", params: params, opts: opts ) end |
.expire(session, params = {}, opts = {}) ⇒ Object
A Checkout Session can be expired when it is in one of these statuses: open
After it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
2289 2290 2291 2292 2293 2294 2295 2296 |
# File 'lib/stripe/resources/checkout/session.rb', line 2289 def self.expire(session, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/checkout/sessions/%<session>s/expire", { session: CGI.escape(session) }), params: params, opts: opts ) end |
.field_remappings ⇒ Object
2372 2373 2374 |
# File 'lib/stripe/resources/checkout/session.rb', line 2372 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 |
# File 'lib/stripe/resources/checkout/session.rb', line 2340 def self.inner_class_types @inner_class_types = { adaptive_pricing: AdaptivePricing, after_expiration: AfterExpiration, automatic_tax: AutomaticTax, branding_settings: BrandingSettings, collected_information: CollectedInformation, consent: Consent, consent_collection: ConsentCollection, currency_conversion: CurrencyConversion, custom_fields: CustomField, custom_text: CustomText, customer_details: CustomerDetails, discounts: Discount, invoice_creation: InvoiceCreation, name_collection: NameCollection, optional_items: OptionalItem, payment_method_configuration_details: PaymentMethodConfigurationDetails, payment_method_options: PaymentMethodOptions, permissions: Permissions, phone_number_collection: PhoneNumberCollection, presentment_details: PresentmentDetails, saved_payment_method_options: SavedPaymentMethodOptions, shipping_address_collection: ShippingAddressCollection, shipping_cost: ShippingCost, shipping_options: ShippingOption, tax_id_collection: TaxIdCollection, total_details: TotalDetails, wallet_options: WalletOptions, } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of Checkout Sessions.
2299 2300 2301 2302 2303 2304 2305 2306 |
# File 'lib/stripe/resources/checkout/session.rb', line 2299 def self.list(params = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/checkout/sessions", params: params, opts: opts ) end |
.list_line_items(session, params = {}, opts = {}) ⇒ Object
When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
2319 2320 2321 2322 2323 2324 2325 2326 |
# File 'lib/stripe/resources/checkout/session.rb', line 2319 def self.list_line_items(session, params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(session) }), params: params, opts: opts ) end |
.object_name ⇒ Object
26 27 28 |
# File 'lib/stripe/resources/checkout/session.rb', line 26 def self.object_name "checkout.session" end |
.update(session, params = {}, opts = {}) ⇒ Object
Updates a Checkout Session object.
Related guide: [Dynamically update Checkout](docs.stripe.com/payments/checkout/dynamic-updates)
2331 2332 2333 2334 2335 2336 2337 2338 |
# File 'lib/stripe/resources/checkout/session.rb', line 2331 def self.update(session, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/checkout/sessions/%<session>s", { session: CGI.escape(session) }), params: params, opts: opts ) end |
Instance Method Details
#expire(params = {}, opts = {}) ⇒ Object
A Checkout Session can be expired when it is in one of these statuses: open
After it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
2277 2278 2279 2280 2281 2282 2283 2284 |
# File 'lib/stripe/resources/checkout/session.rb', line 2277 def expire(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/checkout/sessions/%<session>s/expire", { session: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#list_line_items(params = {}, opts = {}) ⇒ Object
When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
2309 2310 2311 2312 2313 2314 2315 2316 |
# File 'lib/stripe/resources/checkout/session.rb', line 2309 def list_line_items(params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(self["id"]) }), params: params, opts: opts ) end |