Class CustomerSession

All Implemented Interfaces:
StripeObjectInterface

public class CustomerSession extends ApiResource
A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs) control over a customer.
  • Constructor Details

    • CustomerSession

      public CustomerSession()
  • Method Details

    • getCustomer

      public String getCustomer()
      Get ID of expandable customer object.
    • setCustomer

      public void setCustomer(String id)
    • getCustomerObject

      public Customer getCustomerObject()
      Get expanded customer.
    • setCustomerObject

      public void setCustomerObject(Customer expandableObject)
    • create

      public static CustomerSession create(Map<String,Object> params) throws StripeException
      Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
      Throws:
      StripeException
    • create

      public static CustomerSession create(Map<String,Object> params, RequestOptions options) throws StripeException
      Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
      Throws:
      StripeException
    • create

      public static CustomerSession create(CustomerSessionCreateParams params) throws StripeException
      Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
      Throws:
      StripeException
    • create

      public static CustomerSession create(CustomerSessionCreateParams params, RequestOptions options) throws StripeException
      Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
      Throws:
      StripeException
    • getClientSecret

      public String getClientSecret()
      The client secret of this customer session. Used on the client to set up secure access to the given customer.

      The client secret can be used to provide access to customer from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.

    • getExpiresAt

      public Long getExpiresAt()
      The timestamp at which this customer session will expire.
    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to customer_session.

    • setClientSecret

      public void setClientSecret(String clientSecret)
      The client secret of this customer session. Used on the client to set up secure access to the given customer.

      The client secret can be used to provide access to customer from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.

    • setExpiresAt

      public void setExpiresAt(Long expiresAt)
      The timestamp at which this customer session will expire.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to customer_session.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object