Package com.stripe.model.checkout
Class Session
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.checkout.Session
-
- All Implemented Interfaces:
HasId,StripeObjectInterface
public class Session extends ApiResource implements HasId
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSession.AutomaticTaxstatic classSession.CustomerDetailsstatic classSession.PaymentMethodOptionsThe value of the tax ID.static classSession.ShippingAddressCollectionTransaction type of the mandate.static classSession.TaxIDCollectionstatic classSession.TotalDetails-
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
-
Field Summary
-
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON
-
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
-
Constructor Summary
Constructors Constructor Description Session()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)static Sessioncreate(SessionCreateParams params)Creates a Session object.static Sessioncreate(SessionCreateParams params, RequestOptions options)Creates a Session object.static Sessioncreate(java.util.Map<java.lang.String,java.lang.Object> params)Creates a Session object.static Sessioncreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Creates a Session object.booleanequals(java.lang.Object o)java.lang.BooleangetAllowPromotionCodes()Enables user redeemable promotion codes.java.lang.LonggetAmountSubtotal()Total of all items before discounts or taxes are applied.java.lang.LonggetAmountTotal()Total of all items after discounts and taxes are applied.Session.AutomaticTaxgetAutomaticTax()java.lang.StringgetBillingAddressCollection()Describes whether Checkout should collect the customer's billing address.java.lang.StringgetCancelUrl()The URL the customer will be directed to if they decide to cancel payment and return to your website.java.lang.StringgetClientReferenceId()A unique string to reference the Checkout Session.java.lang.StringgetCurrency()Three-letter ISO currency code, in lowercase.java.lang.StringgetCustomer()Get ID of expandablecustomerobject.Session.CustomerDetailsgetCustomerDetails()The customer details including the customer's tax exempt status and the customer's tax IDs.java.lang.StringgetCustomerEmail()If provided, this value will be used when the Customer object is created.CustomergetCustomerObject()Get expandedcustomer.java.lang.StringgetId()Unique identifier for the object.LineItemCollectiongetLineItems()The line items purchased by the customer.java.lang.BooleangetLivemode()Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.java.lang.StringgetLocale()The IETF language tag of the locale Checkout is displayed in.java.util.Map<java.lang.String,java.lang.String>getMetadata()Set of key-value pairs that you can attach to an object.java.lang.StringgetMode()The mode of the Checkout Session.java.lang.StringgetObject()String representing the object's type.java.lang.StringgetPaymentIntent()Get ID of expandablepaymentIntentobject.PaymentIntentgetPaymentIntentObject()Get expandedpaymentIntent.Session.PaymentMethodOptionsgetPaymentMethodOptions()Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.java.util.List<java.lang.String>getPaymentMethodTypes()A list of the types of payment methods (e.g.java.lang.StringgetPaymentStatus()The payment status of the Checkout Session, one ofpaid,unpaid, orno_payment_required.java.lang.StringgetSetupIntent()Get ID of expandablesetupIntentobject.SetupIntentgetSetupIntentObject()Get expandedsetupIntent.ShippingDetailsgetShipping()Shipping information for this Checkout Session.Session.ShippingAddressCollectiongetShippingAddressCollection()When set, provides configuration for Checkout to collect a shipping address from a customer.java.lang.StringgetSubmitType()Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.java.lang.StringgetSubscription()Get ID of expandablesubscriptionobject.SubscriptiongetSubscriptionObject()Get expandedsubscription.java.lang.StringgetSuccessUrl()The URL the customer will be directed to after the payment or subscription creation is successful.Session.TaxIDCollectiongetTaxIdCollection()Session.TotalDetailsgetTotalDetails()Tax and discount details for the computed total amount.inthashCode()static SessionCollectionlist(SessionListParams params)Returns a list of Checkout Sessions.static SessionCollectionlist(SessionListParams params, RequestOptions options)Returns a list of Checkout Sessions.static SessionCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of Checkout Sessions.static SessionCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of Checkout Sessions.LineItemCollectionlistLineItems(SessionListLineItemsParams params)Returns a list of Line ItemsLineItemCollectionlistLineItems(SessionListLineItemsParams params, RequestOptions options)Returns a list of Line ItemsLineItemCollectionlistLineItems(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of Line ItemsLineItemCollectionlistLineItems(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of Line Itemsstatic Sessionretrieve(java.lang.String session)Retrieves a Session object.static Sessionretrieve(java.lang.String session, RequestOptions options)Retrieves a Session object.static Sessionretrieve(java.lang.String session, SessionRetrieveParams params, RequestOptions options)Retrieves a Session object.static Sessionretrieve(java.lang.String session, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Retrieves a Session object.voidsetAllowPromotionCodes(java.lang.Boolean allowPromotionCodes)Enables user redeemable promotion codes.voidsetAmountSubtotal(java.lang.Long amountSubtotal)Total of all items before discounts or taxes are applied.voidsetAmountTotal(java.lang.Long amountTotal)Total of all items after discounts and taxes are applied.voidsetAutomaticTax(Session.AutomaticTax automaticTax)voidsetBillingAddressCollection(java.lang.String billingAddressCollection)Describes whether Checkout should collect the customer's billing address.voidsetCancelUrl(java.lang.String cancelUrl)The URL the customer will be directed to if they decide to cancel payment and return to your website.voidsetClientReferenceId(java.lang.String clientReferenceId)A unique string to reference the Checkout Session.voidsetCurrency(java.lang.String currency)Three-letter ISO currency code, in lowercase.voidsetCustomer(java.lang.String id)voidsetCustomerDetails(Session.CustomerDetails customerDetails)The customer details including the customer's tax exempt status and the customer's tax IDs.voidsetCustomerEmail(java.lang.String customerEmail)If provided, this value will be used when the Customer object is created.voidsetCustomerObject(Customer expandableObject)voidsetId(java.lang.String id)Unique identifier for the object.voidsetLineItems(LineItemCollection lineItems)The line items purchased by the customer.voidsetLivemode(java.lang.Boolean livemode)Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetLocale(java.lang.String locale)The IETF language tag of the locale Checkout is displayed in.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetMode(java.lang.String mode)The mode of the Checkout Session.voidsetObject(java.lang.String object)String representing the object's type.voidsetPaymentIntent(java.lang.String id)voidsetPaymentIntentObject(PaymentIntent expandableObject)voidsetPaymentMethodOptions(Session.PaymentMethodOptions paymentMethodOptions)Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.voidsetPaymentMethodTypes(java.util.List<java.lang.String> paymentMethodTypes)A list of the types of payment methods (e.g.voidsetPaymentStatus(java.lang.String paymentStatus)The payment status of the Checkout Session, one ofpaid,unpaid, orno_payment_required.voidsetSetupIntent(java.lang.String id)voidsetSetupIntentObject(SetupIntent expandableObject)voidsetShipping(ShippingDetails shipping)Shipping information for this Checkout Session.voidsetShippingAddressCollection(Session.ShippingAddressCollection shippingAddressCollection)When set, provides configuration for Checkout to collect a shipping address from a customer.voidsetSubmitType(java.lang.String submitType)Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.voidsetSubscription(java.lang.String id)voidsetSubscriptionObject(Subscription expandableObject)voidsetSuccessUrl(java.lang.String successUrl)The URL the customer will be directed to after the payment or subscription creation is successful.voidsetTaxIdCollection(Session.TaxIDCollection taxIdCollection)voidsetTotalDetails(Session.TotalDetails totalDetails)Tax and discount details for the computed total amount.-
Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
getCustomer
public java.lang.String getCustomer()
Get ID of expandablecustomerobject.
-
setCustomer
public void setCustomer(java.lang.String id)
-
getCustomerObject
public Customer getCustomerObject()
Get expandedcustomer.
-
setCustomerObject
public void setCustomerObject(Customer expandableObject)
-
getPaymentIntent
public java.lang.String getPaymentIntent()
Get ID of expandablepaymentIntentobject.
-
setPaymentIntent
public void setPaymentIntent(java.lang.String id)
-
getPaymentIntentObject
public PaymentIntent getPaymentIntentObject()
Get expandedpaymentIntent.
-
setPaymentIntentObject
public void setPaymentIntentObject(PaymentIntent expandableObject)
-
getSetupIntent
public java.lang.String getSetupIntent()
Get ID of expandablesetupIntentobject.
-
setSetupIntent
public void setSetupIntent(java.lang.String id)
-
getSetupIntentObject
public SetupIntent getSetupIntentObject()
Get expandedsetupIntent.
-
setSetupIntentObject
public void setSetupIntentObject(SetupIntent expandableObject)
-
getSubscription
public java.lang.String getSubscription()
Get ID of expandablesubscriptionobject.
-
setSubscription
public void setSubscription(java.lang.String id)
-
getSubscriptionObject
public Subscription getSubscriptionObject()
Get expandedsubscription.
-
setSubscriptionObject
public void setSubscriptionObject(Subscription expandableObject)
-
list
public static SessionCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of Checkout Sessions.- Throws:
StripeException
-
list
public static SessionCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Returns a list of Checkout Sessions.- Throws:
StripeException
-
list
public static SessionCollection list(SessionListParams params) throws StripeException
Returns a list of Checkout Sessions.- Throws:
StripeException
-
list
public static SessionCollection list(SessionListParams params, RequestOptions options) throws StripeException
Returns a list of Checkout Sessions.- Throws:
StripeException
-
retrieve
public static Session retrieve(java.lang.String session) throws StripeException
Retrieves a Session object.- Throws:
StripeException
-
retrieve
public static Session retrieve(java.lang.String session, RequestOptions options) throws StripeException
Retrieves a Session object.- Throws:
StripeException
-
retrieve
public static Session retrieve(java.lang.String session, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves a Session object.- Throws:
StripeException
-
retrieve
public static Session retrieve(java.lang.String session, SessionRetrieveParams params, RequestOptions options) throws StripeException
Retrieves a Session object.- Throws:
StripeException
-
create
public static Session create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Creates a Session object.- Throws:
StripeException
-
create
public static Session create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Creates a Session object.- Throws:
StripeException
-
create
public static Session create(SessionCreateParams params) throws StripeException
Creates a Session object.- Throws:
StripeException
-
create
public static Session create(SessionCreateParams params, RequestOptions options) throws StripeException
Creates a Session object.- Throws:
StripeException
-
listLineItems
public LineItemCollection listLineItems(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of Line Items- Throws:
StripeException
-
listLineItems
public LineItemCollection listLineItems(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Returns a list of Line Items- Throws:
StripeException
-
listLineItems
public LineItemCollection listLineItems(SessionListLineItemsParams params) throws StripeException
Returns a list of Line Items- Throws:
StripeException
-
listLineItems
public LineItemCollection listLineItems(SessionListLineItemsParams params, RequestOptions options) throws StripeException
Returns a list of Line Items- Throws:
StripeException
-
getAllowPromotionCodes
public java.lang.Boolean getAllowPromotionCodes()
Enables user redeemable promotion codes.
-
getAmountSubtotal
public java.lang.Long getAmountSubtotal()
Total of all items before discounts or taxes are applied.
-
getAmountTotal
public java.lang.Long getAmountTotal()
Total of all items after discounts and taxes are applied.
-
getAutomaticTax
public Session.AutomaticTax getAutomaticTax()
-
getBillingAddressCollection
public java.lang.String getBillingAddressCollection()
Describes whether Checkout should collect the customer's billing address.One of
auto, orrequired.
-
getCancelUrl
public java.lang.String getCancelUrl()
The URL the customer will be directed to if they decide to cancel payment and return to your website.
-
getClientReferenceId
public java.lang.String getClientReferenceId()
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.
-
getCurrency
public java.lang.String getCurrency()
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
getCustomerDetails
public Session.CustomerDetails getCustomerDetails()
The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions inpaymentorsubscriptionmode.
-
getCustomerEmail
public java.lang.String getCustomerEmail()
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 thecustomerattribute.
-
getLineItems
public LineItemCollection getLineItems()
The line items purchased by the customer.
-
getLivemode
public java.lang.Boolean getLivemode()
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
getLocale
public java.lang.String getLocale()
The IETF language tag of the locale Checkout is displayed in. If blank orauto, the browser's locale is used.One of
auto,bg,cs,da,de,el,en,en-GB,es,es-419,et,fi,fr,fr-CA,hu,id,it,ja,lt,lv,ms,mt,nb,nl,pl,pt,pt-BR,ro,ru,sk,sl,sv,th,tr,zh,zh-HK, orzh-TW.
-
getMetadata
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
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.
-
getMode
public java.lang.String getMode()
The mode of the Checkout Session.One of
payment,setup, orsubscription.
-
getObject
public java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.Equal to
checkout.session.
-
getPaymentMethodOptions
public Session.PaymentMethodOptions getPaymentMethodOptions()
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
-
getPaymentMethodTypes
public java.util.List<java.lang.String> getPaymentMethodTypes()
A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
-
getPaymentStatus
public java.lang.String getPaymentStatus()
The payment status of the Checkout Session, one ofpaid,unpaid, orno_payment_required. You can use this value to decide when to fulfill your customer's order.
-
getShipping
public ShippingDetails getShipping()
Shipping information for this Checkout Session.
-
getShippingAddressCollection
public Session.ShippingAddressCollection getShippingAddressCollection()
When set, provides configuration for Checkout to collect a shipping address from a customer.
-
getSubmitType
public java.lang.String getSubmitType()
Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.submit_typecan only be specified on Checkout Sessions inpaymentmode, but not Checkout Sessions insubscriptionorsetupmode.One of
auto,book,donate, orpay.
-
getSuccessUrl
public java.lang.String getSuccessUrl()
The URL the customer will be directed to after the payment or subscription creation is successful.
-
getTaxIdCollection
public Session.TaxIDCollection getTaxIdCollection()
-
getTotalDetails
public Session.TotalDetails getTotalDetails()
Tax and discount details for the computed total amount.
-
setAllowPromotionCodes
public void setAllowPromotionCodes(java.lang.Boolean allowPromotionCodes)
Enables user redeemable promotion codes.
-
setAmountSubtotal
public void setAmountSubtotal(java.lang.Long amountSubtotal)
Total of all items before discounts or taxes are applied.
-
setAmountTotal
public void setAmountTotal(java.lang.Long amountTotal)
Total of all items after discounts and taxes are applied.
-
setAutomaticTax
public void setAutomaticTax(Session.AutomaticTax automaticTax)
-
setBillingAddressCollection
public void setBillingAddressCollection(java.lang.String billingAddressCollection)
Describes whether Checkout should collect the customer's billing address.One of
auto, orrequired.
-
setCancelUrl
public void setCancelUrl(java.lang.String cancelUrl)
The URL the customer will be directed to if they decide to cancel payment and return to your website.
-
setClientReferenceId
public void setClientReferenceId(java.lang.String clientReferenceId)
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.
-
setCurrency
public void setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
setCustomerDetails
public void setCustomerDetails(Session.CustomerDetails customerDetails)
The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions inpaymentorsubscriptionmode.
-
setCustomerEmail
public void setCustomerEmail(java.lang.String customerEmail)
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 thecustomerattribute.
-
setId
public void setId(java.lang.String id)
Unique identifier for the object. Used to pass toredirectToCheckoutin Stripe.js.
-
setLineItems
public void setLineItems(LineItemCollection lineItems)
The line items purchased by the customer.
-
setLivemode
public void setLivemode(java.lang.Boolean livemode)
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
setLocale
public void setLocale(java.lang.String locale)
The IETF language tag of the locale Checkout is displayed in. If blank orauto, the browser's locale is used.One of
auto,bg,cs,da,de,el,en,en-GB,es,es-419,et,fi,fr,fr-CA,hu,id,it,ja,lt,lv,ms,mt,nb,nl,pl,pt,pt-BR,ro,ru,sk,sl,sv,th,tr,zh,zh-HK, orzh-TW.
-
setMetadata
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
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.
-
setMode
public void setMode(java.lang.String mode)
The mode of the Checkout Session.One of
payment,setup, orsubscription.
-
setObject
public void setObject(java.lang.String object)
String representing the object's type. Objects of the same type share the same value.Equal to
checkout.session.
-
setPaymentMethodOptions
public void setPaymentMethodOptions(Session.PaymentMethodOptions paymentMethodOptions)
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
-
setPaymentMethodTypes
public void setPaymentMethodTypes(java.util.List<java.lang.String> paymentMethodTypes)
A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
-
setPaymentStatus
public void setPaymentStatus(java.lang.String paymentStatus)
The payment status of the Checkout Session, one ofpaid,unpaid, orno_payment_required. You can use this value to decide when to fulfill your customer's order.
-
setShipping
public void setShipping(ShippingDetails shipping)
Shipping information for this Checkout Session.
-
setShippingAddressCollection
public void setShippingAddressCollection(Session.ShippingAddressCollection shippingAddressCollection)
When set, provides configuration for Checkout to collect a shipping address from a customer.
-
setSubmitType
public void setSubmitType(java.lang.String submitType)
Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.submit_typecan only be specified on Checkout Sessions inpaymentmode, but not Checkout Sessions insubscriptionorsetupmode.One of
auto,book,donate, orpay.
-
setSuccessUrl
public void setSuccessUrl(java.lang.String successUrl)
The URL the customer will be directed to after the payment or subscription creation is successful.
-
setTaxIdCollection
public void setTaxIdCollection(Session.TaxIDCollection taxIdCollection)
-
setTotalDetails
public void setTotalDetails(Session.TotalDetails totalDetails)
Tax and discount details for the computed total amount.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-