CheckoutSession

Struct CheckoutSession 

Source
pub struct CheckoutSession {
Show 46 fields pub created_at: DateTime<Utc>, pub modified_at: Option<DateTime<Utc>>, pub id: Uuid, pub payment_processor: PaymentProcessor, pub status: CheckoutSessionStatus, pub client_secret: String, pub url: Url, pub expires_at: DateTime<Utc>, pub success_url: Url, pub embed_origin: Option<String>, pub amount: u32, pub discount_amount: u32, pub net_amount: u32, pub tax_amount: Option<u32>, pub total_amount: u32, pub currency: String, pub product_id: Uuid, pub product_price_id: Uuid, pub discount_id: Option<Uuid>, pub allow_discount_codes: bool, pub require_billing_address: bool, pub is_discount_applicable: bool, pub is_free_product_price: bool, pub is_payment_required: bool, pub is_payment_setup_required: bool, pub is_payment_form_required: bool, pub customer_id: Option<Uuid>, pub is_business_customer: bool, pub customer_name: Option<String>, pub customer_email: Option<String>, pub customer_ip_address: Option<String>, pub customer_billing_name: Option<String>, pub customer_billing_address: Option<CustomerBillingAddress>, pub customer_tax_id: Option<String>, pub payment_processor_metadata: HashMap<String, String>, pub billing_address_fields: BillingAddressFields, pub metadata: HashMap<String, String>, pub external_customer_id: Option<String>, pub products: Vec<CheckoutProduct>, pub product: CheckoutProduct, pub product_price: Price, pub discount: Option<Discount>, pub subscription_id: Option<Uuid>, pub attached_custom_fields: Vec<AttachedCustomField>, pub customer_metadata: HashMap<String, String>, pub custom_field_data: HashMap<String, Option<String>>,
}

Fields§

§created_at: DateTime<Utc>

Creation timestamp of the object.

§modified_at: Option<DateTime<Utc>>

Last modification timestamp of the object.

§id: Uuid

The ID of the object.

§payment_processor: PaymentProcessor

Payment processor used.

§status: CheckoutSessionStatus

Status of the checkout session.

§client_secret: String

Client secret used to update and complete the checkout session from the client.

§url: Url

URL where the customer can access the checkout session.

§expires_at: DateTime<Utc>

Expiration date and time of the checkout session.

§success_url: Url§embed_origin: Option<String>

When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page.

§amount: u32

Amount in cents, before discounts and taxes.

§discount_amount: u32

Discount amount in cents.

§net_amount: u32

Amount in cents, after discounts but before taxes.

§tax_amount: Option<u32>

Sales tax amount in cents. If null, it means there is no enough information yet to calculate it.

§total_amount: u32

Amount in cents, after discounts and taxes.

§currency: String

Currency code of the checkout session.

§product_id: Uuid

ID of the product to checkout.

§product_price_id: Uuid

ID of the product price to checkout.

§discount_id: Option<Uuid>

ID of the discount applied to the checkout.

§allow_discount_codes: bool

Whether to allow the customer to apply discount codes. If you apply a discount through discount_id, it’ll still be applied, but the customer won’t be able to change it.

§require_billing_address: bool

Whether to require the customer to fill their full billing address, instead of just the country. Customers in the US will always be required to fill their full address, regardless of this setting. If you preset the billing address, this setting will be automatically set to true.

§is_discount_applicable: bool

Whether the discount is applicable to the checkout. Typically, free and custom prices are not discountable.

§is_free_product_price: bool

Whether the product price is free, regardless of discounts.

§is_payment_required: bool

Whether the checkout requires payment, e.g. in case of free products or discounts that cover the total amount.

§is_payment_setup_required: bool

Whether the checkout requires setting up a payment method, regardless of the amount, e.g. subscriptions that have first free cycles.

§is_payment_form_required: bool

Whether the checkout requires a payment form, whether because of a payment or payment method setup.

§customer_id: Option<Uuid>§is_business_customer: bool

Whether the customer is a business or an individual. If true, the customer will be required to fill their full billing address and billing name.

§customer_name: Option<String>

Name of the customer.

§customer_email: Option<String>

Email address of the customer.

§customer_ip_address: Option<String>§customer_billing_name: Option<String>§customer_billing_address: Option<CustomerBillingAddress>

Billing address of the customer.

§customer_tax_id: Option<String>§payment_processor_metadata: HashMap<String, String>§billing_address_fields: BillingAddressFields

Determine which billing address fields should be disabled, optional or required in the checkout form.

§metadata: HashMap<String, String>§external_customer_id: Option<String>§products: Vec<CheckoutProduct>

List of products available to select.

§product: CheckoutProduct

Product selected to checkout.

§product_price: Price

Price of the selected product.

§discount: Option<Discount>

Schema for a percentage discount that is applied on every invoice for a certain number of months.

§subscription_id: Option<Uuid>§attached_custom_fields: Vec<AttachedCustomField>§customer_metadata: HashMap<String, String>§custom_field_data: HashMap<String, Option<String>>

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for CheckoutSession

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,