Package com.stripe.model
Class Source
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.Source
-
- All Implemented Interfaces:
HasId
,MetadataStore<Source>
,PaymentSource
public class Source extends ApiResource implements PaymentSource, MetadataStore<Source>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Source.AchCreditTransfer
static class
Source.AchDebit
static class
Source.Alipay
static class
Source.Bancontact
static class
Source.Card
static class
Source.CardPresent
static class
Source.CodeVerificationFlow
static class
Source.Eps
static class
Source.Giropay
static class
Source.Ideal
static class
Source.Multibanco
static class
Source.Owner
static class
Source.P24
static class
Source.ReceiverFlow
static class
Source.RedirectFlow
static class
Source.SepaDebit
static class
Source.Sofort
static class
Source.ThreeDSecure
static class
Source.Wechat
-
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod, ApiResource.RequestType
-
-
Field Summary
-
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON
-
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
-
Constructor Summary
Constructors Constructor Description Source()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(java.lang.Object other)
static Source
create(java.util.Map<java.lang.String,java.lang.Object> params)
Creates a new source object.static Source
create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Creates a new source object.Source
detach()
Delete a specified source for a given customer.Source
detach(java.util.Map<java.lang.String,java.lang.Object> params)
Delete a specified source for a given customer.Source
detach(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Delete a specified source for a given customer.boolean
equals(java.lang.Object o)
Source.AchCreditTransfer
getAchCreditTransfer()
Source.AchDebit
getAchDebit()
Source.Alipay
getAlipay()
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.Source.Bancontact
getBancontact()
Source.Card
getCard()
Source.CardPresent
getCardPresent()
java.lang.String
getClientSecret()
The client secret of the source.Source.CodeVerificationFlow
getCodeVerification()
java.lang.Long
getCreated()
Time at which the object was created.java.lang.String
getCurrency()
Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source.java.lang.String
getCustomer()
The ID of the customer to which this source is attached.Source.Eps
getEps()
java.lang.String
getFlow()
The authentication `flow` of the source.Source.Giropay
getGiropay()
java.lang.String
getId()
Unique identifier for the object.Source.Ideal
getIdeal()
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.java.util.Map<java.lang.String,java.lang.String>
getMetadata()
Set of key-value pairs that you can attach to an object.Source.Multibanco
getMultibanco()
java.lang.String
getObject()
String representing the object's type.Source.Owner
getOwner()
Information about the owner of the payment instrument that may be used or required by particular source types.Source.P24
getP24()
Source.ReceiverFlow
getReceiver()
Source.RedirectFlow
getRedirect()
Source.SepaDebit
getSepaDebit()
Source.Sofort
getSofort()
java.lang.String
getStatementDescriptor()
Extra information about a source.java.lang.String
getStatus()
The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`.Source.ThreeDSecure
getThreeDSecure()
java.lang.String
getType()
The `type` of the source.java.lang.String
getUsage()
Either `reusable` or `single_use`.Source.Wechat
getWechat()
int
hashCode()
static Source
retrieve(java.lang.String source)
Retrieves an existing source object.static Source
retrieve(java.lang.String source, RequestOptions options)
Retrieves an existing source object.static Source
retrieve(java.lang.String source, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Retrieves an existing source object.void
setAchCreditTransfer(Source.AchCreditTransfer achCreditTransfer)
void
setAchDebit(Source.AchDebit achDebit)
void
setAlipay(Source.Alipay alipay)
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.void
setBancontact(Source.Bancontact bancontact)
void
setCard(Source.Card card)
void
setCardPresent(Source.CardPresent cardPresent)
void
setClientSecret(java.lang.String clientSecret)
The client secret of the source.void
setCodeVerification(Source.CodeVerificationFlow codeVerification)
void
setCreated(java.lang.Long created)
Time at which the object was created.void
setCurrency(java.lang.String currency)
Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source.void
setCustomer(java.lang.String customer)
The ID of the customer to which this source is attached.void
setEps(Source.Eps eps)
void
setFlow(java.lang.String flow)
The authentication `flow` of the source.void
setGiropay(Source.Giropay giropay)
void
setId(java.lang.String id)
Unique identifier for the object.void
setIdeal(Source.Ideal ideal)
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.void
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach to an object.void
setMultibanco(Source.Multibanco multibanco)
void
setObject(java.lang.String object)
String representing the object's type.void
setOwner(Source.Owner owner)
Information about the owner of the payment instrument that may be used or required by particular source types.void
setP24(Source.P24 p24)
void
setReceiver(Source.ReceiverFlow receiver)
void
setRedirect(Source.RedirectFlow redirect)
void
setSepaDebit(Source.SepaDebit sepaDebit)
void
setSofort(Source.Sofort sofort)
void
setStatementDescriptor(java.lang.String statementDescriptor)
Extra information about a source.void
setStatus(java.lang.String status)
The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`.void
setThreeDSecure(Source.ThreeDSecure threeDSecure)
void
setType(java.lang.String type)
The `type` of the source.void
setUsage(java.lang.String usage)
Either `reusable` or `single_use`.void
setWechat(Source.Wechat wechat)
SourceTransactionCollection
sourceTransactions()
List source transactions for a given source.SourceTransactionCollection
sourceTransactions(java.util.Map<java.lang.String,java.lang.Object> params)
List source transactions for a given source.SourceTransactionCollection
sourceTransactions(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
List source transactions for a given source.Source
update(java.util.Map<java.lang.String,java.lang.Object> params)
Updates the specified source by setting the values of the parameters passed.Source
update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Updates the specified source by setting the values of the parameters passed.Source
verify(java.util.Map<java.lang.String,java.lang.Object> params)
Verify a given source.Source
verify(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Verify a given source.-
Methods inherited from class com.stripe.net.ApiResource
classUrl, classUrl, instanceUrl, instanceUrl, multipartRequest, request, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
detach
public Source detach() throws StripeException
Delete a specified source for a given customer.- Throws:
StripeException
-
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
-
detach
public Source detach(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) 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
-
create
public static Source create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Creates a new source object.- Throws:
StripeException
-
create
public static Source create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Creates a new source object.- 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
andowner
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 interfaceMetadataStore<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
andowner
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 interfaceMetadataStore<Source>
- Throws:
StripeException
-
verify
public Source verify(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Verify a given source.- Throws:
StripeException
-
verify
public Source verify(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Verify a given source.- Throws:
StripeException
-
sourceTransactions
public SourceTransactionCollection sourceTransactions() throws StripeException
List source transactions for a given source.- Throws:
StripeException
-
sourceTransactions
public SourceTransactionCollection sourceTransactions(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
List source transactions for a given source.- Throws:
StripeException
-
sourceTransactions
public SourceTransactionCollection sourceTransactions(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
List source transactions for a given source.- Throws:
StripeException
-
getAchCreditTransfer
public Source.AchCreditTransfer getAchCreditTransfer()
-
getAchDebit
public Source.AchDebit getAchDebit()
-
getAlipay
public Source.Alipay getAlipay()
-
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.
-
getBancontact
public Source.Bancontact getBancontact()
-
getCard
public Source.Card getCard()
-
getCardPresent
public Source.CardPresent getCardPresent()
-
getClientSecret
public java.lang.String getClientSecret()
The client secret of the source. Used for client-side retrieval using a publishable key.
-
getCodeVerification
public Source.CodeVerificationFlow getCodeVerification()
-
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](https://stripe.com/docs/currencies) 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.
-
getEps
public Source.Eps getEps()
-
getFlow
public java.lang.String getFlow()
The authentication `flow` of the source. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`.
-
getGiropay
public Source.Giropay getGiropay()
-
getIdeal
public Source.Ideal getIdeal()
-
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.
-
getMultibanco
public Source.Multibanco getMultibanco()
-
getObject
public java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.
-
getOwner
public Source.Owner getOwner()
Information about the owner of the payment instrument that may be used or required by particular source types.
-
getP24
public Source.P24 getP24()
-
getReceiver
public Source.ReceiverFlow getReceiver()
-
getRedirect
public Source.RedirectFlow getRedirect()
-
getSepaDebit
public Source.SepaDebit getSepaDebit()
-
getSofort
public Source.Sofort getSofort()
-
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.
-
getThreeDSecure
public Source.ThreeDSecure getThreeDSecure()
-
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`, `p24`, `paper_check`, `sepa_credit_transfer`, `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](https://stripe.com/docs/sources) 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.
-
getWechat
public Source.Wechat getWechat()
-
setAchCreditTransfer
public void setAchCreditTransfer(Source.AchCreditTransfer achCreditTransfer)
-
setAchDebit
public void setAchDebit(Source.AchDebit achDebit)
-
setAlipay
public void setAlipay(Source.Alipay alipay)
-
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.
-
setBancontact
public void setBancontact(Source.Bancontact bancontact)
-
setCard
public void setCard(Source.Card card)
-
setCardPresent
public void setCardPresent(Source.CardPresent cardPresent)
-
setClientSecret
public void setClientSecret(java.lang.String clientSecret)
The client secret of the source. Used for client-side retrieval using a publishable key.
-
setCodeVerification
public void setCodeVerification(Source.CodeVerificationFlow codeVerification)
-
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](https://stripe.com/docs/currencies) 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.
-
setEps
public void setEps(Source.Eps eps)
-
setFlow
public void setFlow(java.lang.String flow)
The authentication `flow` of the source. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`.
-
setGiropay
public void setGiropay(Source.Giropay giropay)
-
setId
public void setId(java.lang.String id)
Unique identifier for the object.
-
setIdeal
public void setIdeal(Source.Ideal ideal)
-
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.
-
setMultibanco
public void setMultibanco(Source.Multibanco multibanco)
-
setObject
public void setObject(java.lang.String object)
String representing the object's type. Objects of the same type share the same value.
-
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.
-
setP24
public void setP24(Source.P24 p24)
-
setReceiver
public void setReceiver(Source.ReceiverFlow receiver)
-
setRedirect
public void setRedirect(Source.RedirectFlow redirect)
-
setSepaDebit
public void setSepaDebit(Source.SepaDebit sepaDebit)
-
setSofort
public void setSofort(Source.Sofort sofort)
-
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.
-
setThreeDSecure
public void setThreeDSecure(Source.ThreeDSecure threeDSecure)
-
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`, `p24`, `paper_check`, `sepa_credit_transfer`, `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](https://stripe.com/docs/sources) 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.
-
setWechat
public void setWechat(Source.Wechat wechat)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getId
public java.lang.String getId()
Unique identifier for the object.
-
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 interfaceMetadataStore<Source>
-
-