Class Source

    • Constructor Detail

      • Source

        public Source()
    • Method Detail

      • detach

        public Source detach​(java.util.Map<java.lang.String,​java.lang.Object> params)
                      throws StripeException
        Delete a specified source for a given customer.
        Throws:
        StripeException
      • retrieve

        public static Source retrieve​(java.lang.String source)
                               throws StripeException
        Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.
        Throws:
        StripeException
      • retrieve

        public static Source retrieve​(java.lang.String source,
                                      RequestOptions options)
                               throws StripeException
        Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.
        Throws:
        StripeException
      • retrieve

        public static Source retrieve​(java.lang.String source,
                                      java.util.Map<java.lang.String,​java.lang.Object> params,
                                      RequestOptions options)
                               throws StripeException
        Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.
        Throws:
        StripeException
      • update

        public Source update​(java.util.Map<java.lang.String,​java.lang.Object> params)
                      throws StripeException
        Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

        This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our payment method guides for more detail.

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

        public Source update​(java.util.Map<java.lang.String,​java.lang.Object> params,
                             RequestOptions options)
                      throws StripeException
        Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

        This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our payment method guides for more detail.

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

        public Source update​(SourceUpdateParams params)
                      throws StripeException
        Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

        This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our payment method guides for more detail.

        Throws:
        StripeException
      • update

        public Source update​(SourceUpdateParams params,
                             RequestOptions options)
                      throws StripeException
        Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

        This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our payment method guides for more detail.

        Throws:
        StripeException
      • getAmount

        public java.lang.Long getAmount()
        A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources.
      • getClientSecret

        public java.lang.String getClientSecret()
        The client secret of the source. Used for client-side retrieval using a publishable key.
      • 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 associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources.
      • getCustomer

        public java.lang.String getCustomer()
        The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer.
      • getFlow

        public java.lang.String getFlow()
        The authentication flow of the source. flow is one of redirect, receiver, code_verification, none.
      • 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.
      • getObject

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

        Equal to source.

      • getOwner

        public Source.Owner getOwner()
        Information about the owner of the payment instrument that may be used or required by particular source types.
      • getStatementDescriptor

        public java.lang.String getStatementDescriptor()
        Extra information about a source. This will appear on your customer's statement every time you charge the source.
      • getStatus

        public java.lang.String getStatus()
        The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge.
      • getType

        public java.lang.String getType()
        The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used.
      • getUsage

        public java.lang.String getUsage()
        Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned.
      • setAmount

        public void setAmount​(java.lang.Long amount)
        A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources.
      • setClientSecret

        public void setClientSecret​(java.lang.String clientSecret)
        The client secret of the source. Used for client-side retrieval using a publishable key.
      • 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 associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources.
      • setCustomer

        public void setCustomer​(java.lang.String customer)
        The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer.
      • setFlow

        public void setFlow​(java.lang.String flow)
        The authentication flow of the source. flow is one of redirect, receiver, code_verification, none.
      • setId

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

      • setOwner

        public void setOwner​(Source.Owner owner)
        Information about the owner of the payment instrument that may be used or required by particular source types.
      • setSourceOrder

        public void setSourceOrder​(Source.Order sourceOrder)
      • setStatementDescriptor

        public void setStatementDescriptor​(java.lang.String statementDescriptor)
        Extra information about a source. This will appear on your customer's statement every time you charge the source.
      • setStatus

        public void setStatus​(java.lang.String status)
        The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge.
      • setType

        public void setType​(java.lang.String type)
        The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used.
      • setUsage

        public void setUsage​(java.lang.String usage)
        Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned.
      • 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<Source>