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, AutomaticSurcharge, AutomaticTax, BrandingSettings, CheckoutItem, CollectedInformation, Consent, ConsentCollection, CurrencyConversion, CurrentAttempt, CustomField, CustomText, CustomerDetails, Discount, InvoiceCreation, ManagedPayments, NameCollection, OptionalItem, PaymentMethodConfigurationDetails, PaymentMethodOptions, Permissions, PhoneNumberCollection, PresentmentDetails, SavedPaymentMethodOptions, ShippingAddressCollection, ShippingCost, ShippingOption, SurchargeCost, 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.
-
#approval_method ⇒ Object
readonly
Determines whether the customer’s attempt to pay must be manually approved.
-
#automatic_surcharge ⇒ Object
readonly
Attribute for field automatic_surcharge.
-
#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.
-
#checkout_items ⇒ Object
readonly
Attribute for field checkout_items.
-
#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.
-
#current_attempt ⇒ Object
readonly
The customer’s pending attempt to pay that requires your approval.
-
#custom_fields ⇒ Object
readonly
Collect additional information from your customer using custom fields.
-
#custom_payment_method_types ⇒ Object
readonly
A list of the types of [custom payment methods](docs.stripe.com/payments/payment-methods/custom-payment-methods) (e.g. cpmt_123) this Checkout Session is allowed to accept.
-
#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](/api/payment_intents/object), [Invoices](/api/invoices/object), and [Subscriptions](/api/subscriptions/object).
-
#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_record ⇒ Object
readonly
The [Payment Record](docs.stripe.com/api/payment-record) for this Checkout Session.
-
#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_page`.
-
#return_url ⇒ Object
readonly
Applies to Checkout Sessions with ‘ui_mode: embedded_page` or `ui_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 ‘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.
-
#surcharge_cost ⇒ Object
readonly
Attribute for field surcharge_cost.
-
#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
-
.approve(session, params = {}, opts = {}) ⇒ Object
Approves a customer’s attempt to pay for a Checkout Session with approval_method set to manual.
-
.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
-
#approve(params = {}, opts = {}) ⇒ Object
Approves a customer’s attempt to pay for a Checkout Session with approval_method set to manual.
-
#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).
2699 2700 2701 |
# File 'lib/stripe/resources/checkout/session.rb', line 2699 def adaptive_pricing @adaptive_pricing end |
#after_expiration ⇒ Object (readonly)
When set, provides configuration for actions to take if this Checkout Session expires.
2701 2702 2703 |
# File 'lib/stripe/resources/checkout/session.rb', line 2701 def after_expiration @after_expiration end |
#allow_promotion_codes ⇒ Object (readonly)
Enables user redeemable promotion codes.
2703 2704 2705 |
# File 'lib/stripe/resources/checkout/session.rb', line 2703 def allow_promotion_codes @allow_promotion_codes end |
#amount_subtotal ⇒ Object (readonly)
Total of all items before discounts or taxes are applied.
2705 2706 2707 |
# File 'lib/stripe/resources/checkout/session.rb', line 2705 def amount_subtotal @amount_subtotal end |
#amount_total ⇒ Object (readonly)
Total of all items after discounts and taxes are applied.
2707 2708 2709 |
# File 'lib/stripe/resources/checkout/session.rb', line 2707 def amount_total @amount_total end |
#approval_method ⇒ Object (readonly)
Determines whether the customer’s attempt to pay must be manually approved.
Default is ‘auto`, when the customer’s attempt to pay is approved automatically with no action required on your server.
When set to ‘manual`, you must approve the customer’s attempt to pay by calling [approve](api/checkout/sessions/approve) from your server.
2713 2714 2715 |
# File 'lib/stripe/resources/checkout/session.rb', line 2713 def approval_method @approval_method end |
#automatic_surcharge ⇒ Object (readonly)
Attribute for field automatic_surcharge
2715 2716 2717 |
# File 'lib/stripe/resources/checkout/session.rb', line 2715 def automatic_surcharge @automatic_surcharge end |
#automatic_tax ⇒ Object (readonly)
Attribute for field automatic_tax
2717 2718 2719 |
# File 'lib/stripe/resources/checkout/session.rb', line 2717 def automatic_tax @automatic_tax end |
#billing_address_collection ⇒ Object (readonly)
Describes whether Checkout should collect the customer’s billing address. Defaults to ‘auto`.
2719 2720 2721 |
# File 'lib/stripe/resources/checkout/session.rb', line 2719 def billing_address_collection @billing_address_collection end |
#branding_settings ⇒ Object (readonly)
Attribute for field branding_settings
2721 2722 2723 |
# File 'lib/stripe/resources/checkout/session.rb', line 2721 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.
2723 2724 2725 |
# File 'lib/stripe/resources/checkout/session.rb', line 2723 def cancel_url @cancel_url end |
#checkout_items ⇒ Object (readonly)
Attribute for field checkout_items
2725 2726 2727 |
# File 'lib/stripe/resources/checkout/session.rb', line 2725 def checkout_items @checkout_items 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.
2729 2730 2731 |
# File 'lib/stripe/resources/checkout/session.rb', line 2729 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](https://docs.stripe.com/js/custom_checkout/init) on your front end.
2732 2733 2734 |
# File 'lib/stripe/resources/checkout/session.rb', line 2732 def client_secret @client_secret end |
#collected_information ⇒ Object (readonly)
Information about the customer collected within the Checkout Session.
2734 2735 2736 |
# File 'lib/stripe/resources/checkout/session.rb', line 2734 def collected_information @collected_information end |
#consent ⇒ Object (readonly)
Results of ‘consent_collection` for this session.
2736 2737 2738 |
# File 'lib/stripe/resources/checkout/session.rb', line 2736 def @consent end |
#consent_collection ⇒ Object (readonly)
When set, provides configuration for the Checkout Session to gather active consent from customers.
2738 2739 2740 |
# File 'lib/stripe/resources/checkout/session.rb', line 2738 def @consent_collection end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
2740 2741 2742 |
# File 'lib/stripe/resources/checkout/session.rb', line 2740 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).
2742 2743 2744 |
# File 'lib/stripe/resources/checkout/session.rb', line 2742 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.
2744 2745 2746 |
# File 'lib/stripe/resources/checkout/session.rb', line 2744 def currency_conversion @currency_conversion end |
#current_attempt ⇒ Object (readonly)
The customer’s pending attempt to pay that requires your approval. Contains information about the customer and their payment details.
2746 2747 2748 |
# File 'lib/stripe/resources/checkout/session.rb', line 2746 def current_attempt @current_attempt 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`.
2748 2749 2750 |
# File 'lib/stripe/resources/checkout/session.rb', line 2748 def custom_fields @custom_fields end |
#custom_payment_method_types ⇒ Object (readonly)
A list of the types of [custom payment methods](docs.stripe.com/payments/payment-methods/custom-payment-methods) (e.g. cpmt_123) this Checkout Session is allowed to accept.
2751 2752 2753 |
# File 'lib/stripe/resources/checkout/session.rb', line 2751 def custom_payment_method_types @custom_payment_method_types end |
#custom_text ⇒ Object (readonly)
Attribute for field custom_text
2753 2754 2755 |
# File 'lib/stripe/resources/checkout/session.rb', line 2753 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.
2759 2760 2761 |
# File 'lib/stripe/resources/checkout/session.rb', line 2759 def customer @customer end |
#customer_account ⇒ Object (readonly)
The ID of the account for this Session.
2761 2762 2763 |
# File 'lib/stripe/resources/checkout/session.rb', line 2761 def customer_account @customer_account end |
#customer_creation ⇒ Object (readonly)
Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
2763 2764 2765 |
# File 'lib/stripe/resources/checkout/session.rb', line 2763 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.
2765 2766 2767 |
# File 'lib/stripe/resources/checkout/session.rb', line 2765 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.
2771 2772 2773 |
# File 'lib/stripe/resources/checkout/session.rb', line 2771 def customer_email @customer_email end |
#discounts ⇒ Object (readonly)
List of coupons and promotion codes attached to the Checkout Session.
2773 2774 2775 |
# File 'lib/stripe/resources/checkout/session.rb', line 2773 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).
2775 2776 2777 |
# File 'lib/stripe/resources/checkout/session.rb', line 2775 def excluded_payment_method_types @excluded_payment_method_types end |
#expires_at ⇒ Object (readonly)
The timestamp at which the Checkout Session will expire.
2777 2778 2779 |
# File 'lib/stripe/resources/checkout/session.rb', line 2777 def expires_at @expires_at end |
#id ⇒ Object (readonly)
Unique identifier for the object.
2779 2780 2781 |
# File 'lib/stripe/resources/checkout/session.rb', line 2779 def id @id end |
#integration_identifier ⇒ Object (readonly)
The integration identifier for this Checkout Session. Multiple Checkout Sessions can have the same integration identifier.
2781 2782 2783 |
# File 'lib/stripe/resources/checkout/session.rb', line 2781 def integration_identifier @integration_identifier end |
#invoice ⇒ Object (readonly)
ID of the invoice created by the Checkout Session, if it exists.
2783 2784 2785 |
# File 'lib/stripe/resources/checkout/session.rb', line 2783 def invoice @invoice end |
#invoice_creation ⇒ Object (readonly)
Details on the state of invoice creation for the Checkout Session.
2785 2786 2787 |
# File 'lib/stripe/resources/checkout/session.rb', line 2785 def invoice_creation @invoice_creation end |
#line_items ⇒ Object (readonly)
The line items purchased by the customer.
2787 2788 2789 |
# File 'lib/stripe/resources/checkout/session.rb', line 2787 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`.
2789 2790 2791 |
# File 'lib/stripe/resources/checkout/session.rb', line 2789 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.
2791 2792 2793 |
# File 'lib/stripe/resources/checkout/session.rb', line 2791 def locale @locale end |
#managed_payments ⇒ Object (readonly)
Settings for Managed Payments for this Checkout Session and resulting [PaymentIntents](/api/payment_intents/object), [Invoices](/api/invoices/object), and [Subscriptions](/api/subscriptions/object).
2793 2794 2795 |
# File 'lib/stripe/resources/checkout/session.rb', line 2793 def managed_payments @managed_payments 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.
2795 2796 2797 |
# File 'lib/stripe/resources/checkout/session.rb', line 2795 def @metadata end |
#mode ⇒ Object (readonly)
The mode of the Checkout Session.
2797 2798 2799 |
# File 'lib/stripe/resources/checkout/session.rb', line 2797 def mode @mode end |
#name_collection ⇒ Object (readonly)
Attribute for field name_collection
2799 2800 2801 |
# File 'lib/stripe/resources/checkout/session.rb', line 2799 def name_collection @name_collection end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
2801 2802 2803 |
# File 'lib/stripe/resources/checkout/session.rb', line 2801 def object @object end |
#optional_items ⇒ Object (readonly)
The optional items presented to the customer at checkout.
2803 2804 2805 |
# File 'lib/stripe/resources/checkout/session.rb', line 2803 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.
2805 2806 2807 |
# File 'lib/stripe/resources/checkout/session.rb', line 2805 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.
2807 2808 2809 |
# File 'lib/stripe/resources/checkout/session.rb', line 2807 def payment_intent @payment_intent end |
#payment_link ⇒ Object (readonly)
The ID of the Payment Link that created this Session.
2809 2810 2811 |
# File 'lib/stripe/resources/checkout/session.rb', line 2809 def payment_link @payment_link end |
#payment_method_collection ⇒ Object (readonly)
Configure whether a Checkout Session should collect a payment method. Defaults to ‘always`.
2811 2812 2813 |
# File 'lib/stripe/resources/checkout/session.rb', line 2811 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.
2813 2814 2815 |
# File 'lib/stripe/resources/checkout/session.rb', line 2813 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.
2815 2816 2817 |
# File 'lib/stripe/resources/checkout/session.rb', line 2815 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.
2818 2819 2820 |
# File 'lib/stripe/resources/checkout/session.rb', line 2818 def payment_method_types @payment_method_types end |
#payment_record ⇒ Object (readonly)
The [Payment Record](docs.stripe.com/api/payment-record) for this Checkout Session.
2820 2821 2822 |
# File 'lib/stripe/resources/checkout/session.rb', line 2820 def payment_record @payment_record 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.
2823 2824 2825 |
# File 'lib/stripe/resources/checkout/session.rb', line 2823 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`.
2827 2828 2829 |
# File 'lib/stripe/resources/checkout/session.rb', line 2827 def @permissions end |
#phone_number_collection ⇒ Object (readonly)
Attribute for field phone_number_collection
2829 2830 2831 |
# File 'lib/stripe/resources/checkout/session.rb', line 2829 def phone_number_collection @phone_number_collection end |
#presentment_details ⇒ Object (readonly)
Attribute for field presentment_details
2831 2832 2833 |
# File 'lib/stripe/resources/checkout/session.rb', line 2831 def presentment_details @presentment_details end |
#recovered_from ⇒ Object (readonly)
The ID of the original expired Checkout Session that triggered the recovery flow.
2833 2834 2835 |
# File 'lib/stripe/resources/checkout/session.rb', line 2833 def recovered_from @recovered_from end |
#redirect_on_completion ⇒ Object (readonly)
This parameter applies to ‘ui_mode: embedded_page`. Learn more about the [redirect behavior](docs.stripe.com/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`.
2835 2836 2837 |
# File 'lib/stripe/resources/checkout/session.rb', line 2835 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.
2837 2838 2839 |
# File 'lib/stripe/resources/checkout/session.rb', line 2837 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.
2839 2840 2841 |
# File 'lib/stripe/resources/checkout/session.rb', line 2839 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](docs.stripe.com/api/checkout/sessions/expire) instead.
2841 2842 2843 |
# File 'lib/stripe/resources/checkout/session.rb', line 2841 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.
2843 2844 2845 |
# File 'lib/stripe/resources/checkout/session.rb', line 2843 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.
2845 2846 2847 |
# File 'lib/stripe/resources/checkout/session.rb', line 2845 def shipping_cost @shipping_cost end |
#shipping_options ⇒ Object (readonly)
The shipping rate options applied to this Session.
2847 2848 2849 |
# File 'lib/stripe/resources/checkout/session.rb', line 2847 def @shipping_options end |
#status ⇒ Object (readonly)
The status of the Checkout Session, one of ‘open`, `complete`, or `expired`.
2849 2850 2851 |
# File 'lib/stripe/resources/checkout/session.rb', line 2849 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.
2853 2854 2855 |
# File 'lib/stripe/resources/checkout/session.rb', line 2853 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.
2855 2856 2857 |
# File 'lib/stripe/resources/checkout/session.rb', line 2855 def subscription @subscription end |
#success_url ⇒ Object (readonly)
The URL the customer will be directed to after the payment or subscription creation is successful.
2858 2859 2860 |
# File 'lib/stripe/resources/checkout/session.rb', line 2858 def success_url @success_url end |
#surcharge_cost ⇒ Object (readonly)
Attribute for field surcharge_cost
2860 2861 2862 |
# File 'lib/stripe/resources/checkout/session.rb', line 2860 def surcharge_cost @surcharge_cost end |
#tax_id_collection ⇒ Object (readonly)
Attribute for field tax_id_collection
2862 2863 2864 |
# File 'lib/stripe/resources/checkout/session.rb', line 2862 def tax_id_collection @tax_id_collection end |
#total_details ⇒ Object (readonly)
Tax and discount details for the computed total amount.
2864 2865 2866 |
# File 'lib/stripe/resources/checkout/session.rb', line 2864 def total_details @total_details end |
#ui_mode ⇒ Object (readonly)
The UI mode of the Session. Defaults to ‘hosted_page`.
2866 2867 2868 |
# File 'lib/stripe/resources/checkout/session.rb', line 2866 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](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.
2869 2870 2871 |
# File 'lib/stripe/resources/checkout/session.rb', line 2869 def url @url end |
#wallet_options ⇒ Object (readonly)
Wallet-specific configuration for this Checkout Session.
2871 2872 2873 |
# File 'lib/stripe/resources/checkout/session.rb', line 2871 def @wallet_options end |
Class Method Details
.approve(session, params = {}, opts = {}) ⇒ Object
Approves a customer’s attempt to pay for a Checkout Session with approval_method set to manual.
2884 2885 2886 2887 2888 2889 2890 2891 |
# File 'lib/stripe/resources/checkout/session.rb', line 2884 def self.approve(session, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/checkout/sessions/%<session>s/approve", { session: CGI.escape(session) }), params: params, opts: opts ) end |
.create(params = {}, opts = {}) ⇒ Object
Creates a Checkout Session object.
2894 2895 2896 2897 2898 2899 2900 2901 |
# File 'lib/stripe/resources/checkout/session.rb', line 2894 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.
2918 2919 2920 2921 2922 2923 2924 2925 |
# File 'lib/stripe/resources/checkout/session.rb', line 2918 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
3010 3011 3012 3013 3014 |
# File 'lib/stripe/resources/checkout/session.rb', line 3010 def self.field_encodings @field_encodings = { currency_conversion: { kind: :object, fields: { fx_rate: :decimal_string } }, } end |
.field_remappings ⇒ Object
3006 3007 3008 |
# File 'lib/stripe/resources/checkout/session.rb', line 3006 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 |
# File 'lib/stripe/resources/checkout/session.rb', line 2969 def self.inner_class_types @inner_class_types = { adaptive_pricing: AdaptivePricing, after_expiration: AfterExpiration, automatic_surcharge: AutomaticSurcharge, automatic_tax: AutomaticTax, branding_settings: BrandingSettings, collected_information: CollectedInformation, consent: Consent, consent_collection: ConsentCollection, currency_conversion: CurrencyConversion, current_attempt: CurrentAttempt, 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, saved_payment_method_options: SavedPaymentMethodOptions, shipping_address_collection: ShippingAddressCollection, shipping_cost: ShippingCost, shipping_options: ShippingOption, surcharge_cost: SurchargeCost, tax_id_collection: TaxIdCollection, total_details: TotalDetails, wallet_options: WalletOptions, checkout_items: CheckoutItem, } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of Checkout Sessions.
2928 2929 2930 2931 2932 2933 2934 2935 |
# File 'lib/stripe/resources/checkout/session.rb', line 2928 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.
2948 2949 2950 2951 2952 2953 2954 2955 |
# File 'lib/stripe/resources/checkout/session.rb', line 2948 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](docs.stripe.com/payments/advanced/dynamic-updates)
2960 2961 2962 2963 2964 2965 2966 2967 |
# File 'lib/stripe/resources/checkout/session.rb', line 2960 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
#approve(params = {}, opts = {}) ⇒ Object
Approves a customer’s attempt to pay for a Checkout Session with approval_method set to manual.
2874 2875 2876 2877 2878 2879 2880 2881 |
# File 'lib/stripe/resources/checkout/session.rb', line 2874 def approve(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/checkout/sessions/%<session>s/approve", { session: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#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.
2906 2907 2908 2909 2910 2911 2912 2913 |
# File 'lib/stripe/resources/checkout/session.rb', line 2906 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.
2938 2939 2940 2941 2942 2943 2944 2945 |
# File 'lib/stripe/resources/checkout/session.rb', line 2938 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 |