Class PaymentMethod
- All Implemented Interfaces:
HasId,MetadataStore<PaymentMethod>,StripeActiveObject,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 classstatic classOwner's verified shipping address.static classThe preferred network for the card.static classstatic classstatic classstatic classstatic classstatic classstatic classstatic classThe preferred network for the card.static classThe four-digit year of birth.static classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classOptions to configure Radar.static classstatic classstatic classGet expandedsetupAttempt.static classstatic classstatic classThe reason why this PaymentMethod's fingerprint has been blockedstatic classNested 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 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.booleanThis field indicates whether this payment method can be shown again to its customer in a checkout flow.getBlik()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.getSwish()getType()The type of the PaymentMethod.getZip()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) voidsetAllowRedisplay(String allowRedisplay) This field indicates whether this payment method can be shown again to its customer in a checkout flow.voidsetAmazonPay(PaymentMethod.AmazonPay amazonPay) 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) voidsetCashapp(PaymentMethod.Cashapp cashapp) 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.voidsetMobilepay(PaymentMethod.Mobilepay mobilepay) voidString representing the object's type.voidsetOxxo(PaymentMethod.Oxxo oxxo) voidsetP24(PaymentMethod.P24 p24) voidsetPaynow(PaymentMethod.Paynow paynow) voidsetPaypal(PaymentMethod.Paypal paypal) voidsetPix(PaymentMethod.Pix pix) voidsetPromptpay(PaymentMethod.Promptpay promptpay) voidsetRadarOptions(PaymentMethod.RadarOptions radarOptions) Options to configure Radar.voidsetResponseGetter(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.voidsetRevolutPay(PaymentMethod.RevolutPay revolutPay) voidsetSepaDebit(PaymentMethod.SepaDebit sepaDebit) voidsetSofort(PaymentMethod.Sofort sofort) voidsetSwish(PaymentMethod.Swish swish) voidThe type of the PaymentMethod.voidsetUsBankAccount(PaymentMethod.UsBankAccount usBankAccount) voidsetWechatPay(PaymentMethod.WechatPay wechatPay) voidsetZip(PaymentMethod.Zip zip) 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, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setStripeResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
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
trySetResponseGetter
-
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
-
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.
-
getAcssDebit
-
getAffirm
-
getAfterpayClearpay
-
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. -
getAmazonPay
-
getAuBecsDebit
-
getBacsDebit
-
getBancontact
-
getBillingDetails
-
getBlik
-
getBoleto
-
getCard
-
getCardPresent
-
getCashapp
-
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. -
getMobilepay
-
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
payment_method. -
getOxxo
-
getP24
-
getPaynow
-
getPaypal
-
getPix
-
getPromptpay
-
getRadarOptions
Options to configure Radar. See Radar Session for more information. -
getRevolutPay
-
getSepaDebit
-
getSofort
-
getSwish
-
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,amazon_pay,au_becs_debit,bacs_debit,bancontact,blik,boleto,card,card_present,cashapp,customer_balance,eps,fpx,giropay,grabpay,ideal,interac_present,klarna,konbini,link,mobilepay,oxxo,p24,paynow,paypal,pix,promptpay,revolut_pay,sepa_debit,sofort,swish,us_bank_account,wechat_pay, orzip. -
getUsBankAccount
-
getWechatPay
-
getZip
-
setAcssDebit
-
setAffirm
-
setAfterpayClearpay
-
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. -
setAmazonPay
-
setAuBecsDebit
-
setBacsDebit
-
setBancontact
-
setBillingDetails
-
setBlik
-
setBoleto
-
setCard
-
setCardPresent
-
setCashapp
-
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. -
setMobilepay
-
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
payment_method. -
setOxxo
-
setP24
-
setPaynow
-
setPaypal
-
setPix
-
setPromptpay
-
setRadarOptions
Options to configure Radar. See Radar Session for more information. -
setRevolutPay
-
setSepaDebit
-
setSofort
-
setSwish
-
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,amazon_pay,au_becs_debit,bacs_debit,bancontact,blik,boleto,card,card_present,cashapp,customer_balance,eps,fpx,giropay,grabpay,ideal,interac_present,klarna,konbini,link,mobilepay,oxxo,p24,paynow,paypal,pix,promptpay,revolut_pay,sepa_debit,sofort,swish,us_bank_account,wechat_pay, orzip. -
setUsBankAccount
-
setWechatPay
-
setZip
-
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>
-