Class ConfirmationToken

All Implemented Interfaces:
HasId, StripeActiveObject, StripeObjectInterface

public class ConfirmationToken extends ApiResource implements HasId
ConfirmationTokens help transport client side data collected by Stripe JS over to your server for confirming a PaymentIntent or SetupIntent. If the confirmation is successful, values present on the ConfirmationToken are written onto the Intent.

To learn more about how to use ConfirmationToken, visit the related guides: - Finalize payments on the server - Build two-step confirmation.

  • Constructor Details

    • ConfirmationToken

      public ConfirmationToken()
  • Method Details

    • retrieve

      public static ConfirmationToken retrieve(String confirmationToken) throws StripeException
      Retrieves an existing ConfirmationToken object.
      Throws:
      StripeException
    • retrieve

      public static ConfirmationToken retrieve(String confirmationToken, RequestOptions options) throws StripeException
      Retrieves an existing ConfirmationToken object.
      Throws:
      StripeException
    • retrieve

      public static ConfirmationToken retrieve(String confirmationToken, Map<String,Object> params, RequestOptions options) throws StripeException
      Retrieves an existing ConfirmationToken object.
      Throws:
      StripeException
    • retrieve

      public static ConfirmationToken retrieve(String confirmationToken, ConfirmationTokenRetrieveParams params, RequestOptions options) throws StripeException
      Retrieves an existing ConfirmationToken object.
      Throws:
      StripeException
    • setResponseGetter

      public void setResponseGetter(StripeResponseGetter responseGetter)
      Description copied from interface: StripeActiveObject
      Method is used by the containing object or StripeResponseGetter implementations to set the StripeResponseGetter instance used to make further requests.
      Specified by:
      setResponseGetter in interface StripeActiveObject
      Overrides:
      setResponseGetter in class ApiResource
      Parameters:
      responseGetter - the StripeResponseGetter instance to use for making further requests.
    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getExpiresAt

      public Long getExpiresAt()
      Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent.
    • 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.
    • getMandateData

      public ConfirmationToken.MandateData getMandateData()
      Data used for generating a Mandate.
    • getObject

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

      Equal to confirmation_token.

    • getPaymentIntent

      public String getPaymentIntent()
      ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
    • getPaymentMethodPreview

      public ConfirmationToken.PaymentMethodPreview getPaymentMethodPreview()
      Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken.
    • getReturnUrl

      public String getReturnUrl()
      Return URL used to confirm the Intent.
    • getSetupFutureUsage

      public String getSetupFutureUsage()
      Indicates that you intend to make future payments with this ConfirmationToken's payment method.

      The presence of this property will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.

      One of off_session, or on_session.

    • getSetupIntent

      public String getSetupIntent()
      ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
    • getShipping

      public ConfirmationToken.Shipping getShipping()
      Shipping information collected on this ConfirmationToken.
    • getUseStripeSdk

      public Boolean getUseStripeSdk()
      Indicates whether the Stripe SDK is used to handle confirmation flow. Defaults to true on ConfirmationToken.
    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setExpiresAt

      public void setExpiresAt(Long expiresAt)
      Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • 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.
    • setMandateData

      public void setMandateData(ConfirmationToken.MandateData mandateData)
      Data used for generating a Mandate.
    • setObject

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

      Equal to confirmation_token.

    • setPaymentIntent

      public void setPaymentIntent(String paymentIntent)
      ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
    • setPaymentMethodPreview

      public void setPaymentMethodPreview(ConfirmationToken.PaymentMethodPreview paymentMethodPreview)
      Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken.
    • setReturnUrl

      public void setReturnUrl(String returnUrl)
      Return URL used to confirm the Intent.
    • setSetupFutureUsage

      public void setSetupFutureUsage(String setupFutureUsage)
      Indicates that you intend to make future payments with this ConfirmationToken's payment method.

      The presence of this property will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.

      One of off_session, or on_session.

    • setSetupIntent

      public void setSetupIntent(String setupIntent)
      ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
    • setShipping

      public void setShipping(ConfirmationToken.Shipping shipping)
      Shipping information collected on this ConfirmationToken.
    • setUseStripeSdk

      public void setUseStripeSdk(Boolean useStripeSdk)
      Indicates whether the Stripe SDK is used to handle confirmation flow. Defaults to true on ConfirmationToken.
    • 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
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId