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>,StripeActiveObject,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
-
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, INTERNAL_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThe amount of the transaction.Get ID of expandablecheckoutSessionobject.Get expandedcheckoutSession.Time at which the object was created.Get ID of expandablecreditNoteobject.Get expandedcreditNote.Three-letter ISO currency code, in lowercase.Get ID of expandablecustomerobject.Get expandedcustomer.An arbitrary string attached to the object.The customer'sbalanceafter the transaction was applied.getId()Unique identifier for the object.Get ID of expandableinvoiceobject.Get expandedinvoice.Has the valuetrueif the object exists in live mode or the valuefalseif 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,unapplied_from_invoice,checkout_session_subscription_payment, orcheckout_session_subscription_payment_canceled.inthashCode()voidThe amount of the transaction.voidvoidsetCheckoutSessionObject(Session expandableObject) voidsetCreated(Long created) Time at which the object was created.voidsetCreditNote(String id) voidsetCreditNoteObject(CreditNote expandableObject) voidsetCurrency(String currency) Three-letter ISO currency code, in lowercase.voidsetCustomer(String id) voidsetCustomerAccount(String customerAccount) voidsetCustomerObject(Customer expandableObject) voidsetDescription(String description) An arbitrary string attached to the object.voidsetEndingBalance(Long endingBalance) The customer'sbalanceafter the transaction was applied.voidUnique identifier for the object.voidsetInvoice(String id) voidsetInvoiceObject(Invoice expandableObject) voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidString representing the object's type.voidsetResponseGetter(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.voidTransaction type:adjustment,applied_to_invoice,credit_note,initial,invoice_overpaid,invoice_too_large,invoice_too_small,unspent_receiver_credit,unapplied_from_invoice,checkout_session_subscription_payment, orcheckout_session_subscription_payment_canceled.Most credit balance transaction fields are immutable, but you may update itsdescriptionandmetadata.update(CustomerBalanceTransactionUpdateParams params, RequestOptions options) Most credit balance transaction fields are immutable, but you may update itsdescriptionandmetadata.Most credit balance transaction fields are immutable, but you may update itsdescriptionandmetadata.update(Map<String, Object> params, RequestOptions options) Most credit balance transaction fields are immutable, but you may update itsdescriptionandmetadata.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
CustomerBalanceTransaction
public CustomerBalanceTransaction()
-
-
Method Details
-
getCheckoutSession
Get ID of expandablecheckoutSessionobject. -
setCheckoutSession
-
getCheckoutSessionObject
Get expandedcheckoutSession. -
setCheckoutSessionObject
-
getCreditNote
Get ID of expandablecreditNoteobject. -
setCreditNote
-
getCreditNoteObject
Get expandedcreditNote. -
setCreditNoteObject
-
getCustomer
Get ID of expandablecustomerobject. -
setCustomer
-
getCustomerObject
Get expandedcustomer. -
setCustomerObject
-
getInvoice
Get ID of expandableinvoiceobject. -
setInvoice
-
getInvoiceObject
Get expandedinvoice. -
setInvoiceObject
-
update
Most credit balance transaction fields are immutable, but you may update itsdescriptionandmetadata.- Specified by:
updatein 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 itsdescriptionandmetadata.- Specified by:
updatein interfaceMetadataStore<CustomerBalanceTransaction>- Throws:
StripeException
-
update
public CustomerBalanceTransaction update(CustomerBalanceTransactionUpdateParams params) throws StripeException Most credit balance transaction fields are immutable, but you may update itsdescriptionandmetadata.- Throws:
StripeException
-
update
public CustomerBalanceTransaction update(CustomerBalanceTransactionUpdateParams params, RequestOptions options) throws StripeException Most credit balance transaction fields are immutable, but you may update itsdescriptionandmetadata.- Throws:
StripeException
-
setResponseGetter
Description copied from interface:StripeActiveObjectMethod is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
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. -
getCustomerAccount
-
getDescription
An arbitrary string attached to the object. Often useful for displaying to users. -
getEndingBalance
The customer'sbalanceafter 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 valuetrueif the object exists in live mode or the valuefalseif 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,unapplied_from_invoice,checkout_session_subscription_payment, orcheckout_session_subscription_payment_canceled. See the Customer Balance page to learn more about transaction types.One of
adjustment,applied_to_invoice,checkout_session_subscription_payment,checkout_session_subscription_payment_canceled,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. -
setCustomerAccount
-
setDescription
An arbitrary string attached to the object. Often useful for displaying to users. -
setEndingBalance
The customer'sbalanceafter 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 valuetrueif the object exists in live mode or the valuefalseif 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,unapplied_from_invoice,checkout_session_subscription_payment, orcheckout_session_subscription_payment_canceled. See the Customer Balance page to learn more about transaction types.One of
adjustment,applied_to_invoice,checkout_session_subscription_payment,checkout_session_subscription_payment_canceled,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:
getMetadatain interfaceMetadataStore<CustomerBalanceTransaction>
-