class

Stripe::CheckoutSession

Inherits OpenApi::Json < OpenApi::Validatable < JSON::Serializable::Unmapped < JSON::Serializable < Reference < Object

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

Constants

ERROR_MESSAGE_FOR_BILLING_ADDRESS_COLLECTION = "invalid value for \"billing_address_collection\", must be one of [auto, required]."
ERROR_MESSAGE_FOR_CUSTOMER_CREATION = "invalid value for \"customer_creation\", must be one of [always, if_required]."
ERROR_MESSAGE_FOR_LOCALE = "invalid value for \"locale\", must be one of [auto, bg, cs, da, de, el, en, en-GB, es, es-419, et, fi, fil, fr, fr-CA, hr, hu, id, it, ja, ko, lt, lv, ms, mt, nb, nl, pl, pt, pt-BR, ro, ru, sk, sl, sv, th, tr, vi, zh, zh-HK, zh-TW]."
ERROR_MESSAGE_FOR_MODE = "invalid value for \"mode\", must be one of [payment, setup, subscription]."
ERROR_MESSAGE_FOR_OBJECT = "invalid value for \"object\", must be one of [checkout.session]."
ERROR_MESSAGE_FOR_PAYMENT_METHOD_COLLECTION = "invalid value for \"payment_method_collection\", must be one of [always, if_required]."
ERROR_MESSAGE_FOR_PAYMENT_STATUS = "invalid value for \"payment_status\", must be one of [no_payment_required, paid, unpaid]."
ERROR_MESSAGE_FOR_REDIRECT_ON_COMPLETION = "invalid value for \"redirect_on_completion\", must be one of [always, if_required, never]."
ERROR_MESSAGE_FOR_STATUS = "invalid value for \"status\", must be one of [complete, expired, open]."
ERROR_MESSAGE_FOR_SUBMIT_TYPE = "invalid value for \"submit_type\", must be one of [auto, book, donate, pay]."
ERROR_MESSAGE_FOR_UI_MODE = "invalid value for \"ui_mode\", must be one of [embedded, hosted]."
MAX_LENGTH_FOR_CANCEL_URL = 5000
MAX_LENGTH_FOR_CLIENT_REFERENCE_ID = 5000
MAX_LENGTH_FOR_CLIENT_SECRET = 5000
MAX_LENGTH_FOR_CUSTOMER_EMAIL = 5000
MAX_LENGTH_FOR_ID = 5000
MAX_LENGTH_FOR_RECOVERED_FROM = 5000
MAX_LENGTH_FOR_RETURN_URL = 5000
MAX_LENGTH_FOR_SUCCESS_URL = 5000
MAX_LENGTH_FOR_URL = 5000
VALID_VALUES_FOR_BILLING_ADDRESS_COLLECTION = String.static_array("auto", "required")
VALID_VALUES_FOR_CUSTOMER_CREATION = String.static_array("always", "if_required")
VALID_VALUES_FOR_LOCALE = String.static_array("auto", "bg", "cs", "da", "de", "el", "en", "en-GB", "es", "es-419", "et", "fi", "fil", "fr", "fr-CA", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "ms", "mt", "nb", "nl", "pl", "pt", "pt-BR", "ro", "ru", "sk", "sl", "sv", "th", "tr", "vi", "zh", "zh-HK", "zh-TW")
VALID_VALUES_FOR_MODE = String.static_array("payment", "setup", "subscription")
VALID_VALUES_FOR_OBJECT = String.static_array("checkout.session")
VALID_VALUES_FOR_PAYMENT_METHOD_COLLECTION = String.static_array("always", "if_required")
VALID_VALUES_FOR_PAYMENT_STATUS = String.static_array("no_payment_required", "paid", "unpaid")
VALID_VALUES_FOR_REDIRECT_ON_COMPLETION = String.static_array("always", "if_required", "never")
VALID_VALUES_FOR_STATUS = String.static_array("complete", "expired", "open")
VALID_VALUES_FOR_SUBMIT_TYPE = String.static_array("auto", "book", "donate", "pay")
VALID_VALUES_FOR_UI_MODE = String.static_array("embedded", "hosted")

Constructors

new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

==(other : self)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

after_expiration
Source
after_expiration=(new_value : Stripe::CheckoutSessionAfterExpiration | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] after_expiration Object to be assigned

Source
allow_promotion_codes

Enables user redeemable promotion codes.

Source
allow_promotion_codes=(new_value : Bool | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] allow_promotion_codes Object to be assigned

Source
amount_subtotal

Total of all items before discounts or taxes are applied.

Source
amount_subtotal=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount_subtotal Object to be assigned

Source
amount_total

Total of all items after discounts and taxes are applied.

Source
amount_total=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount_total Object to be assigned

Source
automatic_tax
Source
automatic_tax=(new_value : Stripe::PaymentPagesCheckoutSessionAutomaticTax | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] automatic_tax Object to be assigned

Source
billing_address_collection

Describes whether Checkout should collect the customer's billing address. Defaults to auto.

Source
billing_address_collection=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] billing_address_collection Object to be assigned

Source
cancel_url

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.

Source
cancel_url=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] cancel_url Object to be assigned

Source
client_reference_id

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.

Source
client_reference_id=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] client_reference_id Object to be assigned

Source
client_secret

Client secret to be used when initializing Stripe.js embedded checkout.

Source
client_secret=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] client_secret Object to be assigned

Source
created

Time at which the object was created. Measured in seconds since the Unix epoch.

Source
created=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] created Object to be assigned

Source
currency

Three-letter ISO currency code, in lowercase. Must be a supported currency.

Source
currency=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] currency Object to be assigned

