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 class
Session.CustomerDetails
static class
Session.PaymentMethodOptions
The value of the tax ID.static class
Session.ShippingAddressCollection
Transaction type of the mandate.static class
Session.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 boolean
canEqual(java.lang.Object other)
static Session
create(SessionCreateParams params)
Creates a Session object.static Session
create(SessionCreateParams params, RequestOptions options)
Creates a Session object.static Session
create(java.util.Map<java.lang.String,java.lang.Object> params)
Creates a Session object.static Session
create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Creates a Session object.boolean
equals(java.lang.Object o)
java.lang.Boolean
getAllowPromotionCodes()
Enables user redeemable promotion codes.java.lang.Long
getAmountSubtotal()
Total of all items before discounts or taxes are applied.java.lang.Long
getAmountTotal()
Total of all items after discounts and taxes are applied.java.lang.String
getBillingAddressCollection()
Describes whether Checkout should collect the customer's billing address.java.lang.String
getCancelUrl()
The URL the customer will be directed to if they decide to cancel payment and return to your website.java.lang.String
getClientReferenceId()
A unique string to reference the Checkout Session.java.lang.String
getCurrency()
Three-letter ISO currency code, in lowercase.java.lang.String
getCustomer()
Get ID of expandablecustomer
object.Session.CustomerDetails
getCustomerDetails()
The customer details including the customer's tax exempt status and the customer's tax IDs.java.lang.String
getCustomerEmail()
If provided, this value will be used when the Customer object is created.Customer
getCustomerObject()
Get expandedcustomer
.java.lang.String
getId()
Unique identifier for the object.LineItemCollection
getLineItems()
The line items purchased by the customer.java.lang.Boolean
getLivemode()
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.java.lang.String
getLocale()
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.String
getMode()
The mode of the Checkout Session.java.lang.String
getObject()
String representing the object's type.java.lang.String
getPaymentIntent()
Get ID of expandablepaymentIntent
object.PaymentIntent
getPaymentIntentObject()
Get expandedpaymentIntent
.Session.PaymentMethodOptions
getPaymentMethodOptions()
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.String
getPaymentStatus()
The payment status of the Checkout Session, one ofpaid
,unpaid
, orno_payment_required
.java.lang.String
getSetupIntent()
Get ID of expandablesetupIntent
object.SetupIntent
getSetupIntentObject()
Get expandedsetupIntent
.ShippingDetails
getShipping()
Shipping information for this Checkout Session.Session.ShippingAddressCollection
getShippingAddressCollection()
When set, provides configuration for Checkout to collect a shipping address from a customer.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.java.lang.String
getSubscription()
Get ID of expandablesubscription
object.Subscription
getSubscriptionObject()
Get expandedsubscription
.java.lang.String
getSuccessUrl()
The URL the customer will be directed to after the payment or subscription creation is successful.Session.TotalDetails
getTotalDetails()
Tax and discount details for the computed total amount.int
hashCode()
static SessionCollection
list(SessionListParams params)
Returns a list of Checkout Sessions.static SessionCollection
list(SessionListParams params, RequestOptions options)
Returns a list of Checkout Sessions.static SessionCollection
list(java.util.Map<java.lang.String,java.lang.Object> params)
Returns a list of Checkout Sessions.static SessionCollection
list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Returns a list of Checkout Sessions.LineItemCollection
listLineItems(SessionListLineItemsParams params)
Returns a list of Line ItemsLineItemCollection
listLineItems(SessionListLineItemsParams params, RequestOptions options)
Returns a list of Line ItemsLineItemCollection
listLineItems(java.util.Map<java.lang.String,java.lang.Object> params)
Returns a list of Line ItemsLineItemCollection
listLineItems(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Returns a list of Line Itemsstatic Session
retrieve(java.lang.String session)
Retrieves a Session object.static Session
retrieve(java.lang.String session, RequestOptions options)
Retrieves a Session object.static Session
retrieve(java.lang.String session, SessionRetrieveParams params, RequestOptions options)
Retrieves a Session object.static Session
retrieve(java.lang.String session, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Retrieves a Session object.void
setAllowPromotionCodes(java.lang.Boolean allowPromotionCodes)
Enables user redeemable promotion codes.void
setAmountSubtotal(java.lang.Long amountSubtotal)
Total of all items before discounts or taxes are applied.void
setAmountTotal(java.lang.Long amountTotal)
Total of all items after discounts and taxes are applied.void
setBillingAddressCollection(java.lang.String billingAddressCollection)
Describes whether Checkout should collect the customer's billing address.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.void
setClientReferenceId(java.lang.String clientReferenceId)
A unique string to reference the Checkout Session.void
setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase.void
setCustomer(java.lang.String id)
void
setCustomerDetails(Session.CustomerDetails customerDetails)
The customer details including the customer's tax exempt status and the customer's tax IDs.void
setCustomerEmail(java.lang.String customerEmail)
If provided, this value will be used when the Customer object is created.void
setCustomerObject(Customer expandableObject)
void
setId(java.lang.String id)
Unique identifier for the object.void
setLineItems(LineItemCollection lineItems)
The line items purchased by the customer.void
setLivemode(java.lang.Boolean livemode)
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
setLocale(java.lang.String locale)
The IETF language tag of the locale Checkout is displayed in.void
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach to an object.void
setMode(java.lang.String mode)
The mode of the Checkout Session.void
setObject(java.lang.String object)
String representing the object's type.void
setPaymentIntent(java.lang.String id)
void
setPaymentIntentObject(PaymentIntent expandableObject)
void
setPaymentMethodOptions(Session.PaymentMethodOptions paymentMethodOptions)
Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.void
setPaymentMethodTypes(java.util.List<java.lang.String> paymentMethodTypes)
A list of the types of payment methods (e.g.void
setPaymentStatus(java.lang.String paymentStatus)
The payment status of the Checkout Session, one ofpaid
,unpaid
, orno_payment_required
.void
setSetupIntent(java.lang.String id)
void
setSetupIntentObject(SetupIntent expandableObject)
void
setShipping(ShippingDetails shipping)
Shipping information for this Checkout Session.void
setShippingAddressCollection(Session.ShippingAddressCollection shippingAddressCollection)
When set, provides configuration for Checkout to collect a shipping address from a customer.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.void
setSubscription(java.lang.String id)
void
setSubscriptionObject(Subscription expandableObject)
void
setSuccessUrl(java.lang.String successUrl)
The URL the customer will be directed to after the payment or subscription creation is successful.void
setTotalDetails(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 expandablecustomer
object.
-
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 expandablepaymentIntent
object.
-
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 expandablesetupIntent
object.
-
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 expandablesubscription
object.
-
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.
-
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 inpayment
orsubscription
mode.
-
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 thecustomer
attribute.
-
getLineItems
public LineItemCollection getLineItems()
The line items purchased by the customer.
-
getLivemode
public java.lang.Boolean getLivemode()
Has the valuetrue
if the object exists in live mode or the valuefalse
if 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_type
can only be specified on Checkout Sessions inpayment
mode, but not Checkout Sessions insubscription
orsetup
mode.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.
-
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.
-
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 inpayment
orsubscription
mode.
-
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 thecustomer
attribute.
-
setId
public void setId(java.lang.String id)
Unique identifier for the object. Used to pass toredirectToCheckout
in 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 valuetrue
if the object exists in live mode or the valuefalse
if 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_type
can only be specified on Checkout Sessions inpayment
mode, but not Checkout Sessions insubscription
orsetup
mode.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.
-
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:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-