Class Topup

All Implemented Interfaces:
BalanceTransactionSource, HasId, MetadataStore<Topup>, StripeActiveObject, StripeObjectInterface

public class Topup extends ApiResource implements MetadataStore<Topup>, BalanceTransactionSource
To top up your Stripe balance, you create a top-up object. You can retrieve individual top-ups, as well as list all top-ups. Top-ups are identified by a unique, random ID.

Related guide: Topping up your platform account

  • Constructor Details

    • Topup

      public Topup()
  • Method Details

    • getBalanceTransaction

      public String getBalanceTransaction()
      Get ID of expandable balanceTransaction object.
    • setBalanceTransaction

      public void setBalanceTransaction(String id)
    • getBalanceTransactionObject

      public BalanceTransaction getBalanceTransactionObject()
      Get expanded balanceTransaction.
    • setBalanceTransactionObject

      public void setBalanceTransactionObject(BalanceTransaction expandableObject)
    • cancel

      public Topup cancel() throws StripeException
      Cancels a top-up. Only pending top-ups can be canceled.
      Throws:
      StripeException
    • cancel

      public Topup cancel(RequestOptions options) throws StripeException
      Cancels a top-up. Only pending top-ups can be canceled.
      Throws:
      StripeException
    • cancel

      public Topup cancel(Map<String,Object> params) throws StripeException
      Cancels a top-up. Only pending top-ups can be canceled.
      Throws:
      StripeException
    • cancel

      public Topup cancel(Map<String,Object> params, RequestOptions options) throws StripeException
      Cancels a top-up. Only pending top-ups can be canceled.
      Throws:
      StripeException
    • cancel

      public Topup cancel(TopupCancelParams params) throws StripeException
      Cancels a top-up. Only pending top-ups can be canceled.
      Throws:
      StripeException
    • cancel

      public Topup cancel(TopupCancelParams params, RequestOptions options) throws StripeException
      Cancels a top-up. Only pending top-ups can be canceled.
      Throws:
      StripeException
    • create

      public static Topup create(Map<String,Object> params) throws StripeException
      Top up the balance of an account.
      Throws:
      StripeException
    • create

      public static Topup create(Map<String,Object> params, RequestOptions options) throws StripeException
      Top up the balance of an account.
      Throws:
      StripeException
    • create

      public static Topup create(TopupCreateParams params) throws StripeException
      Top up the balance of an account.
      Throws:
      StripeException
    • create

      public static Topup create(TopupCreateParams params, RequestOptions options) throws StripeException
      Top up the balance of an account.
      Throws:
      StripeException
    • list

      public static TopupCollection list(Map<String,Object> params) throws StripeException
      Returns a list of top-ups.
      Throws:
      StripeException
    • list

      public static TopupCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      Returns a list of top-ups.
      Throws:
      StripeException
    • list

      public static TopupCollection list(TopupListParams params) throws StripeException
      Returns a list of top-ups.
      Throws:
      StripeException
    • list

      public static TopupCollection list(TopupListParams params, RequestOptions options) throws StripeException
      Returns a list of top-ups.
      Throws:
      StripeException
    • retrieve

      public static Topup retrieve(String topup) throws StripeException
      Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information.
      Throws:
      StripeException
    • retrieve

      public static Topup retrieve(String topup, RequestOptions options) throws StripeException
      Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information.
      Throws:
      StripeException
    • retrieve

      public static Topup retrieve(String topup, Map<String,Object> params, RequestOptions options) throws StripeException
      Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information.
      Throws:
      StripeException
    • retrieve

      public static Topup retrieve(String topup, TopupRetrieveParams params, RequestOptions options) throws StripeException
      Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information.
      Throws:
      StripeException
    • update

      public Topup update(Map<String,Object> params) throws StripeException
      Updates the metadata of a top-up. Other top-up details are not editable by design.
      Specified by:
      update in interface MetadataStore<Topup>
      Throws:
      StripeException
    • update

      public Topup update(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates the metadata of a top-up. Other top-up details are not editable by design.
      Specified by:
      update in interface MetadataStore<Topup>
      Throws:
      StripeException
    • update

      public Topup update(TopupUpdateParams params) throws StripeException
      Updates the metadata of a top-up. Other top-up details are not editable by design.
      Throws:
      StripeException
    • update

      public Topup update(TopupUpdateParams params, RequestOptions options) throws StripeException
      Updates the metadata of a top-up. Other top-up details are not editable by design.
      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.
    • getAmount

      public Long getAmount()
      Amount transferred.
    • getCreated

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

      public String getCurrency()
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • getDescription

      public String getDescription()
      An arbitrary string attached to the object. Often useful for displaying to users.
    • getExpectedAvailabilityDate

      public Long getExpectedAvailabilityDate()
      Date the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up.
    • getFailureCode

      public String getFailureCode()
      Error code explaining reason for top-up failure if available (see the errors section for a list of codes).
    • getFailureMessage

      public String getFailureMessage()
      Message to user further explaining reason for top-up failure if available.
    • 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 topup.

    • getSource

      public Source getSource()
      The source field is deprecated. It might not always be present in the API response.
    • getStatementDescriptor

      public String getStatementDescriptor()
      Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter.
    • getStatus

      public String getStatus()
      The status of the top-up is either canceled, failed, pending, reversed, or succeeded.

      One of canceled, failed, pending, reversed, or succeeded.

    • getTransferGroup

      public String getTransferGroup()
      A string that identifies this top-up as part of a group.
    • setAmount

      public void setAmount(Long amount)
      Amount transferred.
    • setCreated

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

      public void setCurrency(String currency)
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • setDescription

      public void setDescription(String description)
      An arbitrary string attached to the object. Often useful for displaying to users.
    • setExpectedAvailabilityDate

      public void setExpectedAvailabilityDate(Long expectedAvailabilityDate)
      Date the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up.
    • setFailureCode

      public void setFailureCode(String failureCode)
      Error code explaining reason for top-up failure if available (see the errors section for a list of codes).
    • setFailureMessage

      public void setFailureMessage(String failureMessage)
      Message to user further explaining reason for top-up failure if available.
    • 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.
    • setMetadata

      public void setMetadata(Map<String,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.
    • setObject

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

      Equal to topup.

    • setSource

      public void setSource(Source source)
      The source field is deprecated. It might not always be present in the API response.
    • setStatementDescriptor

      public void setStatementDescriptor(String statementDescriptor)
      Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter.
    • setStatus

      public void setStatus(String status)
      The status of the top-up is either canceled, failed, pending, reversed, or succeeded.

      One of canceled, failed, pending, reversed, or succeeded.

    • setTransferGroup

      public void setTransferGroup(String transferGroup)
      A string that identifies this top-up as part of a group.
    • 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
    • getMetadata

      public Map<String,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.
      Specified by:
      getMetadata in interface MetadataStore<Topup>