Source
currency_conversion
Source
currency_conversion=(new_value : Stripe::CheckoutSessionCurrencyConversion | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] currency_conversion Object to be assigned

Source
custom_fields

Collect additional information from your customer using custom fields. Up to 3 fields are supported.

Source
custom_fields=(new_value : Array(Stripe::PaymentPagesCheckoutSessionCustomFields) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] custom_fields Object to be assigned

Source
custom_text
Source
custom_text=(new_value : Stripe::PaymentPagesCheckoutSessionCustomText | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] custom_text Object to be assigned

Source
customer
Source
customer=(new_value : Stripe::CheckoutSessionCustomer | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] customer Object to be assigned

Source
customer_creation

Configure whether a Checkout Session creates a Customer when the Checkout Session completes.

Source
customer_creation=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] customer_creation Object to be assigned

Source
customer_details
Source
customer_details=(new_value : Stripe::CheckoutSessionCustomerDetails | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] customer_details Object to be assigned

Source
customer_email

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.

Source
customer_email=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] customer_email Object to be assigned

Source
expires_at

The timestamp at which the Checkout Session will expire.

Source
expires_at=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] expires_at Object to be assigned

Source
hash(hasher)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

id

Unique identifier for the object.

Source
id=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] id Object to be assigned

Source
invoice
Source
invoice=(new_value : Stripe::CheckoutSessionInvoice | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] invoice Object to be assigned

Source
invoice_creation
Source
invoice_creation=(new_value : Stripe::CheckoutSessionInvoiceCreation | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] invoice_creation Object to be assigned

Source
line_items
Source

Custom attribute writer method checking allowed values (enum). @param [Object] line_items Object to be assigned

Source
list_invalid_properties

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

Source
livemode

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

Source
livemode=(new_value : Bool | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] livemode Object to be assigned

Source
locale

The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used.

Source
locale=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] locale Object to be assigned

Source
metadata
Source
metadata=(new_value : Hash(String, String) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] metadata Object to be assigned

Source
mode

The mode of the Checkout Session.

Source
mode=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] mode Object to be assigned

Source
object

String representing the object's type. Objects of the same type share the same value.

Source
object=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] object Object to be assigned

Source
payment_intent
Source
payment_intent=(new_value : Stripe::CheckoutSessionPaymentIntent | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_intent Object to be assigned

Source
payment_method_collection

Configure whether a Checkout Session should collect a payment method. Defaults to always.

Source
payment_method_collection=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_method_collection Object to be assigned

Source
payment_method_configuration_details
Source
payment_method_configuration_details=(new_value : Stripe::CheckoutSessionPaymentMethodConfigurationDetails | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_method_configuration_details Object to be assigned

Source
payment_method_options
Source
payment_method_options=(new_value : Stripe::CheckoutSessionPaymentMethodOptions1 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_method_options Object to be assigned

Source
payment_method_types

A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.

Source
payment_method_types=(new_value : Array(String) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_method_types Object to be assigned

Source
payment_status

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.

Source
payment_status=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_status Object to be assigned

Source
phone_number_collection
Source
phone_number_collection=(new_value : Stripe::PaymentPagesCheckoutSessionPhoneNumberCollection | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] phone_number_collection Object to be assigned

Source
recovered_from

The ID of the original expired Checkout Session that triggered the recovery flow.

Source
recovered_from=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] recovered_from Object to be assigned

Source
redirect_on_completion

This parameter applies to ui_mode: embedded. Learn more about the redirect behavior of embedded sessions. Defaults to always.

Source
redirect_on_completion=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] redirect_on_completion Object to be assigned

Source
return_url

Applies to Checkout Sessions with ui_mode: embedded. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.

Source
return_url=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] return_url Object to be assigned

Source
saved_payment_method_options
Source
saved_payment_method_options=(new_value : Stripe::CheckoutSessionSavedPaymentMethodOptions | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] saved_payment_method_options Object to be assigned

Source
setup_intent
Source
setup_intent=(new_value : Stripe::CheckoutSessionSetupIntent | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] setup_intent Object to be assigned

Source
shipping_address_collection
Source
shipping_address_collection=(new_value : Stripe::CheckoutSessionShippingAddressCollection | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] shipping_address_collection Object to be assigned

Source
shipping_cost
Source
shipping_cost=(new_value : Stripe::CheckoutSessionShippingCost | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] shipping_cost Object to be assigned

Source
shipping_details
Source
shipping_details=(new_value : Stripe::CheckoutSessionShippingDetails | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] shipping_details Object to be assigned

Source
shipping_options

The shipping rate options applied to this Session.

Source
shipping_options=(new_value : Array(Stripe::PaymentPagesCheckoutSessionShippingOption) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] shipping_options Object to be assigned

Source
status

The status of the Checkout Session, one of open, complete, or expired.

Source
status=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] status Object to be assigned

Source
submit_type

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.

Source
submit_type=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] submit_type Object to be assigned

Source
subscription
Source
subscription=(new_value : Stripe::CheckoutSessionSubscription | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] subscription Object to be assigned

Source
success_url

The URL the customer will be directed to after the payment or subscription creation is successful.

Source
success_url=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] success_url Object to be assigned

Source
tax_id_collection
Source
tax_id_collection=(new_value : Stripe::PaymentPagesCheckoutSessionTaxIdCollection | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] tax_id_collection Object to be assigned

Source
total_details
Source
total_details=(new_value : Stripe::CheckoutSessionTotalDetails | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] total_details Object to be assigned

Source
ui_mode

The UI mode of the Session. Defaults to hosted.

Source
ui_mode=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] ui_mode Object to be assigned

Source
url

The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. This value is only present when the session is active.

Source
url=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] url Object to be assigned

Source
valid?

Check to see if the all the properties in the model are valid @return true if the model is valid

Source