public class Charge extends ApiResource implements MetadataStore<Charge>, BalanceTransactionSource
Modifier and Type | Class and Description |
---|---|
static class |
Charge.AlternateStatementDescriptors |
static class |
Charge.FraudDetails |
static class |
Charge.Level3 |
static class |
Charge.Outcome |
static class |
Charge.PaymentMethodDetails |
static class |
Charge.TransferData |
ApiResource.RequestMethod, ApiResource.RequestType
CHARSET, GSON
PRETTY_PRINT_GSON
Constructor and Description |
---|
Charge() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(java.lang.Object other) |
Charge |
capture()
Capture the payment of an existing, uncaptured, charge.
|
Charge |
capture(ChargeCaptureParams params)
Capture the payment of an existing, uncaptured, charge.
|
Charge |
capture(ChargeCaptureParams params,
RequestOptions options)
Capture the payment of an existing, uncaptured, charge.
|
Charge |
capture(java.util.Map<java.lang.String,java.lang.Object> params)
Capture the payment of an existing, uncaptured, charge.
|
Charge |
capture(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Capture the payment of an existing, uncaptured, charge.
|
Charge |
capture(RequestOptions options)
Capture the payment of an existing, uncaptured, charge.
|
static Charge |
create(ChargeCreateParams params)
To charge a credit card or other payment source, you create a
Charge object. |
static Charge |
create(ChargeCreateParams params,
RequestOptions options)
To charge a credit card or other payment source, you create a
Charge object. |
static Charge |
create(java.util.Map<java.lang.String,java.lang.Object> params)
To charge a credit card or other payment source, you create a
Charge object. |
static Charge |
create(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
To charge a credit card or other payment source, you create a
Charge object. |
boolean |
equals(java.lang.Object o) |
Charge.AlternateStatementDescriptors |
getAlternateStatementDescriptors() |
java.lang.Long |
getAmount()
A positive integer representing how much to charge in the [smallest currency
unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100
to charge ¥100, a zero-decimal currency).
|
java.lang.Long |
getAmountRefunded()
Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund
was issued).
|
java.lang.String |
getApplication()
Get id of expandable `application` object.
|
java.lang.String |
getApplicationFee()
Get id of expandable `applicationFee` object.
|
java.lang.Long |
getApplicationFeeAmount()
The amount of the application fee (if any) for the charge.
|
ApplicationFee |
getApplicationFeeObject()
Get expanded `applicationFee`.
|
Application |
getApplicationObject()
Get expanded `application`.
|
java.lang.String |
getAuthorizationCode()
Authorization code on the charge.
|
java.lang.String |
getBalanceTransaction()
Get id of expandable `balanceTransaction` object.
|
BalanceTransaction |
getBalanceTransactionObject()
Get expanded `balanceTransaction`.
|
PaymentMethod.BillingDetails |
getBillingDetails() |
java.lang.Boolean |
getCaptured()
If the charge was created without capturing, this Boolean represents whether it is still
uncaptured or has since been captured.
|
java.lang.Long |
getCreated()
Time at which the object was created.
|
java.lang.String |
getCurrency()
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in
lowercase.
|
java.lang.String |
getCustomer()
Get id of expandable `customer` object.
|
Customer |
getCustomerObject()
Get expanded `customer`.
|
java.lang.String |
getDescription()
An arbitrary string attached to the object.
|
java.lang.String |
getDestination()
Get id of expandable `destination` object.
|
Account |
getDestinationObject()
Get expanded `destination`.
|
java.lang.String |
getDispute()
Get id of expandable `dispute` object.
|
Dispute |
getDisputeObject()
Get expanded `dispute`.
|
java.lang.String |
getFailureCode()
Error code explaining reason for charge failure if available (see [the errors
section](https://stripe.com/docs/api#errors) for a list of codes).
|
java.lang.String |
getFailureMessage()
Message to user further explaining reason for charge failure if available.
|
Charge.FraudDetails |
getFraudDetails()
Information on fraud assessments for the charge.
|
java.lang.String |
getId()
Unique identifier for the object.
|
java.lang.String |
getInvoice()
Get id of expandable `invoice` object.
|
Invoice |
getInvoiceObject()
Get expanded `invoice`.
|
Charge.Level3 |
getLevel3() |
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 |
getOnBehalfOf()
Get id of expandable `onBehalfOf` object.
|
Account |
getOnBehalfOfObject()
Get expanded `onBehalfOf`.
|
java.lang.String |
getOrder()
Get id of expandable `order` object.
|
Order |
getOrderObject()
Get expanded `order`.
|
Charge.Outcome |
getOutcome()
Details about whether the payment was accepted, and why.
|
java.lang.Boolean |
getPaid()
`true` if the charge succeeded, or was successfully authorized for later capture.
|
java.lang.String |
getPaymentIntent()
ID of the PaymentIntent associated with this charge, if one exists.
|
java.lang.String |
getPaymentMethod()
ID of the payment method used in this charge.
|
Charge.PaymentMethodDetails |
getPaymentMethodDetails()
Details about the payment method at the time of the transaction.
|
java.lang.String |
getReceiptEmail()
This is the email address that the receipt for this charge was sent to.
|
java.lang.String |
getReceiptNumber()
This is the transaction number that appears on email receipts sent for this charge.
|
java.lang.String |
getReceiptUrl()
This is the URL to view the receipt for this charge.
|
java.lang.Boolean |
getRefunded()
Whether the charge has been fully refunded.
|
RefundCollection |
getRefunds()
A list of refunds that have been applied to the charge.
|
java.lang.String |
getReview()
Get id of expandable `review` object.
|
Review |
getReviewObject()
Get expanded `review`.
|
ShippingDetails |
getShipping()
Shipping information for the charge.
|
PaymentSource |
getSource()
This is a legacy field that will be removed in the future.
|
java.lang.String |
getSourceTransfer()
Get id of expandable `sourceTransfer` object.
|
Transfer |
getSourceTransferObject()
Get expanded `sourceTransfer`.
|
java.lang.String |
getStatementDescriptor()
For card charges, use `statement_descriptor_suffix` instead.
|
java.lang.String |
getStatementDescriptorSuffix()
Provides information about the charge that customers see on their statements.
|
java.lang.String |
getStatus()
The status of the payment is either `succeeded`, `pending`, or `failed`.
|
java.lang.String |
getTransfer()
Get id of expandable `transfer` object.
|
Charge.TransferData |
getTransferData()
An optional dictionary including the account to automatically transfer to as part of a
destination charge.
|
java.lang.String |
getTransferGroup()
A string that identifies this transaction as part of a group.
|
Transfer |
getTransferObject()
Get expanded `transfer`.
|
int |
hashCode() |
static ChargeCollection |
list(ChargeListParams params)
Returns a list of charges you’ve previously created.
|
static ChargeCollection |
list(ChargeListParams params,
RequestOptions options)
Returns a list of charges you’ve previously created.
|
static ChargeCollection |
list(java.util.Map<java.lang.String,java.lang.Object> params)
Returns a list of charges you’ve previously created.
|
static ChargeCollection |
list(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Returns a list of charges you’ve previously created.
|
static Charge |
retrieve(java.lang.String charge)
Retrieves the details of a charge that has previously been created.
|
static Charge |
retrieve(java.lang.String charge,
ChargeRetrieveParams params,
RequestOptions options)
Retrieves the details of a charge that has previously been created.
|
static Charge |
retrieve(java.lang.String charge,
java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Retrieves the details of a charge that has previously been created.
|
static Charge |
retrieve(java.lang.String charge,
RequestOptions options)
Retrieves the details of a charge that has previously been created.
|
void |
setAlternateStatementDescriptors(Charge.AlternateStatementDescriptors alternateStatementDescriptors) |
void |
setAmount(java.lang.Long amount)
A positive integer representing how much to charge in the [smallest currency
unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100
to charge ¥100, a zero-decimal currency).
|
void |
setAmountRefunded(java.lang.Long amountRefunded)
Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund
was issued).
|
void |
setApplication(java.lang.String id) |
void |
setApplicationFee(java.lang.String id) |
void |
setApplicationFeeAmount(java.lang.Long applicationFeeAmount)
The amount of the application fee (if any) for the charge.
|
void |
setApplicationFeeObject(ApplicationFee expandableObject) |
void |
setApplicationObject(Application expandableObject) |
void |
setAuthorizationCode(java.lang.String authorizationCode)
Authorization code on the charge.
|
void |
setBalanceTransaction(java.lang.String id) |
void |
setBalanceTransactionObject(BalanceTransaction expandableObject) |
void |
setBillingDetails(PaymentMethod.BillingDetails billingDetails) |
void |
setCaptured(java.lang.Boolean captured)
If the charge was created without capturing, this Boolean represents whether it is still
uncaptured or has since been captured.
|
void |
setCreated(java.lang.Long created)
Time at which the object was created.
|
void |
setCurrency(java.lang.String currency)
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in
lowercase.
|
void |
setCustomer(java.lang.String id) |
void |
setCustomerObject(Customer expandableObject) |
void |
setDescription(java.lang.String description)
An arbitrary string attached to the object.
|
void |
setDestination(java.lang.String id) |
void |
setDestinationObject(Account expandableObject) |
void |
setDispute(java.lang.String id) |
void |
setDisputeObject(Dispute expandableObject) |
void |
setFailureCode(java.lang.String failureCode)
Error code explaining reason for charge failure if available (see [the errors
section](https://stripe.com/docs/api#errors) for a list of codes).
|
void |
setFailureMessage(java.lang.String failureMessage)
Message to user further explaining reason for charge failure if available.
|
void |
setFraudDetails(Charge.FraudDetails fraudDetails)
Information on fraud assessments for the charge.
|
void |
setId(java.lang.String id)
Unique identifier for the object.
|
void |
setInvoice(java.lang.String id) |
void |
setInvoiceObject(Invoice expandableObject) |
void |
setLevel3(Charge.Level3 level3) |
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 |
setOnBehalfOf(java.lang.String id) |
void |
setOnBehalfOfObject(Account expandableObject) |
void |
setOrder(java.lang.String id) |
void |
setOrderObject(Order expandableObject) |
void |
setOutcome(Charge.Outcome outcome)
Details about whether the payment was accepted, and why.
|
void |
setPaid(java.lang.Boolean paid)
`true` if the charge succeeded, or was successfully authorized for later capture.
|
void |
setPaymentIntent(java.lang.String paymentIntent)
ID of the PaymentIntent associated with this charge, if one exists.
|
void |
setPaymentMethod(java.lang.String paymentMethod)
ID of the payment method used in this charge.
|
void |
setPaymentMethodDetails(Charge.PaymentMethodDetails paymentMethodDetails)
Details about the payment method at the time of the transaction.
|
void |
setReceiptEmail(java.lang.String receiptEmail)
This is the email address that the receipt for this charge was sent to.
|
void |
setReceiptNumber(java.lang.String receiptNumber)
This is the transaction number that appears on email receipts sent for this charge.
|
void |
setReceiptUrl(java.lang.String receiptUrl)
This is the URL to view the receipt for this charge.
|
void |
setRefunded(java.lang.Boolean refunded)
Whether the charge has been fully refunded.
|
void |
setRefunds(RefundCollection refunds)
A list of refunds that have been applied to the charge.
|
void |
setReview(java.lang.String id) |
void |
setReviewObject(Review expandableObject) |
void |
setShipping(ShippingDetails shipping)
Shipping information for the charge.
|
void |
setSource(PaymentSource source)
This is a legacy field that will be removed in the future.
|
void |
setSourceTransfer(java.lang.String id) |
void |
setSourceTransferObject(Transfer expandableObject) |
void |
setStatementDescriptor(java.lang.String statementDescriptor)
For card charges, use `statement_descriptor_suffix` instead.
|
void |
setStatementDescriptorSuffix(java.lang.String statementDescriptorSuffix)
Provides information about the charge that customers see on their statements.
|
void |
setStatus(java.lang.String status)
The status of the payment is either `succeeded`, `pending`, or `failed`.
|
void |
setTransfer(java.lang.String id) |
void |
setTransferData(Charge.TransferData transferData)
An optional dictionary including the account to automatically transfer to as part of a
destination charge.
|
void |
setTransferGroup(java.lang.String transferGroup)
A string that identifies this transaction as part of a group.
|
void |
setTransferObject(Transfer expandableObject) |
Charge |
update(ChargeUpdateParams params)
Updates the specified charge by setting the values of the parameters passed.
|
Charge |
update(ChargeUpdateParams params,
RequestOptions options)
Updates the specified charge by setting the values of the parameters passed.
|
Charge |
update(java.util.Map<java.lang.String,java.lang.Object> params)
Updates the specified charge by setting the values of the parameters passed.
|
Charge |
update(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Updates the specified charge by setting the values of the parameters passed.
|
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, multipartRequest, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
public java.lang.String getApplication()
public void setApplication(java.lang.String id)
public Application getApplicationObject()
public void setApplicationObject(Application expandableObject)
public java.lang.String getApplicationFee()
public void setApplicationFee(java.lang.String id)
public ApplicationFee getApplicationFeeObject()
public void setApplicationFeeObject(ApplicationFee expandableObject)
public java.lang.String getBalanceTransaction()
public void setBalanceTransaction(java.lang.String id)
public BalanceTransaction getBalanceTransactionObject()
public void setBalanceTransactionObject(BalanceTransaction expandableObject)
public java.lang.String getCustomer()
public void setCustomer(java.lang.String id)
public Customer getCustomerObject()
public void setCustomerObject(Customer expandableObject)
public java.lang.String getDestination()
public void setDestination(java.lang.String id)
public Account getDestinationObject()
public void setDestinationObject(Account expandableObject)
public java.lang.String getDispute()
public void setDispute(java.lang.String id)
public Dispute getDisputeObject()
public void setDisputeObject(Dispute expandableObject)
public java.lang.String getInvoice()
public void setInvoice(java.lang.String id)
public Invoice getInvoiceObject()
public void setInvoiceObject(Invoice expandableObject)
public java.lang.String getOnBehalfOf()
public void setOnBehalfOf(java.lang.String id)
public Account getOnBehalfOfObject()
public void setOnBehalfOfObject(Account expandableObject)
public java.lang.String getOrder()
public void setOrder(java.lang.String id)
public Order getOrderObject()
public void setOrderObject(Order expandableObject)
public java.lang.String getReview()
public void setReview(java.lang.String id)
public Review getReviewObject()
public void setReviewObject(Review expandableObject)
public java.lang.String getSourceTransfer()
public void setSourceTransfer(java.lang.String id)
public Transfer getSourceTransferObject()
public void setSourceTransferObject(Transfer expandableObject)
public java.lang.String getTransfer()
public void setTransfer(java.lang.String id)
public Transfer getTransferObject()
public void setTransferObject(Transfer expandableObject)
public static ChargeCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
StripeException
public static ChargeCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeException
public static ChargeCollection list(ChargeListParams params) throws StripeException
StripeException
public static ChargeCollection list(ChargeListParams params, RequestOptions options) throws StripeException
StripeException
public static Charge create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Charge
object. If
your API key is in test mode, the supplied payment source (e.g., card) won’t actually be
charged, although everything else will occur as if in live mode. (Stripe assumes that the
charge would have completed successfully).StripeException
public static Charge create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Charge
object. If
your API key is in test mode, the supplied payment source (e.g., card) won’t actually be
charged, although everything else will occur as if in live mode. (Stripe assumes that the
charge would have completed successfully).StripeException
public static Charge create(ChargeCreateParams params) throws StripeException
Charge
object. If
your API key is in test mode, the supplied payment source (e.g., card) won’t actually be
charged, although everything else will occur as if in live mode. (Stripe assumes that the
charge would have completed successfully).StripeException
public static Charge create(ChargeCreateParams params, RequestOptions options) throws StripeException
Charge
object. If
your API key is in test mode, the supplied payment source (e.g., card) won’t actually be
charged, although everything else will occur as if in live mode. (Stripe assumes that the
charge would have completed successfully).StripeException
public static Charge retrieve(java.lang.String charge) throws StripeException
StripeException
public static Charge retrieve(java.lang.String charge, RequestOptions options) throws StripeException
StripeException
public static Charge retrieve(java.lang.String charge, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
StripeException
public static Charge retrieve(java.lang.String charge, ChargeRetrieveParams params, RequestOptions options) throws StripeException
StripeException
public Charge update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
update
in interface MetadataStore<Charge>
StripeException
public Charge update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
update
in interface MetadataStore<Charge>
StripeException
public Charge update(ChargeUpdateParams params) throws StripeException
StripeException
public Charge update(ChargeUpdateParams params, RequestOptions options) throws StripeException
StripeException
public Charge capture() throws StripeException
Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.
StripeException
public Charge capture(RequestOptions options) throws StripeException
Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.
StripeException
public Charge capture(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.
StripeException
public Charge capture(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.
StripeException
public Charge capture(ChargeCaptureParams params) throws StripeException
Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.
StripeException
public Charge capture(ChargeCaptureParams params, RequestOptions options) throws StripeException
Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.
StripeException
public Charge.AlternateStatementDescriptors getAlternateStatementDescriptors()
public java.lang.Long getAmount()
public java.lang.Long getAmountRefunded()
public java.lang.Long getApplicationFeeAmount()
public java.lang.String getAuthorizationCode()
public PaymentMethod.BillingDetails getBillingDetails()
public java.lang.Boolean getCaptured()
public java.lang.Long getCreated()
public java.lang.String getCurrency()
public java.lang.String getDescription()
public java.lang.String getFailureCode()
public java.lang.String getFailureMessage()
public Charge.FraudDetails getFraudDetails()
public Charge.Level3 getLevel3()
public java.lang.Boolean getLivemode()
public java.lang.String getObject()
public Charge.Outcome getOutcome()
public java.lang.Boolean getPaid()
public java.lang.String getPaymentIntent()
public java.lang.String getPaymentMethod()
public Charge.PaymentMethodDetails getPaymentMethodDetails()
public java.lang.String getReceiptEmail()
public java.lang.String getReceiptNumber()
public java.lang.String getReceiptUrl()
public java.lang.Boolean getRefunded()
public RefundCollection getRefunds()
public ShippingDetails getShipping()
public PaymentSource getSource()
public java.lang.String getStatementDescriptor()
public java.lang.String getStatementDescriptorSuffix()
public java.lang.String getStatus()
public Charge.TransferData getTransferData()
public java.lang.String getTransferGroup()
public void setAlternateStatementDescriptors(Charge.AlternateStatementDescriptors alternateStatementDescriptors)
public void setAmount(java.lang.Long amount)
public void setAmountRefunded(java.lang.Long amountRefunded)
public void setApplicationFeeAmount(java.lang.Long applicationFeeAmount)
public void setAuthorizationCode(java.lang.String authorizationCode)
public void setBillingDetails(PaymentMethod.BillingDetails billingDetails)
public void setCaptured(java.lang.Boolean captured)
public void setCreated(java.lang.Long created)
public void setCurrency(java.lang.String currency)
public void setDescription(java.lang.String description)
public void setFailureCode(java.lang.String failureCode)
public void setFailureMessage(java.lang.String failureMessage)
public void setFraudDetails(Charge.FraudDetails fraudDetails)
public void setId(java.lang.String id)
public void setLevel3(Charge.Level3 level3)
public void setLivemode(java.lang.Boolean livemode)
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
public void setObject(java.lang.String object)
public void setOutcome(Charge.Outcome outcome)
public void setPaid(java.lang.Boolean paid)
public void setPaymentIntent(java.lang.String paymentIntent)
public void setPaymentMethod(java.lang.String paymentMethod)
public void setPaymentMethodDetails(Charge.PaymentMethodDetails paymentMethodDetails)
public void setReceiptEmail(java.lang.String receiptEmail)
public void setReceiptNumber(java.lang.String receiptNumber)
public void setReceiptUrl(java.lang.String receiptUrl)
public void setRefunded(java.lang.Boolean refunded)
public void setRefunds(RefundCollection refunds)
public void setShipping(ShippingDetails shipping)
public void setSource(PaymentSource source)
public void setStatementDescriptor(java.lang.String statementDescriptor)
public void setStatementDescriptorSuffix(java.lang.String statementDescriptorSuffix)
public void setStatus(java.lang.String status)
public void setTransferData(Charge.TransferData transferData)
public void setTransferGroup(java.lang.String transferGroup)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected boolean canEqual(java.lang.Object other)
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getId()
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
getMetadata
in interface MetadataStore<Charge>