Class PaymentMethod
- All Implemented Interfaces:
HasId
,MetadataStore<PaymentMethod>
,StripeActiveObject
,StripeObjectInterface
Related guides: Payment Methods and More Payment Scenarios.
-
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
Owner's verified shipping address.static class
The type of mobile wallet, one ofapple_pay
,google_pay
,samsung_pay
, orunknown
.static class
static class
static class
static class
static class
static class
static class
static class
The preferred network for the card.static class
The four-digit year of birth.static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
Options to configure Radar.static class
static class
static class
Get expandedsetupAttempt
.static class
static class
static class
static class
The reason why this PaymentMethod's fingerprint has been blockedstatic 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 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 boolean
static PaymentMethod
create
(PaymentMethodCreateParams params) Creates a PaymentMethod object.static PaymentMethod
create
(PaymentMethodCreateParams params, RequestOptions options) Creates a PaymentMethod object.static PaymentMethod
Creates a PaymentMethod object.static PaymentMethod
create
(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.boolean
This 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 expandablecustomer
object.Get expandedcustomer
.getEps()
getFpx()
getId()
Unique identifier for the object.getIdeal()
getLink()
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.getOxxo()
getP24()
getPix()
Options to configure Radar.getSwish()
getTwint()
getType()
The type of the PaymentMethod.getZip()
int
hashCode()
static PaymentMethodCollection
list
(PaymentMethodListParams params) Returns a list of PaymentMethods for Treasury flows.static PaymentMethodCollection
list
(PaymentMethodListParams params, RequestOptions options) Returns a list of PaymentMethods for Treasury flows.static PaymentMethodCollection
Returns a list of PaymentMethods for Treasury flows.static PaymentMethodCollection
list
(Map<String, Object> params, RequestOptions options) Returns a list of PaymentMethods for Treasury flows.static PaymentMethod
Retrieves a PaymentMethod object attached to the StripeAccount.static PaymentMethod
retrieve
(String paymentMethod, RequestOptions options) Retrieves a PaymentMethod object attached to the StripeAccount.static PaymentMethod
retrieve
(String paymentMethod, PaymentMethodRetrieveParams params, RequestOptions options) Retrieves a PaymentMethod object attached to the StripeAccount.static PaymentMethod
Retrieves a PaymentMethod object attached to the StripeAccount.void
setAcssDebit
(PaymentMethod.AcssDebit acssDebit) void
setAffirm
(PaymentMethod.Affirm affirm) void
setAfterpayClearpay
(PaymentMethod.AfterpayClearpay afterpayClearpay) void
setAlipay
(PaymentMethod.Alipay alipay) void
setAllowRedisplay
(String allowRedisplay) This field indicates whether this payment method can be shown again to its customer in a checkout flow.void
setAmazonPay
(PaymentMethod.AmazonPay amazonPay) void
setAuBecsDebit
(PaymentMethod.AuBecsDebit auBecsDebit) void
setBacsDebit
(PaymentMethod.BacsDebit bacsDebit) void
setBancontact
(PaymentMethod.Bancontact bancontact) void
setBillingDetails
(PaymentMethod.BillingDetails billingDetails) void
setBlik
(PaymentMethod.Blik blik) void
setBoleto
(PaymentMethod.Boleto boleto) void
setCard
(PaymentMethod.Card card) void
setCardPresent
(PaymentMethod.CardPresent cardPresent) void
setCashapp
(PaymentMethod.Cashapp cashapp) void
setCreated
(Long created) Time at which the object was created.void
setCustomer
(String id) void
setCustomerBalance
(PaymentMethod.CustomerBalance customerBalance) void
setCustomerObject
(Customer expandableObject) void
setEps
(PaymentMethod.Eps eps) void
setFpx
(PaymentMethod.Fpx fpx) void
setGiropay
(PaymentMethod.Giropay giropay) void
setGrabpay
(PaymentMethod.Grabpay grabpay) void
Unique identifier for the object.void
setIdeal
(PaymentMethod.Ideal ideal) void
setInteracPresent
(PaymentMethod.InteracPresent interacPresent) void
setKlarna
(PaymentMethod.Klarna klarna) void
setKonbini
(PaymentMethod.Konbini konbini) void
setLink
(PaymentMethod.Link link) 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
setMobilepay
(PaymentMethod.Mobilepay mobilepay) void
setMultibanco
(PaymentMethod.Multibanco multibanco) void
String representing the object's type.void
setOxxo
(PaymentMethod.Oxxo oxxo) void
setP24
(PaymentMethod.P24 p24) void
setPaynow
(PaymentMethod.Paynow paynow) void
setPaypal
(PaymentMethod.Paypal paypal) void
setPix
(PaymentMethod.Pix pix) void
setPromptpay
(PaymentMethod.Promptpay promptpay) void
setRadarOptions
(PaymentMethod.RadarOptions radarOptions) Options to configure Radar.void
setResponseGetter
(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetter
implementations to set theStripeResponseGetter
instance used to make further requests.void
setRevolutPay
(PaymentMethod.RevolutPay revolutPay) void
setSepaDebit
(PaymentMethod.SepaDebit sepaDebit) void
setSofort
(PaymentMethod.Sofort sofort) void
setSwish
(PaymentMethod.Swish swish) void
setTwint
(PaymentMethod.Twint twint) void
The type of the PaymentMethod.void
setUsBankAccount
(PaymentMethod.UsBankAccount usBankAccount) void
setWechatPay
(PaymentMethod.WechatPay wechatPay) void
setZip
(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, 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
-
Constructor Details
-
PaymentMethod
public PaymentMethod()
-
-
Method Details
-
getCustomer
Get ID of expandablecustomer
object. -
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/attach
endpoint without first using a SetupIntent or PaymentIntent withsetup_future_usage
does 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/attach
endpoint without first using a SetupIntent or PaymentIntent withsetup_future_usage
does 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/attach
endpoint without first using a SetupIntent or PaymentIntent withsetup_future_usage
does 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/attach
endpoint without first using a SetupIntent or PaymentIntent withsetup_future_usage
does 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:
update
in 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:
update
in 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: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.
-
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 valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
getMobilepay
-
getMultibanco
-
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
-
getTwint
-
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
,multibanco
,oxxo
,p24
,paynow
,paypal
,pix
,promptpay
,revolut_pay
,sepa_debit
,sofort
,swish
,twint
,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 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. -
setMobilepay
-
setMultibanco
-
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
-
setTwint
-
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
,multibanco
,oxxo
,p24
,paynow
,paypal
,pix
,promptpay
,revolut_pay
,sepa_debit
,sofort
,swish
,twint
,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:
getMetadata
in interfaceMetadataStore<PaymentMethod>
-