Class PaymentMethod
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.PaymentMethod
-
- All Implemented Interfaces:
HasId,MetadataStore<PaymentMethod>,StripeObjectInterface
public class PaymentMethod extends ApiResource implements HasId, MetadataStore<PaymentMethod>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPaymentMethod.AcssDebitstatic classPaymentMethod.AfterpayClearpaystatic classPaymentMethod.Alipaystatic classPaymentMethod.AuBecsDebitstatic classPaymentMethod.BacsDebitstatic classPaymentMethod.Bancontactstatic classPaymentMethod.BillingDetailsstatic classPaymentMethod.Cardstatic classPaymentMethod.CardPresentOwner's verified shipping address.static classPaymentMethod.Epsstatic classPaymentMethod.Fpxstatic classPaymentMethod.Giropaystatic classPaymentMethod.Grabpaystatic classPaymentMethod.Idealstatic classPaymentMethod.InteracPresentstatic classPaymentMethod.Oxxostatic classPaymentMethod.P24static classPaymentMethod.SepaDebitstatic classPaymentMethod.SofortGet expandedsetupAttempt.-
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
-
Field Summary
-
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON
-
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
-
Constructor Summary
Constructors Constructor Description PaymentMethod()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PaymentMethodattach(PaymentMethodAttachParams params)Attaches a PaymentMethod object to a Customer.PaymentMethodattach(PaymentMethodAttachParams params, RequestOptions options)Attaches a PaymentMethod object to a Customer.PaymentMethodattach(java.util.Map<java.lang.String,java.lang.Object> params)Attaches a PaymentMethod object to a Customer.PaymentMethodattach(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Attaches a PaymentMethod object to a Customer.protected booleancanEqual(java.lang.Object other)static PaymentMethodcreate(PaymentMethodCreateParams params)Creates a PaymentMethod object.static PaymentMethodcreate(PaymentMethodCreateParams params, RequestOptions options)Creates a PaymentMethod object.static PaymentMethodcreate(java.util.Map<java.lang.String,java.lang.Object> params)Creates a PaymentMethod object.static PaymentMethodcreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Creates a PaymentMethod object.PaymentMethoddetach()Detaches a PaymentMethod object from a Customer.PaymentMethoddetach(RequestOptions options)Detaches a PaymentMethod object from a Customer.PaymentMethoddetach(PaymentMethodDetachParams params)Detaches a PaymentMethod object from a Customer.PaymentMethoddetach(PaymentMethodDetachParams params, RequestOptions options)Detaches a PaymentMethod object from a Customer.PaymentMethoddetach(java.util.Map<java.lang.String,java.lang.Object> params)Detaches a PaymentMethod object from a Customer.PaymentMethoddetach(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Detaches a PaymentMethod object from a Customer.booleanequals(java.lang.Object o)PaymentMethod.AcssDebitgetAcssDebit()PaymentMethod.AfterpayClearpaygetAfterpayClearpay()PaymentMethod.AlipaygetAlipay()PaymentMethod.AuBecsDebitgetAuBecsDebit()PaymentMethod.BacsDebitgetBacsDebit()PaymentMethod.BancontactgetBancontact()PaymentMethod.BillingDetailsgetBillingDetails()PaymentMethod.CardgetCard()PaymentMethod.CardPresentgetCardPresent()java.lang.LonggetCreated()Time at which the object was created.java.lang.StringgetCustomer()Get ID of expandablecustomerobject.CustomergetCustomerObject()Get expandedcustomer.PaymentMethod.EpsgetEps()PaymentMethod.FpxgetFpx()PaymentMethod.GiropaygetGiropay()PaymentMethod.GrabpaygetGrabpay()java.lang.StringgetId()Unique identifier for the object.PaymentMethod.IdealgetIdeal()PaymentMethod.InteracPresentgetInteracPresent()java.lang.BooleangetLivemode()Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.java.util.Map<java.lang.String,java.lang.String>getMetadata()Set of key-value pairs that you can attach to an object.java.lang.StringgetObject()String representing the object's type.PaymentMethod.OxxogetOxxo()PaymentMethod.P24getP24()PaymentMethod.SepaDebitgetSepaDebit()PaymentMethod.SofortgetSofort()java.lang.StringgetType()The type of the PaymentMethod.inthashCode()static PaymentMethodCollectionlist(PaymentMethodListParams params)Returns a list of PaymentMethods for a given Customer.static PaymentMethodCollectionlist(PaymentMethodListParams params, RequestOptions options)Returns a list of PaymentMethods for a given Customer.static PaymentMethodCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of PaymentMethods for a given Customer.static PaymentMethodCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of PaymentMethods for a given Customer.static PaymentMethodretrieve(java.lang.String paymentMethod)Retrieves a PaymentMethod object.static PaymentMethodretrieve(java.lang.String paymentMethod, RequestOptions options)Retrieves a PaymentMethod object.static PaymentMethodretrieve(java.lang.String paymentMethod, PaymentMethodRetrieveParams params, RequestOptions options)Retrieves a PaymentMethod object.static PaymentMethodretrieve(java.lang.String paymentMethod, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Retrieves a PaymentMethod object.voidsetAcssDebit(PaymentMethod.AcssDebit acssDebit)voidsetAfterpayClearpay(PaymentMethod.AfterpayClearpay afterpayClearpay)voidsetAlipay(PaymentMethod.Alipay alipay)voidsetAuBecsDebit(PaymentMethod.AuBecsDebit auBecsDebit)voidsetBacsDebit(PaymentMethod.BacsDebit bacsDebit)voidsetBancontact(PaymentMethod.Bancontact bancontact)voidsetBillingDetails(PaymentMethod.BillingDetails billingDetails)voidsetCard(PaymentMethod.Card card)voidsetCardPresent(PaymentMethod.CardPresent cardPresent)voidsetCreated(java.lang.Long created)Time at which the object was created.voidsetCustomer(java.lang.String id)voidsetCustomerObject(Customer expandableObject)voidsetEps(PaymentMethod.Eps eps)voidsetFpx(PaymentMethod.Fpx fpx)voidsetGiropay(PaymentMethod.Giropay giropay)voidsetGrabpay(PaymentMethod.Grabpay grabpay)voidsetId(java.lang.String id)Unique identifier for the object.voidsetIdeal(PaymentMethod.Ideal ideal)voidsetInteracPresent(PaymentMethod.InteracPresent interacPresent)voidsetLivemode(java.lang.Boolean livemode)Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetObject(java.lang.String object)String representing the object's type.voidsetOxxo(PaymentMethod.Oxxo oxxo)voidsetP24(PaymentMethod.P24 p24)voidsetSepaDebit(PaymentMethod.SepaDebit sepaDebit)voidsetSofort(PaymentMethod.Sofort sofort)voidsetType(java.lang.String type)The type of the PaymentMethod.PaymentMethodupdate(PaymentMethodUpdateParams params)Updates a PaymentMethod object.PaymentMethodupdate(PaymentMethodUpdateParams params, RequestOptions options)Updates a PaymentMethod object.PaymentMethodupdate(java.util.Map<java.lang.String,java.lang.Object> params)Updates a PaymentMethod object.PaymentMethodupdate(java.util.Map<java.lang.String,java.lang.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, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
getCustomer
public java.lang.String getCustomer()
Get ID of expandablecustomerobject.
-
setCustomer
public void setCustomer(java.lang.String id)
-
getCustomerObject
public Customer getCustomerObject()
Get expandedcustomer.
-
setCustomerObject
public void setCustomerObject(Customer expandableObject)
-
create
public static PaymentMethod create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Creates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.- Throws:
StripeException
-
create
public static PaymentMethod create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Creates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.- Throws:
StripeException
-
create
public static PaymentMethod create(PaymentMethodCreateParams params) throws StripeException
Creates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.- 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.- Throws:
StripeException
-
retrieve
public static PaymentMethod retrieve(java.lang.String paymentMethod) throws StripeException
Retrieves a PaymentMethod object.- Throws:
StripeException
-
retrieve
public static PaymentMethod retrieve(java.lang.String paymentMethod, RequestOptions options) throws StripeException
Retrieves a PaymentMethod object.- Throws:
StripeException
-
retrieve
public static PaymentMethod retrieve(java.lang.String paymentMethod, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves a PaymentMethod object.- Throws:
StripeException
-
retrieve
public static PaymentMethod retrieve(java.lang.String paymentMethod, PaymentMethodRetrieveParams params, RequestOptions options) throws StripeException
Retrieves a PaymentMethod object.- Throws:
StripeException
-
update
public PaymentMethod update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
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(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
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(PaymentMethodUpdateParams params) throws StripeException
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
-
list
public static PaymentMethodCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of PaymentMethods for a given Customer.- Throws:
StripeException
-
list
public static PaymentMethodCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Returns a list of PaymentMethods for a given Customer.- Throws:
StripeException
-
list
public static PaymentMethodCollection list(PaymentMethodListParams params) throws StripeException
Returns a list of PaymentMethods for a given Customer.- Throws:
StripeException
-
list
public static PaymentMethodCollection list(PaymentMethodListParams params, RequestOptions options) throws StripeException
Returns a list of PaymentMethods for a given Customer.- Throws:
StripeException
-
attach
public PaymentMethod attach(java.util.Map<java.lang.String,java.lang.Object> params) 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 ensure that the PaymentMethod can be used in a future payment. Using the
/v1/payment_methods/:id/attachendpoint does not ensure that future payments can be made with the attached PaymentMethod. 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(java.util.Map<java.lang.String,java.lang.Object> 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 ensure that the PaymentMethod can be used in a future payment. Using the
/v1/payment_methods/:id/attachendpoint does not ensure that future payments can be made with the attached PaymentMethod. 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) 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 ensure that the PaymentMethod can be used in a future payment. Using the
/v1/payment_methods/:id/attachendpoint does not ensure that future payments can be made with the attached PaymentMethod. 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 ensure that the PaymentMethod can be used in a future payment. Using the
/v1/payment_methods/:id/attachendpoint does not ensure that future payments can be made with the attached PaymentMethod. 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
-
detach
public PaymentMethod detach() throws StripeException
Detaches a PaymentMethod object from a Customer.- Throws:
StripeException
-
detach
public PaymentMethod detach(RequestOptions options) throws StripeException
Detaches a PaymentMethod object from a Customer.- Throws:
StripeException
-
detach
public PaymentMethod detach(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Detaches a PaymentMethod object from a Customer.- Throws:
StripeException
-
detach
public PaymentMethod detach(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Detaches a PaymentMethod object from a Customer.- Throws:
StripeException
-
detach
public PaymentMethod detach(PaymentMethodDetachParams params) throws StripeException
Detaches a PaymentMethod object from a Customer.- Throws:
StripeException
-
detach
public PaymentMethod detach(PaymentMethodDetachParams params, RequestOptions options) throws StripeException
Detaches a PaymentMethod object from a Customer.- Throws:
StripeException
-
getAcssDebit
public PaymentMethod.AcssDebit getAcssDebit()
-
getAfterpayClearpay
public PaymentMethod.AfterpayClearpay getAfterpayClearpay()
-
getAlipay
public PaymentMethod.Alipay getAlipay()
-
getAuBecsDebit
public PaymentMethod.AuBecsDebit getAuBecsDebit()
-
getBacsDebit
public PaymentMethod.BacsDebit getBacsDebit()
-
getBancontact
public PaymentMethod.Bancontact getBancontact()
-
getBillingDetails
public PaymentMethod.BillingDetails getBillingDetails()
-
getCard
public PaymentMethod.Card getCard()
-
getCardPresent
public PaymentMethod.CardPresent getCardPresent()
-
getCreated
public java.lang.Long getCreated()
Time at which the object was created. Measured in seconds since the Unix epoch.
-
getEps
public PaymentMethod.Eps getEps()
-
getFpx
public PaymentMethod.Fpx getFpx()
-
getGiropay
public PaymentMethod.Giropay getGiropay()
-
getGrabpay
public PaymentMethod.Grabpay getGrabpay()
-
getIdeal
public PaymentMethod.Ideal getIdeal()
-
getInteracPresent
public PaymentMethod.InteracPresent getInteracPresent()
-
getLivemode
public java.lang.Boolean getLivemode()
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
getObject
public java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.Equal to
payment_method.
-
getOxxo
public PaymentMethod.Oxxo getOxxo()
-
getP24
public PaymentMethod.P24 getP24()
-
getSepaDebit
public PaymentMethod.SepaDebit getSepaDebit()
-
getSofort
public PaymentMethod.Sofort getSofort()
-
getType
public java.lang.String 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,afterpay_clearpay,alipay,au_becs_debit,bacs_debit,bancontact,card,card_present,eps,fpx,giropay,grabpay,ideal,interac_present,oxxo,p24,sepa_debit, orsofort.
-
setAcssDebit
public void setAcssDebit(PaymentMethod.AcssDebit acssDebit)
-
setAfterpayClearpay
public void setAfterpayClearpay(PaymentMethod.AfterpayClearpay afterpayClearpay)
-
setAlipay
public void setAlipay(PaymentMethod.Alipay alipay)
-
setAuBecsDebit
public void setAuBecsDebit(PaymentMethod.AuBecsDebit auBecsDebit)
-
setBacsDebit
public void setBacsDebit(PaymentMethod.BacsDebit bacsDebit)
-
setBancontact
public void setBancontact(PaymentMethod.Bancontact bancontact)
-
setBillingDetails
public void setBillingDetails(PaymentMethod.BillingDetails billingDetails)
-
setCard
public void setCard(PaymentMethod.Card card)
-
setCardPresent
public void setCardPresent(PaymentMethod.CardPresent cardPresent)
-
setCreated
public void setCreated(java.lang.Long created)
Time at which the object was created. Measured in seconds since the Unix epoch.
-
setEps
public void setEps(PaymentMethod.Eps eps)
-
setFpx
public void setFpx(PaymentMethod.Fpx fpx)
-
setGiropay
public void setGiropay(PaymentMethod.Giropay giropay)
-
setGrabpay
public void setGrabpay(PaymentMethod.Grabpay grabpay)
-
setId
public void setId(java.lang.String id)
Unique identifier for the object.
-
setIdeal
public void setIdeal(PaymentMethod.Ideal ideal)
-
setInteracPresent
public void setInteracPresent(PaymentMethod.InteracPresent interacPresent)
-
setLivemode
public void setLivemode(java.lang.Boolean livemode)
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
setMetadata
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
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
public void setObject(java.lang.String object)
String representing the object's type. Objects of the same type share the same value.Equal to
payment_method.
-
setOxxo
public void setOxxo(PaymentMethod.Oxxo oxxo)
-
setP24
public void setP24(PaymentMethod.P24 p24)
-
setSepaDebit
public void setSepaDebit(PaymentMethod.SepaDebit sepaDebit)
-
setSofort
public void setSofort(PaymentMethod.Sofort sofort)
-
setType
public void setType(java.lang.String type)
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,afterpay_clearpay,alipay,au_becs_debit,bacs_debit,bancontact,card,card_present,eps,fpx,giropay,grabpay,ideal,interac_present,oxxo,p24,sepa_debit, orsofort.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getId
public java.lang.String getId()
Unique identifier for the object.
-
getMetadata
public java.util.Map<java.lang.String,java.lang.String> 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>
-
-