Class Source
- All Implemented Interfaces:
HasId
,MetadataStore<Source>
,PaymentSource
,StripeActiveObject
,StripeObjectInterface
Source
objects allow you to accept a variety of payment methods. They represent a
customer's payment instrument, and can be used with the Stripe API just like a Card
object: once chargeable, they can be charged, or can be attached to customers.
Stripe doesn't recommend using the deprecated Sources API. We recommend that you adopt the PaymentMethods API. This newer API provides access to our latest features and payment method types.
Related guides: Sources API and Sources & Customers.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
The type of this order item.static class
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSON
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static Source
create
(SourceCreateParams params) Creates a new source object.static Source
create
(SourceCreateParams params, RequestOptions options) Creates a new source object.static Source
Creates a new source object.static Source
create
(Map<String, Object> params, RequestOptions options) Creates a new source object.detach()
Delete a specified source for a given customer.detach
(SourceDetachParams params) Delete a specified source for a given customer.detach
(SourceDetachParams params, RequestOptions options) Delete a specified source for a given customer.Delete a specified source for a given customer.detach
(Map<String, Object> params, RequestOptions options) Delete a specified source for a given customer.boolean
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.getCard()
The client secret of the source.Time at which the object was created.Three-letter ISO code for the currency associated with the source.The ID of the customer to which this source is attached.getEps()
getFlow()
The authenticationflow
of the source.getId()
Unique identifier for the object.getIdeal()
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.Set of key-value pairs that you can attach to an object.String representing the object's type.getOwner()
Information about the owner of the payment instrument that may be used or required by particular source types.getP24()
Extra information about a source.The status of the source, one ofcanceled
,chargeable
,consumed
,failed
, orpending
.getType()
Thetype
of the source.getUsage()
Eitherreusable
orsingle_use
.int
hashCode()
static Source
Retrieves an existing source object.static Source
retrieve
(String source, RequestOptions options) Retrieves an existing source object.static Source
retrieve
(String source, SourceRetrieveParams params, RequestOptions options) Retrieves an existing source object.static Source
Retrieves an existing source object.void
setAchCreditTransfer
(Source.AchCreditTransfer achCreditTransfer) void
setAchDebit
(Source.AchDebit achDebit) void
setAcssDebit
(Source.AcssDebit acssDebit) void
setAlipay
(Source.Alipay alipay) void
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
setAuBecsDebit
(Source.AuBecsDebit auBecsDebit) void
setBancontact
(Source.Bancontact bancontact) void
setCard
(Source.Card card) void
setCardPresent
(Source.CardPresent cardPresent) void
setClientSecret
(String clientSecret) The client secret of the source.void
setCodeVerification
(Source.CodeVerification codeVerification) void
setCreated
(Long created) Time at which the object was created.void
setCurrency
(String currency) Three-letter ISO code for the currency associated with the source.void
setCustomer
(String customer) The ID of the customer to which this source is attached.void
setEps
(Source.Eps eps) void
The authenticationflow
of the source.void
setGiropay
(Source.Giropay giropay) void
Unique identifier for the object.void
setIdeal
(Source.Ideal ideal) void
setKlarna
(Source.Klarna klarna) void
setLivemode
(Boolean livemode) Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
setMetadata
(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.void
setMultibanco
(Source.Multibanco multibanco) void
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.Receiver receiver) void
setRedirect
(Source.Redirect redirect) void
setResponseGetter
(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetter
implementations to set theStripeResponseGetter
instance used to make further requests.void
setSepaCreditTransfer
(Source.SepaCreditTransfer sepaCreditTransfer) void
setSepaDebit
(Source.SepaDebit sepaDebit) void
setSofort
(Source.Sofort sofort) void
setSourceOrder
(Source.SourceOrder sourceOrder) void
setStatementDescriptor
(String statementDescriptor) Extra information about a source.void
The status of the source, one ofcanceled
,chargeable
,consumed
,failed
, orpending
.void
setThreeDSecure
(Source.ThreeDSecure threeDSecure) void
Thetype
of the source.void
Eitherreusable
orsingle_use
.void
setWechat
(Source.Wechat wechat) List source transactions for a given source.List source transactions for a given source.sourceTransactions
(SourceSourceTransactionsParams params, RequestOptions options) List source transactions for a given source.sourceTransactions
(Map<String, Object> params) List source transactions for a given source.sourceTransactions
(Map<String, Object> params, RequestOptions options) List source transactions for a given source.update
(SourceUpdateParams params) Updates the specified source by setting the values of the parameters passed.update
(SourceUpdateParams params, RequestOptions options) Updates the specified source by setting the values of the parameters passed.Updates the specified source by setting the values of the parameters passed.update
(Map<String, Object> params, RequestOptions options) Updates the specified source by setting the values of the parameters passed.verify
(SourceVerifyParams params) Verify a given source.verify
(SourceVerifyParams params, RequestOptions options) Verify a given source.Verify a given source.verify
(Map<String, Object> params, RequestOptions options) Verify a given source.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setStripeResponseGetter, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
Methods inherited from interface com.stripe.model.StripeObjectInterface
getLastResponse, setLastResponse
-
Constructor Details
-
Source
public Source()
-
-
Method Details
-
create
Creates a new source object.- Throws:
StripeException
-
create
public static Source create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a new source object.- Throws:
StripeException
-
create
Creates a new source object.- Throws:
StripeException
-
create
public static Source create(SourceCreateParams params, RequestOptions options) throws StripeException Creates a new source object.- Throws:
StripeException
-
detach
Delete a specified source for a given customer.- Throws:
StripeException
-
detach
Delete a specified source for a given customer.- Throws:
StripeException
-
detach
Delete a specified source for a given customer.- Throws:
StripeException
-
detach
Delete a specified source for a given customer.- Throws:
StripeException
-
detach
Delete a specified source for a given customer.- Throws:
StripeException
-
retrieve
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
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(String source, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves 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(String source, SourceRetrieveParams 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
-
sourceTransactions
List source transactions for a given source.- Throws:
StripeException
-
sourceTransactions
public SourceTransactionCollection sourceTransactions(Map<String, Object> params) throws StripeExceptionList source transactions for a given source.- Throws:
StripeException
-
sourceTransactions
public SourceTransactionCollection sourceTransactions(Map<String, Object> params, RequestOptions options) throws StripeExceptionList source transactions for a given source.- Throws:
StripeException
-
sourceTransactions
public SourceTransactionCollection sourceTransactions(SourceSourceTransactionsParams params) throws StripeException List source transactions for a given source.- Throws:
StripeException
-
sourceTransactions
public SourceTransactionCollection sourceTransactions(SourceSourceTransactionsParams params, RequestOptions options) throws StripeException List source transactions for a given source.- Throws:
StripeException
-
update
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
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
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.- Throws:
StripeException
-
update
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.- Throws:
StripeException
-
verify
Verify a given source.- Throws:
StripeException
-
verify
Verify a given source.- Throws:
StripeException
-
verify
Verify a given source.- Throws:
StripeException
-
verify
Verify a given source.- Throws:
StripeException
-
setResponseGetter
Description copied from interface:StripeActiveObject
Method is used by the containing object orStripeResponseGetter
implementations to set theStripeResponseGetter
instance used to make further requests.- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance to use for making further requests.
-
getAchCreditTransfer
-
getAchDebit
-
getAcssDebit
-
getAlipay
-
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 forsingle_use
sources. -
getAuBecsDebit
-
getBancontact
-
getCard
-
getCardPresent
-
getClientSecret
The client secret of the source. Used for client-side retrieval using a publishable key. -
getCodeVerification
-
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
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 forsingle_use
sources. -
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
-
getFlow
The authenticationflow
of the source.flow
is one ofredirect
,receiver
,code_verification
,none
. -
getGiropay
-
getIdeal
-
getKlarna
-
getLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
getMultibanco
-
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
source
. -
getOwner
Information about the owner of the payment instrument that may be used or required by particular source types. -
getP24
-
getReceiver
-
getRedirect
-
getSepaCreditTransfer
-
getSepaDebit
-
getSofort
-
getSourceOrder
-
getStatementDescriptor
Extra information about a source. This will appear on your customer's statement every time you charge the source. -
getStatus
The status of the source, one ofcanceled
,chargeable
,consumed
,failed
, orpending
. Onlychargeable
sources can be used to create a charge. -
getThreeDSecure
-
getType
Thetype
of the source. Thetype
is a payment method, one ofach_credit_transfer
,ach_debit
,alipay
,bancontact
,card
,card_present
,eps
,giropay
,ideal
,multibanco
,klarna
,p24
,sepa_debit
,sofort
,three_d_secure
, orwechat
. 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
Eitherreusable
orsingle_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
-
setAchCreditTransfer
-
setAchDebit
-
setAcssDebit
-
setAlipay
-
setAmount
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 forsingle_use
sources. -
setAuBecsDebit
-
setBancontact
-
setCard
-
setCardPresent
-
setClientSecret
The client secret of the source. Used for client-side retrieval using a publishable key. -
setCodeVerification
-
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCurrency
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 forsingle_use
sources. -
setCustomer
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
-
setFlow
The authenticationflow
of the source.flow
is one ofredirect
,receiver
,code_verification
,none
. -
setGiropay
-
setId
Unique identifier for the object. -
setIdeal
-
setKlarna
-
setLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
setMetadata
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
-
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
source
. -
setOwner
Information about the owner of the payment instrument that may be used or required by particular source types. -
setP24
-
setReceiver
-
setRedirect
-
setSepaCreditTransfer
-
setSepaDebit
-
setSofort
-
setSourceOrder
-
setStatementDescriptor
Extra information about a source. This will appear on your customer's statement every time you charge the source. -
setStatus
The status of the source, one ofcanceled
,chargeable
,consumed
,failed
, orpending
. Onlychargeable
sources can be used to create a charge. -
setThreeDSecure
-
setType
Thetype
of the source. Thetype
is a payment method, one ofach_credit_transfer
,ach_debit
,alipay
,bancontact
,card
,card_present
,eps
,giropay
,ideal
,multibanco
,klarna
,p24
,sepa_debit
,sofort
,three_d_secure
, orwechat
. 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
Eitherreusable
orsingle_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
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object. -
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>
-