Package com.stripe.model
Class PaymentMethod
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.PaymentMethod
-
- All Implemented Interfaces:
HasId
,MetadataStore<PaymentMethod>
public class PaymentMethod extends ApiResource implements HasId, MetadataStore<PaymentMethod>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PaymentMethod.BillingDetails
static class
PaymentMethod.Card
static class
PaymentMethod.CardPresent
Owner's verified shipping address.-
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod, ApiResource.RequestType
-
-
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(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(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(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.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 expandable `customer` object.Customer
getCustomerObject()
Get expanded `customer`.java.lang.String
getId()
Unique identifier for the object.java.lang.Boolean
getLivemode()
Has the value `true` if the object exists in live mode or the value `false` 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.java.lang.String
getType()
The type of the PaymentMethod, one of `card` or `card_present`.int
hashCode()
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, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Retrieves a PaymentMethod object.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
setId(java.lang.String id)
Unique identifier for the object.void
setLivemode(java.lang.Boolean livemode)
Has the value `true` if the object exists in live mode or the value `false` 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
setType(java.lang.String type)
The type of the PaymentMethod, one of `card` or `card_present`.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
classUrl, classUrl, instanceUrl, instanceUrl, multipartRequest, request, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
getCustomer
public java.lang.String getCustomer()
Get id of expandable `customer` object.
-
setCustomer
public void setCustomer(java.lang.String id)
-
getCustomerObject
public Customer getCustomerObject()
Get expanded `customer`.
-
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
-
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
-
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
-
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
-
attach
public PaymentMethod attach(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Attaches a PaymentMethod object to a Customer.- 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.- 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
-
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.
-
getLivemode
public java.lang.Boolean getLivemode()
Has the value `true` if the object exists in live mode or the value `false` 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.
-
getType
public java.lang.String getType()
The type of the PaymentMethod, one of `card` or `card_present`. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
-
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.
-
setId
public void setId(java.lang.String id)
Unique identifier for the object.
-
setLivemode
public void setLivemode(java.lang.Boolean livemode)
Has the value `true` if the object exists in live mode or the value `false` 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.
-
setType
public void setType(java.lang.String type)
The type of the PaymentMethod, one of `card` or `card_present`. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
-
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>
-
-