Class PaymentMethod
- All Implemented Interfaces:
HasId,MetadataStore<PaymentMethod>,StripeObjectInterface
Related guides: Payment Methods and More Payment Scenarios.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classOwner's verified shipping address.static classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classThe four-digit year of birth.static classstatic classstatic classstatic classstatic classstatic classstatic classOptions to configure Radar.static classstatic classGet expandedsetupAttempt.static classstatic classAll supported networks.Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattach(PaymentMethodAttachParams params) Attaches a PaymentMethod object to a Customer.attach(PaymentMethodAttachParams params, RequestOptions options) Attaches a PaymentMethod object to a Customer.Attaches a PaymentMethod object to a Customer.attach(Map<String, Object> params, RequestOptions options) Attaches a PaymentMethod object to a Customer.protected booleanstatic PaymentMethodcreate(PaymentMethodCreateParams params) Creates a PaymentMethod object.static PaymentMethodcreate(PaymentMethodCreateParams params, RequestOptions options) Creates a PaymentMethod object.static PaymentMethodCreates a PaymentMethod object.static PaymentMethodcreate(Map<String, Object> params, RequestOptions options) Creates a PaymentMethod object.detach()Detaches a PaymentMethod object from a Customer.detach(RequestOptions options) Detaches a PaymentMethod object from a Customer.detach(PaymentMethodDetachParams params) Detaches a PaymentMethod object from a Customer.detach(PaymentMethodDetachParams params, RequestOptions options) Detaches a PaymentMethod object from a Customer.Detaches a PaymentMethod object from a Customer.detach(Map<String, Object> params, RequestOptions options) Detaches a PaymentMethod object from a Customer.booleangetBlik()getCard()Time at which the object was created.Get ID of expandablecustomerobject.Get expandedcustomer.getEps()getFpx()getId()Unique identifier for the object.getIdeal()getLink()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.getOxxo()getP24()getPix()Options to configure Radar.getType()The type of the PaymentMethod.inthashCode()static PaymentMethodCollectionlist(PaymentMethodListParams params) Returns a list of PaymentMethods for Treasury flows.static PaymentMethodCollectionlist(PaymentMethodListParams params, RequestOptions options) Returns a list of PaymentMethods for Treasury flows.static PaymentMethodCollectionReturns a list of PaymentMethods for Treasury flows.static PaymentMethodCollectionlist(Map<String, Object> params, RequestOptions options) Returns a list of PaymentMethods for Treasury flows.static PaymentMethodRetrieves a PaymentMethod object attached to the StripeAccount.static PaymentMethodretrieve(String paymentMethod, RequestOptions options) Retrieves a PaymentMethod object attached to the StripeAccount.static PaymentMethodretrieve(String paymentMethod, PaymentMethodRetrieveParams params, RequestOptions options) Retrieves a PaymentMethod object attached to the StripeAccount.static PaymentMethodRetrieves a PaymentMethod object attached to the StripeAccount.voidsetAcssDebit(PaymentMethod.AcssDebit acssDebit) voidsetAffirm(PaymentMethod.Affirm affirm) voidsetAfterpayClearpay(PaymentMethod.AfterpayClearpay afterpayClearpay) voidsetAlipay(PaymentMethod.Alipay alipay) voidsetAuBecsDebit(PaymentMethod.AuBecsDebit auBecsDebit) voidsetBacsDebit(PaymentMethod.BacsDebit bacsDebit) voidsetBancontact(PaymentMethod.Bancontact bancontact) voidsetBillingDetails(PaymentMethod.BillingDetails billingDetails) voidsetBlik(PaymentMethod.Blik blik) voidsetBoleto(PaymentMethod.Boleto boleto) voidsetCard(PaymentMethod.Card card) voidsetCardPresent(PaymentMethod.CardPresent cardPresent) voidsetCreated(Long created) Time at which the object was created.voidsetCustomer(String id) voidsetCustomerBalance(PaymentMethod.CustomerBalance customerBalance) voidsetCustomerObject(Customer expandableObject) voidsetEps(PaymentMethod.Eps eps) voidsetFpx(PaymentMethod.Fpx fpx) voidsetGiropay(PaymentMethod.Giropay giropay) voidsetGrabpay(PaymentMethod.Grabpay grabpay) voidUnique identifier for the object.voidsetIdeal(PaymentMethod.Ideal ideal) voidsetInteracPresent(PaymentMethod.InteracPresent interacPresent) voidsetKlarna(PaymentMethod.Klarna klarna) voidsetKonbini(PaymentMethod.Konbini konbini) voidsetLink(PaymentMethod.Link link) 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.voidString representing the object's type.voidsetOxxo(PaymentMethod.Oxxo oxxo) voidsetP24(PaymentMethod.P24 p24) voidsetPaynow(PaymentMethod.Paynow paynow) voidsetPix(PaymentMethod.Pix pix) voidsetPromptpay(PaymentMethod.Promptpay promptpay) voidsetRadarOptions(PaymentMethod.RadarOptions radarOptions) Options to configure Radar.voidsetSepaDebit(PaymentMethod.SepaDebit sepaDebit) voidsetSofort(PaymentMethod.Sofort sofort) voidThe type of the PaymentMethod.voidsetUsBankAccount(PaymentMethod.UsBankAccount usBankAccount) voidsetWechatPay(PaymentMethod.WechatPay wechatPay) update(PaymentMethodUpdateParams params) Updates a PaymentMethod object.update(PaymentMethodUpdateParams params, RequestOptions options) Updates a PaymentMethod object.Updates a PaymentMethod object.update(Map<String, Object> params, RequestOptions options) Updates a PaymentMethod object.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, requestSearchResult, requestSearchResult, requestStream, requestStream, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
Constructor Details
-
PaymentMethod
public PaymentMethod()
-
-
Method Details
-
getCustomer
Get ID of expandablecustomerobject. -
setCustomer
-
getCustomerObject
Get expandedcustomer. -
setCustomerObject
-
attach
Attaches a PaymentMethod object to a Customer.To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the
/v1/payment_methods/:id/attachendpoint without first using a SetupIntent or PaymentIntent withsetup_future_usagedoes not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See Optimizing cards for future payments for more information about setting up future payments.To use this PaymentMethod as the default for invoice or subscription payments, set
invoice_settings.default_payment_method, on the Customer to the PaymentMethod’s ID.- Throws:
StripeException
-
attach
public PaymentMethod attach(Map<String, Object> params, RequestOptions options) throws StripeExceptionAttaches a PaymentMethod object to a Customer.To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the
/v1/payment_methods/:id/attachendpoint without first using a SetupIntent or PaymentIntent withsetup_future_usagedoes not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See Optimizing cards for future payments for more information about setting up future payments.To use this PaymentMethod as the default for invoice or subscription payments, set
invoice_settings.default_payment_method, on the Customer to the PaymentMethod’s ID.- Throws:
StripeException
-
attach
Attaches a PaymentMethod object to a Customer.To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the
/v1/payment_methods/:id/attachendpoint without first using a SetupIntent or PaymentIntent withsetup_future_usagedoes not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See Optimizing cards for future payments for more information about setting up future payments.To use this PaymentMethod as the default for invoice or subscription payments, set
invoice_settings.default_payment_method, on the Customer to the PaymentMethod’s ID.- Throws:
StripeException
-
attach
public PaymentMethod attach(PaymentMethodAttachParams params, RequestOptions options) throws StripeException Attaches a PaymentMethod object to a Customer.To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the
/v1/payment_methods/:id/attachendpoint without first using a SetupIntent or PaymentIntent withsetup_future_usagedoes not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See Optimizing cards for future payments for more information about setting up future payments.To use this PaymentMethod as the default for invoice or subscription payments, set
invoice_settings.default_payment_method, on the Customer to the PaymentMethod’s ID.- Throws:
StripeException
-
create
Creates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.
- Throws:
StripeException
-
create
public static PaymentMethod create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.
- Throws:
StripeException
-
create
Creates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.
- Throws:
StripeException
-
create
public static PaymentMethod create(PaymentMethodCreateParams params, RequestOptions options) throws StripeException Creates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.
- Throws:
StripeException
-
detach
Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.- Throws:
StripeException
-
detach
Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.- Throws:
StripeException
-
detach
Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.- Throws:
StripeException
-
detach
public PaymentMethod detach(Map<String, Object> params, RequestOptions options) throws StripeExceptionDetaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.- Throws:
StripeException
-
detach
Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.- Throws:
StripeException
-
detach
public PaymentMethod detach(PaymentMethodDetachParams params, RequestOptions options) throws StripeException Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.- Throws:
StripeException
-
list
Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the List a Customer’s PaymentMethods API instead.- Throws:
StripeException
-
list
public static PaymentMethodCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the List a Customer’s PaymentMethods API instead.- Throws:
StripeException
-
list
Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the List a Customer’s PaymentMethods API instead.- Throws:
StripeException
-
list
public static PaymentMethodCollection list(PaymentMethodListParams params, RequestOptions options) throws StripeException Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the List a Customer’s PaymentMethods API instead.- Throws:
StripeException
-
retrieve
Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use Retrieve a Customer’s PaymentMethods- Throws:
StripeException
-
retrieve
public static PaymentMethod retrieve(String paymentMethod, RequestOptions options) throws StripeException Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use Retrieve a Customer’s PaymentMethods- Throws:
StripeException
-
retrieve
public static PaymentMethod retrieve(String paymentMethod, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use Retrieve a Customer’s PaymentMethods- Throws:
StripeException
-
retrieve
public static PaymentMethod retrieve(String paymentMethod, PaymentMethodRetrieveParams params, RequestOptions options) throws StripeException Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use Retrieve a Customer’s PaymentMethods- Throws:
StripeException
-
update
Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.- Specified by:
updatein interfaceMetadataStore<PaymentMethod>- Throws:
StripeException
-
update
public PaymentMethod update(Map<String, Object> params, RequestOptions options) throws StripeExceptionUpdates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.- Specified by:
updatein interfaceMetadataStore<PaymentMethod>- Throws:
StripeException
-
update
Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.- Throws:
StripeException
-
update
public PaymentMethod update(PaymentMethodUpdateParams params, RequestOptions options) throws StripeException Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.- Throws:
StripeException
-
getAcssDebit
-
getAffirm
-
getAfterpayClearpay
-
getAlipay
-
getAuBecsDebit
-
getBacsDebit
-
getBancontact
-
getBillingDetails
-
getBlik
-
getBoleto
-
getCard
-
getCardPresent
-
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCustomerBalance
-
getEps
-
getFpx
-
getGiropay
-
getGrabpay
-
getIdeal
-
getInteracPresent
-
getKlarna
-
getKonbini
-
getLink
-
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
payment_method. -
getOxxo
-
getP24
-
getPaynow
-
getPix
-
getPromptpay
-
getRadarOptions
Options to configure Radar. See Radar Session for more information. -
getSepaDebit
-
getSofort
-
getType
The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.One of
acss_debit,affirm,afterpay_clearpay,alipay,au_becs_debit,bacs_debit,bancontact,blik,boleto,card,card_present,customer_balance,eps,fpx,giropay,grabpay,ideal,interac_present,klarna,konbini,link,oxxo,p24,paynow,pix,promptpay,sepa_debit,sofort,us_bank_account, orwechat_pay. -
getUsBankAccount
-
getWechatPay
-
setAcssDebit
-
setAffirm
-
setAfterpayClearpay
-
setAlipay
-
setAuBecsDebit
-
setBacsDebit
-
setBancontact
-
setBillingDetails
-
setBlik
-
setBoleto
-
setCard
-
setCardPresent
-
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCustomerBalance
-
setEps
-
setFpx
-
setGiropay
-
setGrabpay
-
setId
Unique identifier for the object. -
setIdeal
-
setInteracPresent
-
setKlarna
-
setKonbini
-
setLink
-
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. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
payment_method. -
setOxxo
-
setP24
-
setPaynow
-
setPix
-
setPromptpay
-
setRadarOptions
Options to configure Radar. See Radar Session for more information. -
setSepaDebit
-
setSofort
-
setType
The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.One of
acss_debit,affirm,afterpay_clearpay,alipay,au_becs_debit,bacs_debit,bancontact,blik,boleto,card,card_present,customer_balance,eps,fpx,giropay,grabpay,ideal,interac_present,klarna,konbini,link,oxxo,p24,paynow,pix,promptpay,sepa_debit,sofort,us_bank_account, orwechat_pay. -
setUsBankAccount
-
setWechatPay
-
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<PaymentMethod>
-