Class Charge
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.Charge
-
- All Implemented Interfaces:
BalanceTransactionSource
,HasId
,MetadataStore<Charge>
,StripeObjectInterface
public class Charge extends ApiResource implements MetadataStore<Charge>, BalanceTransactionSource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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
-
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
Constructors Constructor Description Charge()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(java.lang.Object other)
Charge
capture()
Capture the payment of an existing, uncaptured, charge.Charge
capture(RequestOptions options)
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.static Charge
create(ChargeCreateParams params)
To charge a credit card or other payment source, you create aCharge
object.static Charge
create(ChargeCreateParams params, RequestOptions options)
To charge a credit card or other payment source, you create aCharge
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 aCharge
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 aCharge
object.boolean
equals(java.lang.Object o)
Charge.AlternateStatementDescriptors
getAlternateStatementDescriptors()
java.lang.Long
getAmount()
Amount intended to be collected by this payment.java.lang.Long
getAmountCaptured()
Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made).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 expandableapplication
object.java.lang.String
getApplicationFee()
Get ID of expandableapplicationFee
object.java.lang.Long
getApplicationFeeAmount()
The amount of the application fee (if any) requested for the charge.ApplicationFee
getApplicationFeeObject()
Get expandedapplicationFee
.Application
getApplicationObject()
Get expandedapplication
.java.lang.String
getAuthorizationCode()
Authorization code on the charge.java.lang.String
getBalanceTransaction()
Get ID of expandablebalanceTransaction
object.BalanceTransaction
getBalanceTransactionObject()
Get expandedbalanceTransaction
.PaymentMethod.BillingDetails
getBillingDetails()
java.lang.String
getCalculatedStatementDescriptor()
The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements.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, in lowercase.java.lang.String
getCustomer()
Get ID of expandablecustomer
object.Customer
getCustomerObject()
Get expandedcustomer
.java.lang.String
getDescription()
An arbitrary string attached to the object.java.lang.String
getDestination()
Get ID of expandabledestination
object.Account
getDestinationObject()
Get expandeddestination
.java.lang.String
getDispute()
Get ID of expandabledispute
object.java.lang.Boolean
getDisputed()
Whether the charge has been disputed.Dispute
getDisputeObject()
Get expandeddispute
.java.lang.String
getFailureCode()
Error code explaining reason for charge failure if available (see the errors section 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 expandableinvoice
object.Invoice
getInvoiceObject()
Get expandedinvoice
.Charge.Level3
getLevel3()
java.lang.Boolean
getLivemode()
Has the valuetrue
if the object exists in live mode or the valuefalse
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 expandableonBehalfOf
object.Account
getOnBehalfOfObject()
Get expandedonBehalfOf
.java.lang.String
getOrder()
Get ID of expandableorder
object.Order
getOrderObject()
Get expandedorder
.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()
Get ID of expandablepaymentIntent
object.PaymentIntent
getPaymentIntentObject()
Get expandedpaymentIntent
.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 expandablereview
object.Review
getReviewObject()
Get expandedreview
.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 expandablesourceTransfer
object.Transfer
getSourceTransferObject()
Get expandedsourceTransfer
.java.lang.String
getStatementDescriptor()
For card charges, usestatement_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 eithersucceeded
,pending
, orfailed
.java.lang.String
getTransfer()
Get ID of expandabletransfer
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 expandedtransfer
.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, RequestOptions options)
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.void
setAlternateStatementDescriptors(Charge.AlternateStatementDescriptors alternateStatementDescriptors)
void
setAmount(java.lang.Long amount)
Amount intended to be collected by this payment.void
setAmountCaptured(java.lang.Long amountCaptured)
Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made).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) requested 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
setCalculatedStatementDescriptor(java.lang.String calculatedStatementDescriptor)
The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements.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, 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
setDisputed(java.lang.Boolean disputed)
Whether the charge has been disputed.void
setDisputeObject(Dispute expandableObject)
void
setFailureCode(java.lang.String failureCode)
Error code explaining reason for charge failure if available (see the errors section 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 valuetrue
if the object exists in live mode or the valuefalse
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 id)
void
setPaymentIntentObject(PaymentIntent expandableObject)
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, usestatement_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 eithersucceeded
,pending
, orfailed
.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.-
Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
-
Methods inherited from class com.stripe.model.StripeObject
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.StripeObjectInterface
getLastResponse, setLastResponse
-
-
-
-
Method Detail
-
getApplication
public java.lang.String getApplication()
Get ID of expandableapplication
object.
-
setApplication
public void setApplication(java.lang.String id)
-
getApplicationObject
public Application getApplicationObject()
Get expandedapplication
.
-
setApplicationObject
public void setApplicationObject(Application expandableObject)
-
getApplicationFee
public java.lang.String getApplicationFee()
Get ID of expandableapplicationFee
object.
-
setApplicationFee
public void setApplicationFee(java.lang.String id)
-
getApplicationFeeObject
public ApplicationFee getApplicationFeeObject()
Get expandedapplicationFee
.
-
setApplicationFeeObject
public void setApplicationFeeObject(ApplicationFee expandableObject)
-
getBalanceTransaction
public java.lang.String getBalanceTransaction()
Get ID of expandablebalanceTransaction
object.
-
setBalanceTransaction
public void setBalanceTransaction(java.lang.String id)
-
getBalanceTransactionObject
public BalanceTransaction getBalanceTransactionObject()
Get expandedbalanceTransaction
.
-
setBalanceTransactionObject
public void setBalanceTransactionObject(BalanceTransaction expandableObject)
-
getCustomer
public java.lang.String getCustomer()
Get ID of expandablecustomer
object.
-
setCustomer
public void setCustomer(java.lang.String id)
-
getCustomerObject
public Customer getCustomerObject()
Get expandedcustomer
.
-
setCustomerObject
public void setCustomerObject(Customer expandableObject)
-
getDestination
public java.lang.String getDestination()
Get ID of expandabledestination
object.
-
setDestination
public void setDestination(java.lang.String id)
-
getDestinationObject
public Account getDestinationObject()
Get expandeddestination
.
-
setDestinationObject
public void setDestinationObject(Account expandableObject)
-
getDispute
public java.lang.String getDispute()
Get ID of expandabledispute
object.
-
setDispute
public void setDispute(java.lang.String id)
-
getDisputeObject
public Dispute getDisputeObject()
Get expandeddispute
.
-
setDisputeObject
public void setDisputeObject(Dispute expandableObject)
-
getInvoice
public java.lang.String getInvoice()
Get ID of expandableinvoice
object.
-
setInvoice
public void setInvoice(java.lang.String id)
-
getInvoiceObject
public Invoice getInvoiceObject()
Get expandedinvoice
.
-
setInvoiceObject
public void setInvoiceObject(Invoice expandableObject)
-
getOnBehalfOf
public java.lang.String getOnBehalfOf()
Get ID of expandableonBehalfOf
object.
-
setOnBehalfOf
public void setOnBehalfOf(java.lang.String id)
-
getOnBehalfOfObject
public Account getOnBehalfOfObject()
Get expandedonBehalfOf
.
-
setOnBehalfOfObject
public void setOnBehalfOfObject(Account expandableObject)
-
getOrder
public java.lang.String getOrder()
Get ID of expandableorder
object.
-
setOrder
public void setOrder(java.lang.String id)
-
getOrderObject
public Order getOrderObject()
Get expandedorder
.
-
setOrderObject
public void setOrderObject(Order expandableObject)
-
getPaymentIntent
public java.lang.String getPaymentIntent()
Get ID of expandablepaymentIntent
object.
-
setPaymentIntent
public void setPaymentIntent(java.lang.String id)
-
getPaymentIntentObject
public PaymentIntent getPaymentIntentObject()
Get expandedpaymentIntent
.
-
setPaymentIntentObject
public void setPaymentIntentObject(PaymentIntent expandableObject)
-
getReview
public java.lang.String getReview()
Get ID of expandablereview
object.
-
setReview
public void setReview(java.lang.String id)
-
getReviewObject
public Review getReviewObject()
Get expandedreview
.
-
setReviewObject
public void setReviewObject(Review expandableObject)
-
getSourceTransfer
public java.lang.String getSourceTransfer()
Get ID of expandablesourceTransfer
object.
-
setSourceTransfer
public void setSourceTransfer(java.lang.String id)
-
getSourceTransferObject
public Transfer getSourceTransferObject()
Get expandedsourceTransfer
.
-
setSourceTransferObject
public void setSourceTransferObject(Transfer expandableObject)
-
getTransfer
public java.lang.String getTransfer()
Get ID of expandabletransfer
object.
-
setTransfer
public void setTransfer(java.lang.String id)
-
getTransferObject
public Transfer getTransferObject()
Get expandedtransfer
.
-
setTransferObject
public void setTransferObject(Transfer expandableObject)
-
list
public static ChargeCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.- Throws:
StripeException
-
list
public static ChargeCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.- Throws:
StripeException
-
list
public static ChargeCollection list(ChargeListParams params) throws StripeException
Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.- Throws:
StripeException
-
list
public static ChargeCollection list(ChargeListParams params, RequestOptions options) throws StripeException
Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.- Throws:
StripeException
-
create
public static Charge create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
To charge a credit card or other payment source, you create aCharge
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).- Throws:
StripeException
-
create
public static Charge create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
To charge a credit card or other payment source, you create aCharge
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).- Throws:
StripeException
-
create
public static Charge create(ChargeCreateParams params) throws StripeException
To charge a credit card or other payment source, you create aCharge
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).- Throws:
StripeException
-
create
public static Charge create(ChargeCreateParams params, RequestOptions options) throws StripeException
To charge a credit card or other payment source, you create aCharge
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).- Throws:
StripeException
-
retrieve
public static Charge retrieve(java.lang.String charge) throws StripeException
Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.- Throws:
StripeException
-
retrieve
public static Charge retrieve(java.lang.String charge, RequestOptions options) throws StripeException
Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.- Throws:
StripeException
-
retrieve
public static Charge retrieve(java.lang.String charge, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.- Throws:
StripeException
-
retrieve
public static Charge retrieve(java.lang.String charge, ChargeRetrieveParams params, RequestOptions options) throws StripeException
Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.- Throws:
StripeException
-
update
public Charge update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Specified by:
update
in interfaceMetadataStore<Charge>
- Throws:
StripeException
-
update
public Charge update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Specified by:
update
in interfaceMetadataStore<Charge>
- Throws:
StripeException
-
update
public Charge update(ChargeUpdateParams params) throws StripeException
Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Throws:
StripeException
-
update
public Charge update(ChargeUpdateParams params, RequestOptions options) throws StripeException
Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Throws:
StripeException
-
capture
public Charge capture() throws StripeException
Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.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.
- Throws:
StripeException
-
capture
public Charge capture(RequestOptions options) throws StripeException
Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.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.
- Throws:
StripeException
-
capture
public Charge capture(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.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.
- Throws:
StripeException
-
capture
public Charge capture(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.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.
- Throws:
StripeException
-
capture
public Charge capture(ChargeCaptureParams params) throws StripeException
Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.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.
- Throws:
StripeException
-
capture
public Charge capture(ChargeCaptureParams params, RequestOptions options) throws StripeException
Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.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.
- Throws:
StripeException
-
getAlternateStatementDescriptors
public Charge.AlternateStatementDescriptors getAlternateStatementDescriptors()
-
getAmount
public java.lang.Long getAmount()
Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
-
getAmountCaptured
public java.lang.Long getAmountCaptured()
Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made).
-
getAmountRefunded
public java.lang.Long getAmountRefunded()
Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued).
-
getApplicationFeeAmount
public java.lang.Long getApplicationFeeAmount()
The amount of the application fee (if any) requested for the charge. See the Connect documentation for details.
-
getAuthorizationCode
public java.lang.String getAuthorizationCode()
Authorization code on the charge.
-
getBillingDetails
public PaymentMethod.BillingDetails getBillingDetails()
-
getCalculatedStatementDescriptor
public java.lang.String getCalculatedStatementDescriptor()
The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined.
-
getCaptured
public java.lang.Boolean getCaptured()
If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured.
-
getCreated
public java.lang.Long getCreated()
Time at which the object was created. Measured in seconds since the Unix epoch.
-
getCurrency
public java.lang.String getCurrency()
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
getDescription
public java.lang.String getDescription()
An arbitrary string attached to the object. Often useful for displaying to users.
-
getDisputed
public java.lang.Boolean getDisputed()
Whether the charge has been disputed.
-
getFailureCode
public java.lang.String getFailureCode()
Error code explaining reason for charge failure if available (see the errors section for a list of codes).
-
getFailureMessage
public java.lang.String getFailureMessage()
Message to user further explaining reason for charge failure if available.
-
getFraudDetails
public Charge.FraudDetails getFraudDetails()
Information on fraud assessments for the charge.
-
getLevel3
public Charge.Level3 getLevel3()
-
getLivemode
public java.lang.Boolean getLivemode()
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.
-
getObject
public java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.Equal to
charge
.
-
getOutcome
public Charge.Outcome getOutcome()
Details about whether the payment was accepted, and why. See understanding declines for details.
-
getPaid
public java.lang.Boolean getPaid()
true
if the charge succeeded, or was successfully authorized for later capture.
-
getPaymentMethod
public java.lang.String getPaymentMethod()
ID of the payment method used in this charge.
-
getPaymentMethodDetails
public Charge.PaymentMethodDetails getPaymentMethodDetails()
Details about the payment method at the time of the transaction.
-
getReceiptEmail
public java.lang.String getReceiptEmail()
This is the email address that the receipt for this charge was sent to.
-
getReceiptNumber
public java.lang.String getReceiptNumber()
This is the transaction number that appears on email receipts sent for this charge. This attribute will benull
until a receipt has been sent.
-
getReceiptUrl
public java.lang.String getReceiptUrl()
This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt.
-
getRefunded
public java.lang.Boolean getRefunded()
Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.
-
getRefunds
public RefundCollection getRefunds()
A list of refunds that have been applied to the charge.
-
getShipping
public ShippingDetails getShipping()
Shipping information for the charge.
-
getSource
public PaymentSource getSource()
This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer topayment_method
orpayment_method_details
instead.
-
getStatementDescriptor
public java.lang.String getStatementDescriptor()
For card charges, usestatement_descriptor_suffix
instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.
-
getStatementDescriptorSuffix
public java.lang.String getStatementDescriptorSuffix()
Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
-
getStatus
public java.lang.String getStatus()
The status of the payment is eithersucceeded
,pending
, orfailed
.
-
getTransferData
public Charge.TransferData getTransferData()
An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details.
-
getTransferGroup
public java.lang.String getTransferGroup()
A string that identifies this transaction as part of a group. See the Connect documentation for details.
-
setAlternateStatementDescriptors
public void setAlternateStatementDescriptors(Charge.AlternateStatementDescriptors alternateStatementDescriptors)
-
setAmount
public void setAmount(java.lang.Long amount)
Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
-
setAmountCaptured
public void setAmountCaptured(java.lang.Long amountCaptured)
Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made).
-
setAmountRefunded
public 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).
-
setApplicationFeeAmount
public void setApplicationFeeAmount(java.lang.Long applicationFeeAmount)
The amount of the application fee (if any) requested for the charge. See the Connect documentation for details.
-
setAuthorizationCode
public void setAuthorizationCode(java.lang.String authorizationCode)
Authorization code on the charge.
-
setBillingDetails
public void setBillingDetails(PaymentMethod.BillingDetails billingDetails)
-
setCalculatedStatementDescriptor
public void setCalculatedStatementDescriptor(java.lang.String calculatedStatementDescriptor)
The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined.
-
setCaptured
public 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.
-
setCreated
public void setCreated(java.lang.Long created)
Time at which the object was created. Measured in seconds since the Unix epoch.
-
setCurrency
public void setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
setDescription
public void setDescription(java.lang.String description)
An arbitrary string attached to the object. Often useful for displaying to users.
-
setDisputed
public void setDisputed(java.lang.Boolean disputed)
Whether the charge has been disputed.
-
setFailureCode
public void setFailureCode(java.lang.String failureCode)
Error code explaining reason for charge failure if available (see the errors section for a list of codes).
-
setFailureMessage
public void setFailureMessage(java.lang.String failureMessage)
Message to user further explaining reason for charge failure if available.
-
setFraudDetails
public void setFraudDetails(Charge.FraudDetails fraudDetails)
Information on fraud assessments for the charge.
-
setId
public void setId(java.lang.String id)
Unique identifier for the object.
-
setLevel3
public void setLevel3(Charge.Level3 level3)
-
setLivemode
public void setLivemode(java.lang.Boolean livemode)
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.
-
setMetadata
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
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
public void setObject(java.lang.String object)
String representing the object's type. Objects of the same type share the same value.Equal to
charge
.
-
setOutcome
public void setOutcome(Charge.Outcome outcome)
Details about whether the payment was accepted, and why. See understanding declines for details.
-
setPaid
public void setPaid(java.lang.Boolean paid)
true
if the charge succeeded, or was successfully authorized for later capture.
-
setPaymentMethod
public void setPaymentMethod(java.lang.String paymentMethod)
ID of the payment method used in this charge.
-
setPaymentMethodDetails
public void setPaymentMethodDetails(Charge.PaymentMethodDetails paymentMethodDetails)
Details about the payment method at the time of the transaction.
-
setReceiptEmail
public void setReceiptEmail(java.lang.String receiptEmail)
This is the email address that the receipt for this charge was sent to.
-
setReceiptNumber
public void setReceiptNumber(java.lang.String receiptNumber)
This is the transaction number that appears on email receipts sent for this charge. This attribute will benull
until a receipt has been sent.
-
setReceiptUrl
public void setReceiptUrl(java.lang.String receiptUrl)
This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt.
-
setRefunded
public void setRefunded(java.lang.Boolean refunded)
Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.
-
setRefunds
public void setRefunds(RefundCollection refunds)
A list of refunds that have been applied to the charge.
-
setShipping
public void setShipping(ShippingDetails shipping)
Shipping information for the charge.
-
setSource
public void setSource(PaymentSource source)
This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer topayment_method
orpayment_method_details
instead.
-
setStatementDescriptor
public void setStatementDescriptor(java.lang.String statementDescriptor)
For card charges, usestatement_descriptor_suffix
instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.
-
setStatementDescriptorSuffix
public void setStatementDescriptorSuffix(java.lang.String statementDescriptorSuffix)
Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
-
setStatus
public void setStatus(java.lang.String status)
The status of the payment is eithersucceeded
,pending
, orfailed
.
-
setTransferData
public void setTransferData(Charge.TransferData transferData)
An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details.
-
setTransferGroup
public void setTransferGroup(java.lang.String transferGroup)
A string that identifies this transaction as part of a group. See the Connect documentation for details.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getId
public java.lang.String getId()
Unique identifier for the object.
-
getMetadata
public java.util.Map<java.lang.String,java.lang.String> 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<Charge>
-
-