Package com.stripe.model
Class CustomerBalanceTransaction
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.CustomerBalanceTransaction
- All Implemented Interfaces:
HasId
,MetadataStore<CustomerBalanceTransaction>
,StripeObjectInterface
public class CustomerBalanceTransaction
extends ApiResource
implements HasId, MetadataStore<CustomerBalanceTransaction>
Each customer has a
balance
value, which denotes a debit or credit that's automatically applied to their next invoice upon
finalization. You may modify the value directly by using the update customer API, or by creating a
Customer Balance Transaction, which increments or decrements the customer's balance
by
the specified amount
.
Related guide: Customer Balance to learn more.
-
Nested Class Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The amount of the transaction.Time at which the object was created.Get ID of expandablecreditNote
object.Get expandedcreditNote
.Three-letter ISO currency code, in lowercase.Get ID of expandablecustomer
object.Get expandedcustomer
.An arbitrary string attached to the object.The customer'sbalance
after the transaction was applied.getId()
Unique identifier for the object.Get ID of expandableinvoice
object.Get expandedinvoice
.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.String representing the object's type.getType()
Transaction type:adjustment
,applied_to_invoice
,credit_note
,initial
,invoice_overpaid
,invoice_too_large
,invoice_too_small
,unspent_receiver_credit
, orunapplied_from_invoice
.int
hashCode()
void
The amount of the transaction.void
setCreated
(Long created) Time at which the object was created.void
setCreditNote
(String id) void
setCreditNoteObject
(CreditNote expandableObject) void
setCurrency
(String currency) Three-letter ISO currency code, in lowercase.void
setCustomer
(String id) void
setCustomerObject
(Customer expandableObject) void
setDescription
(String description) An arbitrary string attached to the object.void
setEndingBalance
(Long endingBalance) The customer'sbalance
after the transaction was applied.void
Unique identifier for the object.void
setInvoice
(String id) void
setInvoiceObject
(Invoice expandableObject) 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
String representing the object's type.void
Transaction type:adjustment
,applied_to_invoice
,credit_note
,initial
,invoice_overpaid
,invoice_too_large
,invoice_too_small
,unspent_receiver_credit
, orunapplied_from_invoice
.Most credit balance transaction fields are immutable, but you may update itsdescription
andmetadata
.update
(CustomerBalanceTransactionUpdateParams params, RequestOptions options) Most credit balance transaction fields are immutable, but you may update itsdescription
andmetadata
.Most credit balance transaction fields are immutable, but you may update itsdescription
andmetadata
.update
(Map<String, Object> params, RequestOptions options) Most credit balance transaction fields are immutable, but you may update itsdescription
andmetadata
.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, classUrl, classUrl, fullUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, requestSearchResult, requestSearchResult, requestStream, requestStream, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
Constructor Details
-
CustomerBalanceTransaction
public CustomerBalanceTransaction()
-
-
Method Details
-
getCreditNote
Get ID of expandablecreditNote
object. -
setCreditNote
-
getCreditNoteObject
Get expandedcreditNote
. -
setCreditNoteObject
-
getCustomer
Get ID of expandablecustomer
object. -
setCustomer
-
getCustomerObject
Get expandedcustomer
. -
setCustomerObject
-
getInvoice
Get ID of expandableinvoice
object. -
setInvoice
-
getInvoiceObject
Get expandedinvoice
. -
setInvoiceObject
-
update
Most credit balance transaction fields are immutable, but you may update itsdescription
andmetadata
.- Specified by:
update
in interfaceMetadataStore<CustomerBalanceTransaction>
- Throws:
StripeException
-
update
public CustomerBalanceTransaction update(Map<String, Object> params, RequestOptions options) throws StripeExceptionMost credit balance transaction fields are immutable, but you may update itsdescription
andmetadata
.- Specified by:
update
in interfaceMetadataStore<CustomerBalanceTransaction>
- Throws:
StripeException
-
update
public CustomerBalanceTransaction update(CustomerBalanceTransactionUpdateParams params) throws StripeException Most credit balance transaction fields are immutable, but you may update itsdescription
andmetadata
.- Throws:
StripeException
-
update
public CustomerBalanceTransaction update(CustomerBalanceTransactionUpdateParams params, RequestOptions options) throws StripeException Most credit balance transaction fields are immutable, but you may update itsdescription
andmetadata
.- Throws:
StripeException
-
getAmount
The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer'sbalance
. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getDescription
An arbitrary string attached to the object. Often useful for displaying to users. -
getEndingBalance
The customer'sbalance
after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. -
getLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
customer_balance_transaction
. -
getType
Transaction type:adjustment
,applied_to_invoice
,credit_note
,initial
,invoice_overpaid
,invoice_too_large
,invoice_too_small
,unspent_receiver_credit
, orunapplied_from_invoice
. See the Customer Balance page to learn more about transaction types.One of
adjustment
,applied_to_invoice
,credit_note
,initial
,invoice_overpaid
,invoice_too_large
,invoice_too_small
,migration
,unapplied_from_invoice
, orunspent_receiver_credit
. -
setAmount
The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer'sbalance
. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setDescription
An arbitrary string attached to the object. Often useful for displaying to users. -
setEndingBalance
The customer'sbalance
after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. -
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. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
customer_balance_transaction
. -
setType
Transaction type:adjustment
,applied_to_invoice
,credit_note
,initial
,invoice_overpaid
,invoice_too_large
,invoice_too_small
,unspent_receiver_credit
, orunapplied_from_invoice
. See the Customer Balance page to learn more about transaction types.One of
adjustment
,applied_to_invoice
,credit_note
,initial
,invoice_overpaid
,invoice_too_large
,invoice_too_small
,migration
,unapplied_from_invoice
, orunspent_receiver_credit
. -
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<CustomerBalanceTransaction>
-