Class Customer

    • Constructor Detail

      • Customer

        public Customer()
    • Method Detail

      • getDefaultSource

        public java.lang.String getDefaultSource()
        Get ID of expandable defaultSource object.
      • setDefaultSource

        public void setDefaultSource​(java.lang.String id)
      • getDefaultSourceObject

        public PaymentSource getDefaultSourceObject()
        Get expanded defaultSource.
      • setDefaultSourceObject

        public void setDefaultSourceObject​(PaymentSource expandableObject)
      • list

        public static CustomerCollection list​(java.util.Map<java.lang.String,​java.lang.Object> params)
                                       throws StripeException
        Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
        Throws:
        StripeException
      • list

        public static CustomerCollection list​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                              RequestOptions options)
                                       throws StripeException
        Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
        Throws:
        StripeException
      • update

        public Customer update​(java.util.Map<java.lang.String,​java.lang.Object> params)
                        throws StripeException
        Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.

        This request accepts mostly the same arguments as the customer creation call.

        Specified by:
        update in interface MetadataStore<Customer>
        Throws:
        StripeException
      • update

        public Customer update​(java.util.Map<java.lang.String,​java.lang.Object> params,
                               RequestOptions options)
                        throws StripeException
        Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.

        This request accepts mostly the same arguments as the customer creation call.

        Specified by:
        update in interface MetadataStore<Customer>
        Throws:
        StripeException
      • update

        public Customer update​(CustomerUpdateParams params)
                        throws StripeException
        Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.

        This request accepts mostly the same arguments as the customer creation call.

        Throws:
        StripeException
      • update

        public Customer update​(CustomerUpdateParams params,
                               RequestOptions options)
                        throws StripeException
        Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.

        This request accepts mostly the same arguments as the customer creation call.

        Throws:
        StripeException
      • delete

        public Customer delete()
                        throws StripeException
        Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
        Throws:
        StripeException
      • delete

        public Customer delete​(java.util.Map<java.lang.String,​java.lang.Object> params)
                        throws StripeException
        Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
        Throws:
        StripeException
      • delete

        public Customer delete​(java.util.Map<java.lang.String,​java.lang.Object> params,
                               RequestOptions options)
                        throws StripeException
        Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
        Throws:
        StripeException
      • deleteDiscount

        public Discount deleteDiscount​(java.util.Map<java.lang.String,​java.lang.Object> params)
                                throws StripeException
        Removes the currently applied discount on a customer.
        Throws:
        StripeException
      • getAddress

        public Address getAddress()
        The customer's address.
      • getBalance

        public java.lang.Long getBalance()
        Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.
      • getCreated

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

        public java.lang.String getCurrency()
        Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes.
      • getDeleted

        public java.lang.Boolean getDeleted()
        Always true for a deleted object.
      • getDelinquent

        public java.lang.Boolean getDelinquent()
        When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice isn't paid by its due date.

        If an invoice is marked uncollectible by dunning, delinquent doesn't get reset to false.

      • getDescription

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

        public Discount getDiscount()
        Describes the current discount active on the customer, if there is one.
      • getEmail

        public java.lang.String getEmail()
        The customer's email address.
      • getInvoicePrefix

        public java.lang.String getInvoicePrefix()
        The prefix for the customer used to generate unique invoice numbers.
      • getLivemode

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

        public java.lang.String getName()
        The customer's full name or business name.
      • getNextInvoiceSequence

        public java.lang.Long getNextInvoiceSequence()
        The suffix of the customer's next invoice number, e.g., 0001.
      • getObject

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

        Equal to customer.

      • getPhone

        public java.lang.String getPhone()
        The customer's phone number.
      • getPreferredLocales

        public java.util.List<java.lang.String> getPreferredLocales()
        The customer's preferred locales (languages), ordered by preference.
      • getShipping

        public ShippingDetails getShipping()
        Mailing and shipping address for the customer. Appears on invoices emailed to this customer.
      • getSubscriptions

        public SubscriptionCollection getSubscriptions()
        The customer's current subscriptions, if any.
      • getTaxExempt

        public java.lang.String getTaxExempt()
        Describes the customer's tax exemption status. One of none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the text "Reverse charge".
      • setAddress

        public void setAddress​(Address address)
        The customer's address.
      • setBalance

        public void setBalance​(java.lang.Long balance)
        Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.
      • setCreated

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

        public void setCurrency​(java.lang.String currency)
        Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes.
      • setDeleted

        public void setDeleted​(java.lang.Boolean deleted)
        Always true for a deleted object.
      • setDelinquent

        public void setDelinquent​(java.lang.Boolean delinquent)
        When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice isn't paid by its due date.

        If an invoice is marked uncollectible by dunning, delinquent doesn't get reset to false.

      • setDescription

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

        public void setDiscount​(Discount discount)
        Describes the current discount active on the customer, if there is one.
      • setEmail

        public void setEmail​(java.lang.String email)
        The customer's email address.
      • setId

        public void setId​(java.lang.String id)
        Unique identifier for the object.
      • setInvoicePrefix

        public void setInvoicePrefix​(java.lang.String invoicePrefix)
        The prefix for the customer used to generate unique invoice numbers.
      • setLivemode

        public void setLivemode​(java.lang.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​(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.
      • setName

        public void setName​(java.lang.String name)
        The customer's full name or business name.
      • setNextInvoiceSequence

        public void setNextInvoiceSequence​(java.lang.Long nextInvoiceSequence)
        The suffix of the customer's next invoice number, e.g., 0001.
      • 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 customer.

      • setPhone

        public void setPhone​(java.lang.String phone)
        The customer's phone number.
      • setPreferredLocales

        public void setPreferredLocales​(java.util.List<java.lang.String> preferredLocales)
        The customer's preferred locales (languages), ordered by preference.
      • setShipping

        public void setShipping​(ShippingDetails shipping)
        Mailing and shipping address for the customer. Appears on invoices emailed to this customer.
      • setSubscriptions

        public void setSubscriptions​(SubscriptionCollection subscriptions)
        The customer's current subscriptions, if any.
      • setTaxExempt

        public void setTaxExempt​(java.lang.String taxExempt)
        Describes the customer's tax exemption status. One of none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the text "Reverse charge".
      • setTaxIds

        public void setTaxIds​(TaxIdCollection taxIds)
        The customer's tax IDs.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getId

        public java.lang.String getId()
        Unique identifier for the object.
        Specified by:
        getId in interface HasId
      • 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.
        Specified by:
        getMetadata in interface MetadataStore<Customer>