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 class
PaymentMethod.Alipay
static class
PaymentMethod.AuBecsDebit
static class
PaymentMethod.BacsDebit
static class
PaymentMethod.Bancontact
static class
PaymentMethod.BillingDetails
static class
PaymentMethod.Card
static class
PaymentMethod.CardPresent
Owner's verified shipping address.static class
PaymentMethod.Eps
static class
PaymentMethod.Fpx
static class
PaymentMethod.Giropay
static class
PaymentMethod.Grabpay
static class
PaymentMethod.Ideal
static class
PaymentMethod.InteracPresent
static class
PaymentMethod.Oxxo
static class
PaymentMethod.P24
static class
PaymentMethod.SepaDebit
static class
PaymentMethod.Sofort
Get 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 PaymentMethod
attach(PaymentMethodAttachParams params)
Attaches a PaymentMethod object to a Customer.PaymentMethod
attach(PaymentMethodAttachParams params, RequestOptions options)
Attaches a PaymentMethod object to a Customer.PaymentMethod
attach(java.util.Map<java.lang.String,java.lang.Object> params)
Attaches a PaymentMethod object to a Customer.PaymentMethod
attach(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Attaches a PaymentMethod object to a Customer.protected boolean
canEqual(java.lang.Object other)
static PaymentMethod
create(PaymentMethodCreateParams params)
Creates a PaymentMethod object.static PaymentMethod
create(PaymentMethodCreateParams params, RequestOptions options)
Creates a PaymentMethod object.static PaymentMethod
create(java.util.Map<java.lang.String,java.lang.Object> params)
Creates a PaymentMethod object.static PaymentMethod
create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Creates a PaymentMethod object.PaymentMethod
detach()
Detaches a PaymentMethod object from a Customer.PaymentMethod
detach(RequestOptions options)
Detaches a PaymentMethod object from a Customer.PaymentMethod
detach(PaymentMethodDetachParams params)
Detaches a PaymentMethod object from a Customer.PaymentMethod
detach(PaymentMethodDetachParams params, RequestOptions options)
Detaches a PaymentMethod object from a Customer.PaymentMethod
detach(java.util.Map<java.lang.String,java.lang.Object> params)
Detaches a PaymentMethod object from a Customer.PaymentMethod
detach(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Detaches a PaymentMethod object from a Customer.boolean
equals(java.lang.Object o)
PaymentMethod.Alipay
getAlipay()
PaymentMethod.AuBecsDebit
getAuBecsDebit()
PaymentMethod.BacsDebit
getBacsDebit()
PaymentMethod.Bancontact
getBancontact()
PaymentMethod.BillingDetails
getBillingDetails()
PaymentMethod.Card
getCard()
PaymentMethod.CardPresent
getCardPresent()
java.lang.Long
getCreated()
Time at which the object was created.java.lang.String
getCustomer()
Get ID of expandablecustomer
object.Customer
getCustomerObject()
Get expandedcustomer
.PaymentMethod.Eps
getEps()
PaymentMethod.Fpx
getFpx()
PaymentMethod.Giropay
getGiropay()
PaymentMethod.Grabpay
getGrabpay()
java.lang.String
getId()
Unique identifier for the object.PaymentMethod.Ideal
getIdeal()
PaymentMethod.InteracPresent
getInteracPresent()
java.lang.Boolean
getLivemode()
Has the valuetrue
if the object exists in live mode or the valuefalse
if 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.String
getObject()
String representing the object's type.PaymentMethod.Oxxo
getOxxo()
PaymentMethod.P24
getP24()
PaymentMethod.SepaDebit
getSepaDebit()
PaymentMethod.Sofort
getSofort()
java.lang.String
getType()
The type of the PaymentMethod.int
hashCode()
static PaymentMethodCollection
list(PaymentMethodListParams params)
Returns a list of PaymentMethods for a given Customer.static PaymentMethodCollection
list(PaymentMethodListParams params, RequestOptions options)
Returns a list of PaymentMethods for a given Customer.static PaymentMethodCollection
list(java.util.Map<java.lang.String,java.lang.Object> params)
Returns a list of PaymentMethods for a given Customer.static PaymentMethodCollection
list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Returns a list of PaymentMethods for a given Customer.static PaymentMethod
retrieve(java.lang.String paymentMethod)
Retrieves a PaymentMethod object.static PaymentMethod
retrieve(java.lang.String paymentMethod, RequestOptions options)
Retrieves a PaymentMethod object.static PaymentMethod
retrieve(java.lang.String paymentMethod, PaymentMethodRetrieveParams params, RequestOptions options)
Retrieves a PaymentMethod object.static PaymentMethod
retrieve(java.lang.String paymentMethod, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Retrieves a PaymentMethod object.void
setAlipay(PaymentMethod.Alipay alipay)
void
setAuBecsDebit(PaymentMethod.AuBecsDebit auBecsDebit)
void
setBacsDebit(PaymentMethod.BacsDebit bacsDebit)
void
setBancontact(PaymentMethod.Bancontact bancontact)
void
setBillingDetails(PaymentMethod.BillingDetails billingDetails)
void
setCard(PaymentMethod.Card card)
void
setCardPresent(PaymentMethod.CardPresent cardPresent)
void
setCreated(java.lang.Long created)
Time at which the object was created.void
setCustomer(java.lang.String id)
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
setId(java.lang.String id)
Unique identifier for the object.void
setIdeal(PaymentMethod.Ideal ideal)
void
setInteracPresent(PaymentMethod.InteracPresent interacPresent)
void
setLivemode(java.lang.Boolean livemode)
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach to an object.void
setObject(java.lang.String object)
String representing the object's type.void
setOxxo(PaymentMethod.Oxxo oxxo)
void
setP24(PaymentMethod.P24 p24)
void
setSepaDebit(PaymentMethod.SepaDebit sepaDebit)
void
setSofort(PaymentMethod.Sofort sofort)
void
setType(java.lang.String type)
The type of the PaymentMethod.PaymentMethod
update(PaymentMethodUpdateParams params)
Updates a PaymentMethod object.PaymentMethod
update(PaymentMethodUpdateParams params, RequestOptions options)
Updates a PaymentMethod object.PaymentMethod
update(java.util.Map<java.lang.String,java.lang.Object> params)
Updates a PaymentMethod object.PaymentMethod
update(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 expandablecustomer
object.
-
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:
update
in 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:
update
in 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/attach
endpoint 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/attach
endpoint 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/attach
endpoint 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/attach
endpoint 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
-
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 valuetrue
if the object exists in live mode or the valuefalse
if 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
alipay
,au_becs_debit
,bacs_debit
,bancontact
,card
,eps
,fpx
,giropay
,grabpay
,ideal
,oxxo
,p24
,sepa_debit
, orsofort
.
-
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 valuetrue
if the object exists in live mode or the valuefalse
if 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
alipay
,au_becs_debit
,bacs_debit
,bancontact
,card
,eps
,fpx
,giropay
,grabpay
,ideal
,oxxo
,p24
,sepa_debit
, orsofort
.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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:
getMetadata
in interfaceMetadataStore<PaymentMethod>
-
-