Package com.stripe.model.billing
Class CreditGrant
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.billing.CreditGrant
- All Implemented Interfaces:
HasId
,MetadataStore<CreditGrant>
,StripeActiveObject
,StripeObjectInterface
A credit grant is an API resource that documents the allocation of some billing credits to a
customer.
Related guide: Billing credits
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
For more details about Amount, please refer to the API Reference.static class
For more details about ApplicabilityConfig, please refer to the API Reference.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static CreditGrant
create
(CreditGrantCreateParams params) Creates a credit grant.static CreditGrant
create
(CreditGrantCreateParams params, RequestOptions options) Creates a credit grant.static CreditGrant
Creates a credit grant.static CreditGrant
create
(Map<String, Object> params, RequestOptions options) Creates a credit grant.boolean
expire()
Expires a credit grant.expire
(RequestOptions options) Expires a credit grant.expire
(CreditGrantExpireParams params) Expires a credit grant.expire
(CreditGrantExpireParams params, RequestOptions options) Expires a credit grant.Expires a credit grant.expire
(Map<String, Object> params, RequestOptions options) Expires a credit grant.The category of this credit grant.Time at which the object was created.Get ID of expandablecustomer
object.Get expandedcustomer
.The time when the billing credits become effective-when they're eligible for use.The time when the billing credits expire.getId()
Unique identifier for the object.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.getName()
A descriptive name shown in dashboard.String representing the object's type.The priority for applying this credit grant.Get ID of expandabletestClock
object.Get expandedtestClock
.Time at which the object was last updated.The time when this credit grant was voided.int
hashCode()
static CreditGrantCollection
list
(CreditGrantListParams params) Retrieve a list of credit grants.static CreditGrantCollection
list
(CreditGrantListParams params, RequestOptions options) Retrieve a list of credit grants.static CreditGrantCollection
Retrieve a list of credit grants.static CreditGrantCollection
list
(Map<String, Object> params, RequestOptions options) Retrieve a list of credit grants.static CreditGrant
Retrieves a credit grant.static CreditGrant
retrieve
(String id, RequestOptions options) Retrieves a credit grant.static CreditGrant
retrieve
(String id, CreditGrantRetrieveParams params, RequestOptions options) Retrieves a credit grant.static CreditGrant
Retrieves a credit grant.void
setAmount
(CreditGrant.Amount amount) void
setApplicabilityConfig
(CreditGrant.ApplicabilityConfig applicabilityConfig) void
setCategory
(String category) The category of this credit grant.void
setCreated
(Long created) Time at which the object was created.void
setCustomer
(String id) void
setCustomerObject
(Customer expandableObject) void
setEffectiveAt
(Long effectiveAt) The time when the billing credits become effective-when they're eligible for use.void
setExpiresAt
(Long expiresAt) The time when the billing credits expire.void
Unique identifier for the object.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
A descriptive name shown in dashboard.void
String representing the object's type.void
setPriority
(Long priority) The priority for applying this credit grant.void
setResponseGetter
(StripeResponseGetter responseGetter) Unique identifier for the object.void
setTestClock
(String id) void
setTestClockObject
(TestClock expandableObject) void
setUpdated
(Long updated) Time at which the object was last updated.void
setVoidedAt
(Long voidedAt) The time when this credit grant was voided.update
(CreditGrantUpdateParams params) Updates a credit grant.update
(CreditGrantUpdateParams params, RequestOptions options) Updates a credit grant.Updates a credit grant.update
(Map<String, Object> params, RequestOptions options) Updates a credit grant.Voids a credit grant.voidGrant
(RequestOptions options) Voids a credit grant.voidGrant
(CreditGrantVoidGrantParams params) Voids a credit grant.voidGrant
(CreditGrantVoidGrantParams params, RequestOptions options) Voids a credit grant.Voids a credit grant.voidGrant
(Map<String, Object> params, RequestOptions options) Voids a credit grant.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, 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
-
CreditGrant
public CreditGrant()
-
-
Method Details
-
getCustomer
Get ID of expandablecustomer
object. -
setCustomer
-
getCustomerObject
Get expandedcustomer
. -
setCustomerObject
-
getTestClock
Get ID of expandabletestClock
object. -
setTestClock
-
getTestClockObject
Get expandedtestClock
. -
setTestClockObject
-
create
Creates a credit grant.- Throws:
StripeException
-
create
public static CreditGrant create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a credit grant.- Throws:
StripeException
-
create
Creates a credit grant.- Throws:
StripeException
-
create
public static CreditGrant create(CreditGrantCreateParams params, RequestOptions options) throws StripeException Creates a credit grant.- Throws:
StripeException
-
expire
Expires a credit grant.- Throws:
StripeException
-
expire
Expires a credit grant.- Throws:
StripeException
-
expire
Expires a credit grant.- Throws:
StripeException
-
expire
Expires a credit grant.- Throws:
StripeException
-
expire
Expires a credit grant.- Throws:
StripeException
-
expire
public CreditGrant expire(CreditGrantExpireParams params, RequestOptions options) throws StripeException Expires a credit grant.- Throws:
StripeException
-
list
Retrieve a list of credit grants.- Throws:
StripeException
-
list
public static CreditGrantCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieve a list of credit grants.- Throws:
StripeException
-
list
Retrieve a list of credit grants.- Throws:
StripeException
-
list
public static CreditGrantCollection list(CreditGrantListParams params, RequestOptions options) throws StripeException Retrieve a list of credit grants.- Throws:
StripeException
-
retrieve
Retrieves a credit grant.- Throws:
StripeException
-
retrieve
Retrieves a credit grant.- Throws:
StripeException
-
retrieve
public static CreditGrant retrieve(String id, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves a credit grant.- Throws:
StripeException
-
retrieve
public static CreditGrant retrieve(String id, CreditGrantRetrieveParams params, RequestOptions options) throws StripeException Retrieves a credit grant.- Throws:
StripeException
-
update
Updates a credit grant.- Specified by:
update
in interfaceMetadataStore<CreditGrant>
- Throws:
StripeException
-
update
Updates a credit grant.- Specified by:
update
in interfaceMetadataStore<CreditGrant>
- Throws:
StripeException
-
update
Updates a credit grant.- Throws:
StripeException
-
update
public CreditGrant update(CreditGrantUpdateParams params, RequestOptions options) throws StripeException Updates a credit grant.- Throws:
StripeException
-
voidGrant
Voids a credit grant.- Throws:
StripeException
-
voidGrant
Voids a credit grant.- Throws:
StripeException
-
voidGrant
Voids a credit grant.- Throws:
StripeException
-
voidGrant
public CreditGrant voidGrant(Map<String, Object> params, RequestOptions options) throws StripeExceptionVoids a credit grant.- Throws:
StripeException
-
voidGrant
Voids a credit grant.- Throws:
StripeException
-
voidGrant
public CreditGrant voidGrant(CreditGrantVoidGrantParams params, RequestOptions options) throws StripeException Voids a credit grant.- Throws:
StripeException
-
setResponseGetter
Unique identifier for the object.- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance to use for making further requests.
-
getAmount
-
getApplicabilityConfig
-
getCategory
The category of this credit grant. This is for tracking purposes and isn't displayed to the customer.One of
paid
, orpromotional
. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getEffectiveAt
The time when the billing credits become effective-when they're eligible for use. -
getExpiresAt
The time when the billing credits expire. If not present, the billing credits don't expire. -
getLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
getName
A descriptive name shown in dashboard. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
billing.credit_grant
. -
getPriority
The priority for applying this credit grant. The highest priority is 0 and the lowest is 100. -
getUpdated
Time at which the object was last updated. Measured in seconds since the Unix epoch. -
getVoidedAt
The time when this credit grant was voided. If not present, the credit grant hasn't been voided. -
setAmount
-
setApplicabilityConfig
-
setCategory
The category of this credit grant. This is for tracking purposes and isn't displayed to the customer.One of
paid
, orpromotional
. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setEffectiveAt
The time when the billing credits become effective-when they're eligible for use. -
setExpiresAt
The time when the billing credits expire. If not present, the billing credits don't expire. -
setId
Unique identifier for the object. -
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. -
setName
A descriptive name shown in dashboard. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
billing.credit_grant
. -
setPriority
The priority for applying this credit grant. The highest priority is 0 and the lowest is 100. -
setUpdated
Time at which the object was last updated. Measured in seconds since the Unix epoch. -
setVoidedAt
The time when this credit grant was voided. If not present, the credit grant hasn't been voided. -
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<CreditGrant>
-