Package com.stripe.model.giftcards
Class Card
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.giftcards.Card
- All Implemented Interfaces:
HasId
,MetadataStore<Card>
,StripeActiveObject
,StripeObjectInterface
A gift card represents a single gift card owned by a customer, including the remaining balance,
gift card code, and whether or not it is active.
-
Nested Class Summary
Nested ClassesNested 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static Card
create
(CardCreateParams params) Creates a new gift card object.static Card
create
(CardCreateParams params, RequestOptions options) Creates a new gift card object.static Card
Creates a new gift card object.static Card
create
(Map<String, Object> params, RequestOptions options) Creates a new gift card object.boolean
Whether this gift card can be used or not.The amount of funds available for new transactions.The amount of funds marked as held.getCode()
Code used to redeem this gift card.Time at which the object was created.The related Stripe objects that created this gift card.Three-letter ISO currency code, in lowercase.getId()
Unique identifier for the object.Set of key-value pairs that you can attach to an object.String representing the object's type.Transactions on this gift card.int
hashCode()
static CardCollection
list
(CardListParams params) List gift cards for an account.static CardCollection
list
(CardListParams params, RequestOptions options) List gift cards for an account.static CardCollection
List gift cards for an account.static CardCollection
list
(Map<String, Object> params, RequestOptions options) List gift cards for an account.static Card
Retrieve a gift card by id.static Card
retrieve
(String id, RequestOptions options) Retrieve a gift card by id.static Card
retrieve
(String id, CardRetrieveParams params, RequestOptions options) Retrieve a gift card by id.static Card
Retrieve a gift card by id.void
Whether this gift card can be used or not.void
setAmountAvailable
(Long amountAvailable) The amount of funds available for new transactions.void
setAmountHeld
(Long amountHeld) The amount of funds marked as held.void
Code used to redeem this gift card.void
setCreated
(Long created) Time at which the object was created.void
setCreatedBy
(Card.CreatedBy createdBy) The related Stripe objects that created this gift card.void
setCurrency
(String currency) Three-letter ISO currency code, in lowercase.void
Unique identifier for the object.void
setMetadata
(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.void
String representing the object's type.void
setResponseGetter
(StripeResponseGetter responseGetter) The PaymentIntent that created this object.void
setTransactions
(TransactionCollection transactions) Transactions on this gift card.update
(CardUpdateParams params) Update a gift card.update
(CardUpdateParams params, RequestOptions options) Update a gift card.Update a gift card.update
(Map<String, Object> params, RequestOptions options) Update a gift card.static Card
validate
(CardValidateParams params) Validates a gift card code, returning the matching gift card object if it exists.static Card
validate
(CardValidateParams params, RequestOptions options) Validates a gift card code, returning the matching gift card object if it exists.static Card
Validates a gift card code, returning the matching gift card object if it exists.static Card
validate
(Map<String, Object> params, RequestOptions options) Validates a gift card code, returning the matching gift card object if it exists.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, rawRequest, setExpandableFieldId, setStripeResponseGetter, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
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
-
Card
public Card()
-
-
Method Details
-
create
Creates a new gift card object.- Throws:
StripeException
-
create
Creates a new gift card object.- Throws:
StripeException
-
create
Creates a new gift card object.- Throws:
StripeException
-
create
Creates a new gift card object.- Throws:
StripeException
-
list
List gift cards for an account.- Throws:
StripeException
-
list
public static CardCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionList gift cards for an account.- Throws:
StripeException
-
list
List gift cards for an account.- Throws:
StripeException
-
list
public static CardCollection list(CardListParams params, RequestOptions options) throws StripeException List gift cards for an account.- Throws:
StripeException
-
retrieve
Retrieve a gift card by id.- Throws:
StripeException
-
retrieve
Retrieve a gift card by id.- Throws:
StripeException
-
retrieve
public static Card retrieve(String id, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieve a gift card by id.- Throws:
StripeException
-
retrieve
public static Card retrieve(String id, CardRetrieveParams params, RequestOptions options) throws StripeException Retrieve a gift card by id.- Throws:
StripeException
-
update
Update a gift card.- Specified by:
update
in interfaceMetadataStore<Card>
- Throws:
StripeException
-
update
Update a gift card.- Specified by:
update
in interfaceMetadataStore<Card>
- Throws:
StripeException
-
update
Update a gift card.- Throws:
StripeException
-
update
Update a gift card.- Throws:
StripeException
-
validate
Validates a gift card code, returning the matching gift card object if it exists.- Throws:
StripeException
-
validate
public static Card validate(Map<String, Object> params, RequestOptions options) throws StripeExceptionValidates a gift card code, returning the matching gift card object if it exists.- Throws:
StripeException
-
validate
Validates a gift card code, returning the matching gift card object if it exists.- Throws:
StripeException
-
validate
public static Card validate(CardValidateParams params, RequestOptions options) throws StripeException Validates a gift card code, returning the matching gift card object if it exists.- Throws:
StripeException
-
setResponseGetter
The PaymentIntent that created this object.- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance to use for making further requests.
-
getActive
Whether this gift card can be used or not. -
getAmountAvailable
The amount of funds available for new transactions. -
getAmountHeld
The amount of funds marked as held. -
getCode
Code used to redeem this gift card. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCreatedBy
The related Stripe objects that created this gift card. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
gift_cards.card
. -
getTransactions
Transactions on this gift card. -
setActive
Whether this gift card can be used or not. -
setAmountAvailable
The amount of funds available for new transactions. -
setAmountHeld
The amount of funds marked as held. -
setCode
Code used to redeem this gift card. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCreatedBy
The related Stripe objects that created this gift card. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setId
Unique identifier for the object. -
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. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
gift_cards.card
. -
setTransactions
Transactions on this gift card. -
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<Card>
-