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
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about AchCreditTransfer, please refer to the API Reference.static classFor more details about AchDebit, please refer to the API Reference.static classFor more details about AcssDebit, please refer to the API Reference.static classFor more details about Alipay, please refer to the API Reference.static classFor more details about AuBecsDebit, please refer to the API Reference.static classFor more details about Bancontact, please refer to the API Reference.static classFor more details about Card, please refer to the API Reference.static classFor more details about CardPresent, please refer to the API Reference.static classFor more details about CodeVerification, please refer to the API Reference.static classFor more details about Eps, please refer to the API Reference.static classFor more details about Giropay, please refer to the API Reference.static classFor more details about Ideal, please refer to the API Reference.static classFor more details about Klarna, please refer to the API Reference.static classFor more details about Multibanco, please refer to the API Reference.static classFor more details about Owner, please refer to the API Reference.static classFor more details about P24, please refer to the API Reference.static classFor more details about Paypal, please refer to the API Reference.static classFor more details about Receiver, please refer to the API Reference.static classFor more details about Redirect, please refer to the API Reference.static classFor more details about SepaCreditTransfer, please refer to the API Reference.static classFor more details about SepaDebit, please refer to the API Reference.static classFor more details about Sofort, please refer to the API Reference.static classFor more details about SourceOrder, please refer to the API Reference.static classFor more details about ThreeDSecure, please refer to the API Reference.static classFor more details about Wechat, please refer to the API Reference.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_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic Sourcecreate(SourceCreateParams params) Creates a new source object.static Sourcecreate(SourceCreateParams params, RequestOptions options) Creates a new source object.static SourceCreates a new source object.static Sourcecreate(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.booleanThis field indicates whether this payment method can be shown again to its customer in a checkout flow.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 authenticationflowof the source.getId()Unique identifier for the object.getIdeal()Has the valuetrueif the object exists in live mode or the valuefalseif 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()Thetypeof the source.getUsage()Eitherreusableorsingle_use.inthashCode()static SourceRetrieves an existing source object.static Sourceretrieve(String source, RequestOptions options) Retrieves an existing source object.static Sourceretrieve(String source, SourceRetrieveParams params, RequestOptions options) Retrieves an existing source object.static SourceRetrieves an existing source object.voidsetAchCreditTransfer(Source.AchCreditTransfer achCreditTransfer) voidsetAchDebit(Source.AchDebit achDebit) voidsetAcssDebit(Source.AcssDebit acssDebit) voidsetAlipay(Source.Alipay alipay) voidsetAllowRedisplay(String allowRedisplay) This field indicates whether this payment method can be shown again to its customer in a checkout flow.voidA 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.voidsetAuBecsDebit(Source.AuBecsDebit auBecsDebit) voidsetBancontact(Source.Bancontact bancontact) voidsetCard(Source.Card card) voidsetCardPresent(Source.CardPresent cardPresent) voidsetClientSecret(String clientSecret) The client secret of the source.voidsetCodeVerification(Source.CodeVerification codeVerification) voidsetCreated(Long created) Time at which the object was created.voidsetCurrency(String currency) Three-letter ISO code for the currency associated with the source.voidsetCustomer(String customer) The ID of the customer to which this source is attached.voidsetEps(Source.Eps eps) voidThe authenticationflowof the source.voidsetGiropay(Source.Giropay giropay) voidUnique identifier for the object.voidsetIdeal(Source.Ideal ideal) voidsetKlarna(Source.Klarna klarna) voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidsetMultibanco(Source.Multibanco multibanco) voidString representing the object's type.voidsetOwner(Source.Owner owner) Information about the owner of the payment instrument that may be used or required by particular source types.voidsetP24(Source.P24 p24) voidsetPaypal(Source.Paypal paypal) voidsetReceiver(Source.Receiver receiver) voidsetRedirect(Source.Redirect redirect) voidsetResponseGetter(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.voidsetSepaCreditTransfer(Source.SepaCreditTransfer sepaCreditTransfer) voidsetSepaDebit(Source.SepaDebit sepaDebit) voidsetSofort(Source.Sofort sofort) voidsetSourceOrder(Source.SourceOrder sourceOrder) voidsetStatementDescriptor(String statementDescriptor) Extra information about a source.voidThe status of the source, one ofcanceled,chargeable,consumed,failed, orpending.voidsetThreeDSecure(Source.ThreeDSecure threeDSecure) voidThetypeof the source.voidEitherreusableorsingle_use.voidsetWechat(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, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetterMethods 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
metadataandowneras 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:
updatein 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
metadataandowneras 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:
updatein 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
metadataandowneras 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
metadataandowneras 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:StripeActiveObjectMethod is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getAchCreditTransfer
-
getAchDebit
-
getAcssDebit
-
getAlipay
-
getAllowRedisplay
This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.One of
always,limited, orunspecified. -
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_usesources. -
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_usesources. -
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 authenticationflowof the source.flowis one ofredirect,receiver,code_verification,none. -
getGiropay
-
getIdeal
-
getKlarna
-
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif 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
-
getPaypal
-
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. Onlychargeablesources can be used to create a charge. -
getThreeDSecure
-
getType
Thetypeof the source. Thetypeis 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
Eitherreusableorsingle_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
-
setAllowRedisplay
This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.One of
always,limited, orunspecified. -
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_usesources. -
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_usesources. -
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 authenticationflowof the source.flowis one ofredirect,receiver,code_verification,none. -
setGiropay
-
setId
Unique identifier for the object. -
setIdeal
-
setKlarna
-
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif 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
-
setPaypal
-
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. Onlychargeablesources can be used to create a charge. -
setThreeDSecure
-
setType
Thetypeof the source. Thetypeis 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
Eitherreusableorsingle_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:
getMetadatain interfaceMetadataStore<Source>
-