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 or 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, and either the successful PaymentIntent or an active Subscription.
You can create a Checkout Session on your server and redirect to its URL to begin Checkout.
Related guide: Checkout quickstart
Defined Under Namespace
Classes: AdaptivePricing, AfterExpiration, AutomaticTax, BrandingSettings, CollectedInformation, Consent, ConsentCollection, CurrencyConversion, CustomField, CustomText, CustomerDetails, Discount, InvoiceCreation, ManagedPayments, NameCollection, OptionalItem, PaymentMethodConfigurationDetails, PaymentMethodOptions, Permissions, PhoneNumberCollection, PresentmentDetails, Redaction, 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.
-
#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_collectionfor 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, in lowercase.
-
#currency_conversion ⇒ Object
readonly
Currency conversion details for 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.
-
#integration_identifier ⇒ Object
readonly
The integration identifier for this Checkout Session.
-
#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
If the object exists in live mode, the value is
true. -
#locale ⇒ Object
readonly
The IETF language tag of the locale Checkout is displayed in.
-
#managed_payments ⇒ Object
readonly
Settings for Managed Payments for this Checkout Session and resulting PaymentIntents, Invoices, and Subscriptions.
-
#metadata ⇒ Object
readonly
Set of key-value pairs 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
paymentmode. -
#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, orno_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.
-
#redaction ⇒ Object
readonly
The redaction status of the Checkout Session.
-
#redirect_on_completion ⇒ Object
readonly
This parameter applies to
ui_mode: embedded_page. -
#return_url ⇒ Object
readonly
Applies to Checkout Sessions with
ui_mode: embedded_pageorui_mode: elements. -
#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
setupmode. -
#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, orexpired. -
#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 for Checkout Sessions in
subscriptionmode. -
#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_encodings ⇒ Object
- .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.
2367 2368 2369 |
# File 'lib/stripe/resources/checkout/session.rb', line 2367 def adaptive_pricing @adaptive_pricing end |
#after_expiration ⇒ Object (readonly)
When set, provides configuration for actions to take if this Checkout Session expires.
2369 2370 2371 |
# File 'lib/stripe/resources/checkout/session.rb', line 2369 def after_expiration @after_expiration end |
#allow_promotion_codes ⇒ Object (readonly)
Enables user redeemable promotion codes.
2371 2372 2373 |
# File 'lib/stripe/resources/checkout/session.rb', line 2371 def allow_promotion_codes @allow_promotion_codes end |
#amount_subtotal ⇒ Object (readonly)
Total of all items before discounts or taxes are applied.
2373 2374 2375 |
# File 'lib/stripe/resources/checkout/session.rb', line 2373 def amount_subtotal @amount_subtotal end |
#amount_total ⇒ Object (readonly)
Total of all items after discounts and taxes are applied.
2375 2376 2377 |
# File 'lib/stripe/resources/checkout/session.rb', line 2375 def amount_total @amount_total end |
#automatic_tax ⇒ Object (readonly)
Attribute for field automatic_tax
2377 2378 2379 |
# File 'lib/stripe/resources/checkout/session.rb', line 2377 def automatic_tax @automatic_tax end |
#billing_address_collection ⇒ Object (readonly)
Describes whether Checkout should collect the customer's billing address. Defaults to auto.
2379 2380 2381 |
# File 'lib/stripe/resources/checkout/session.rb', line 2379 def billing_address_collection @billing_address_collection end |
#branding_settings ⇒ Object (readonly)
Attribute for field branding_settings
2381 2382 2383 |
# File 'lib/stripe/resources/checkout/session.rb', line 2381 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.
2383 2384 2385 |
# File 'lib/stripe/resources/checkout/session.rb', line 2383 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.
2387 2388 2389 |
# File 'lib/stripe/resources/checkout/session.rb', line 2387 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_page or ui_mode: elements. For ui_mode: embedded_page, the client secret is to be used when initializing Stripe.js embedded checkout.
For ui_mode: elements, use the client secret with initCheckout on your front end.
2390 2391 2392 |
# File 'lib/stripe/resources/checkout/session.rb', line 2390 def client_secret @client_secret end |
#collected_information ⇒ Object (readonly)
Information about the customer collected within the Checkout Session.
2392 2393 2394 |
# File 'lib/stripe/resources/checkout/session.rb', line 2392 def collected_information @collected_information end |
#consent ⇒ Object (readonly)
Results of consent_collection for this session.
2394 2395 2396 |
# File 'lib/stripe/resources/checkout/session.rb', line 2394 def @consent end |
#consent_collection ⇒ Object (readonly)
When set, provides configuration for the Checkout Session to gather active consent from customers.
2396 2397 2398 |
# File 'lib/stripe/resources/checkout/session.rb', line 2396 def @consent_collection end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
2398 2399 2400 |
# File 'lib/stripe/resources/checkout/session.rb', line 2398 def created @created end |
#currency ⇒ Object (readonly)
Three-letter ISO currency code, in lowercase. Must be a supported currency.
2400 2401 2402 |
# File 'lib/stripe/resources/checkout/session.rb', line 2400 def currency @currency end |
#currency_conversion ⇒ Object (readonly)
Currency conversion details for Adaptive Pricing sessions created before 2025-03-31.
2402 2403 2404 |
# File 'lib/stripe/resources/checkout/session.rb', line 2402 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. You can't set this parameter if ui_mode is custom.
2404 2405 2406 |
# File 'lib/stripe/resources/checkout/session.rb', line 2404 def custom_fields @custom_fields end |
#custom_text ⇒ Object (readonly)
Attribute for field custom_text
2406 2407 2408 |
# File 'lib/stripe/resources/checkout/session.rb', line 2406 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.
2412 2413 2414 |
# File 'lib/stripe/resources/checkout/session.rb', line 2412 def customer @customer end |
#customer_account ⇒ Object (readonly)
The ID of the account for this Session.
2414 2415 2416 |
# File 'lib/stripe/resources/checkout/session.rb', line 2414 def customer_account @customer_account end |
#customer_creation ⇒ Object (readonly)
Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
2416 2417 2418 |
# File 'lib/stripe/resources/checkout/session.rb', line 2416 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.
2418 2419 2420 |
# File 'lib/stripe/resources/checkout/session.rb', line 2418 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.
2424 2425 2426 |
# File 'lib/stripe/resources/checkout/session.rb', line 2424 def customer_email @customer_email end |
#discounts ⇒ Object (readonly)
List of coupons and promotion codes attached to the Checkout Session.
2426 2427 2428 |
# File 'lib/stripe/resources/checkout/session.rb', line 2426 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.
2428 2429 2430 |
# File 'lib/stripe/resources/checkout/session.rb', line 2428 def excluded_payment_method_types @excluded_payment_method_types end |
#expires_at ⇒ Object (readonly)
The timestamp at which the Checkout Session will expire.
2430 2431 2432 |
# File 'lib/stripe/resources/checkout/session.rb', line 2430 def expires_at @expires_at end |
#id ⇒ Object (readonly)
Unique identifier for the object.
2432 2433 2434 |
# File 'lib/stripe/resources/checkout/session.rb', line 2432 def id @id end |
#integration_identifier ⇒ Object (readonly)
The integration identifier for this Checkout Session. Multiple Checkout Sessions can have the same integration identifier.
2434 2435 2436 |
# File 'lib/stripe/resources/checkout/session.rb', line 2434 def integration_identifier @integration_identifier end |
#invoice ⇒ Object (readonly)
ID of the invoice created by the Checkout Session, if it exists.
2436 2437 2438 |
# File 'lib/stripe/resources/checkout/session.rb', line 2436 def invoice @invoice end |
#invoice_creation ⇒ Object (readonly)
Details on the state of invoice creation for the Checkout Session.
2438 2439 2440 |
# File 'lib/stripe/resources/checkout/session.rb', line 2438 def invoice_creation @invoice_creation end |
#line_items ⇒ Object (readonly)
The line items purchased by the customer.
2440 2441 2442 |
# File 'lib/stripe/resources/checkout/session.rb', line 2440 def line_items @line_items end |
#livemode ⇒ Object (readonly)
If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
2442 2443 2444 |
# File 'lib/stripe/resources/checkout/session.rb', line 2442 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.
2444 2445 2446 |
# File 'lib/stripe/resources/checkout/session.rb', line 2444 def locale @locale end |
#managed_payments ⇒ Object (readonly)
Settings for Managed Payments for this Checkout Session and resulting PaymentIntents, Invoices, and Subscriptions.
2446 2447 2448 |
# File 'lib/stripe/resources/checkout/session.rb', line 2446 def managed_payments @managed_payments end |
#metadata ⇒ Object (readonly)
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.
2448 2449 2450 |
# File 'lib/stripe/resources/checkout/session.rb', line 2448 def @metadata end |
#mode ⇒ Object (readonly)
The mode of the Checkout Session.
2450 2451 2452 |
# File 'lib/stripe/resources/checkout/session.rb', line 2450 def mode @mode end |
#name_collection ⇒ Object (readonly)
Attribute for field name_collection
2452 2453 2454 |
# File 'lib/stripe/resources/checkout/session.rb', line 2452 def name_collection @name_collection end |
#object ⇒ Object (readonly)
String representing the object's type. Objects of the same type share the same value.
2454 2455 2456 |
# File 'lib/stripe/resources/checkout/session.rb', line 2454 def object @object end |
#optional_items ⇒ Object (readonly)
The optional items presented to the customer at checkout.
2456 2457 2458 |
# File 'lib/stripe/resources/checkout/session.rb', line 2456 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.
2458 2459 2460 |
# File 'lib/stripe/resources/checkout/session.rb', line 2458 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 instead.
2460 2461 2462 |
# File 'lib/stripe/resources/checkout/session.rb', line 2460 def payment_intent @payment_intent end |
#payment_link ⇒ Object (readonly)
The ID of the Payment Link that created this Session.
2462 2463 2464 |
# File 'lib/stripe/resources/checkout/session.rb', line 2462 def payment_link @payment_link end |
#payment_method_collection ⇒ Object (readonly)
Configure whether a Checkout Session should collect a payment method. Defaults to always.
2464 2465 2466 |
# File 'lib/stripe/resources/checkout/session.rb', line 2464 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.
2466 2467 2468 |
# File 'lib/stripe/resources/checkout/session.rb', line 2466 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.
2468 2469 2470 |
# File 'lib/stripe/resources/checkout/session.rb', line 2468 def @payment_method_options end |
#payment_method_types ⇒ Object (readonly)
A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
2471 2472 2473 |
# File 'lib/stripe/resources/checkout/session.rb', line 2471 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.
2474 2475 2476 |
# File 'lib/stripe/resources/checkout/session.rb', line 2474 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.
2478 2479 2480 |
# File 'lib/stripe/resources/checkout/session.rb', line 2478 def @permissions end |
#phone_number_collection ⇒ Object (readonly)
Attribute for field phone_number_collection
2480 2481 2482 |
# File 'lib/stripe/resources/checkout/session.rb', line 2480 def phone_number_collection @phone_number_collection end |
#presentment_details ⇒ Object (readonly)
Attribute for field presentment_details
2482 2483 2484 |
# File 'lib/stripe/resources/checkout/session.rb', line 2482 def presentment_details @presentment_details end |
#recovered_from ⇒ Object (readonly)
The ID of the original expired Checkout Session that triggered the recovery flow.
2484 2485 2486 |
# File 'lib/stripe/resources/checkout/session.rb', line 2484 def recovered_from @recovered_from end |
#redaction ⇒ Object (readonly)
The redaction status of the Checkout Session. If the Session is not redacted, this field is null.
2486 2487 2488 |
# File 'lib/stripe/resources/checkout/session.rb', line 2486 def redaction @redaction end |
#redirect_on_completion ⇒ Object (readonly)
This parameter applies to ui_mode: embedded_page. Learn more about the redirect behavior of embedded sessions. Defaults to always.
2488 2489 2490 |
# File 'lib/stripe/resources/checkout/session.rb', line 2488 def redirect_on_completion @redirect_on_completion end |
#return_url ⇒ Object (readonly)
Applies to Checkout Sessions with ui_mode: embedded_page or ui_mode: elements. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
2490 2491 2492 |
# File 'lib/stripe/resources/checkout/session.rb', line 2490 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.
2492 2493 2494 |
# File 'lib/stripe/resources/checkout/session.rb', line 2492 def @saved_payment_method_options 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 instead.
2494 2495 2496 |
# File 'lib/stripe/resources/checkout/session.rb', line 2494 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.
2496 2497 2498 |
# File 'lib/stripe/resources/checkout/session.rb', line 2496 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.
2498 2499 2500 |
# File 'lib/stripe/resources/checkout/session.rb', line 2498 def shipping_cost @shipping_cost end |
#shipping_options ⇒ Object (readonly)
The shipping rate options applied to this Session.
2500 2501 2502 |
# File 'lib/stripe/resources/checkout/session.rb', line 2500 def @shipping_options end |
#status ⇒ Object (readonly)
The status of the Checkout Session, one of open, complete, or expired.
2502 2503 2504 |
# File 'lib/stripe/resources/checkout/session.rb', line 2502 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.
2506 2507 2508 |
# File 'lib/stripe/resources/checkout/session.rb', line 2506 def submit_type @submit_type end |
#subscription ⇒ Object (readonly)
The ID of the Subscription for Checkout Sessions in subscription mode.
2508 2509 2510 |
# File 'lib/stripe/resources/checkout/session.rb', line 2508 def subscription @subscription end |
#success_url ⇒ Object (readonly)
The URL the customer will be directed to after the payment or subscription creation is successful.
2511 2512 2513 |
# File 'lib/stripe/resources/checkout/session.rb', line 2511 def success_url @success_url end |
#tax_id_collection ⇒ Object (readonly)
Attribute for field tax_id_collection
2513 2514 2515 |
# File 'lib/stripe/resources/checkout/session.rb', line 2513 def tax_id_collection @tax_id_collection end |
#total_details ⇒ Object (readonly)
Tax and discount details for the computed total amount.
2515 2516 2517 |
# File 'lib/stripe/resources/checkout/session.rb', line 2515 def total_details @total_details end |
#ui_mode ⇒ Object (readonly)
The UI mode of the Session. Defaults to hosted_page.
2517 2518 2519 |
# File 'lib/stripe/resources/checkout/session.rb', line 2517 def ui_mode @ui_mode end |
#url ⇒ Object (readonly)
The URL to the Checkout Session. Applies to Checkout Sessions with ui_mode: hosted_page. 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.
2520 2521 2522 |
# File 'lib/stripe/resources/checkout/session.rb', line 2520 def url @url end |
#wallet_options ⇒ Object (readonly)
Wallet-specific configuration for this Checkout Session.
2522 2523 2524 |
# File 'lib/stripe/resources/checkout/session.rb', line 2522 def @wallet_options end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates a Checkout Session object.
2525 2526 2527 2528 2529 2530 2531 2532 |
# File 'lib/stripe/resources/checkout/session.rb', line 2525 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.
2549 2550 2551 2552 2553 2554 2555 2556 |
# File 'lib/stripe/resources/checkout/session.rb', line 2549 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_encodings ⇒ Object
2638 2639 2640 2641 2642 |
# File 'lib/stripe/resources/checkout/session.rb', line 2638 def self.field_encodings @field_encodings = { currency_conversion: { kind: :object, fields: { fx_rate: :decimal_string } }, } end |
.field_remappings ⇒ Object
2634 2635 2636 |
# File 'lib/stripe/resources/checkout/session.rb', line 2634 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 |
# File 'lib/stripe/resources/checkout/session.rb', line 2600 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, managed_payments: ManagedPayments, name_collection: NameCollection, optional_items: OptionalItem, payment_method_configuration_details: PaymentMethodConfigurationDetails, payment_method_options: PaymentMethodOptions, permissions: Permissions, phone_number_collection: PhoneNumberCollection, presentment_details: PresentmentDetails, redaction: Redaction, 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.
2559 2560 2561 2562 2563 2564 2565 2566 |
# File 'lib/stripe/resources/checkout/session.rb', line 2559 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.
2579 2580 2581 2582 2583 2584 2585 2586 |
# File 'lib/stripe/resources/checkout/session.rb', line 2579 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 a Checkout Session
2591 2592 2593 2594 2595 2596 2597 2598 |
# File 'lib/stripe/resources/checkout/session.rb', line 2591 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.
2537 2538 2539 2540 2541 2542 2543 2544 |
# File 'lib/stripe/resources/checkout/session.rb', line 2537 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.
2569 2570 2571 2572 2573 2574 2575 2576 |
# File 'lib/stripe/resources/checkout/session.rb', line 2569 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 |