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 classCharge.AlternateStatementDescriptorsstatic classCharge.FraudDetailsstatic classCharge.Level3static classCharge.Outcomestatic classCharge.PaymentMethodDetailsstatic classCharge.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 booleancanEqual(java.lang.Object other)Chargecapture()Capture the payment of an existing, uncaptured, charge.Chargecapture(RequestOptions options)Capture the payment of an existing, uncaptured, charge.Chargecapture(ChargeCaptureParams params)Capture the payment of an existing, uncaptured, charge.Chargecapture(ChargeCaptureParams params, RequestOptions options)Capture the payment of an existing, uncaptured, charge.Chargecapture(java.util.Map<java.lang.String,java.lang.Object> params)Capture the payment of an existing, uncaptured, charge.Chargecapture(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Capture the payment of an existing, uncaptured, charge.static Chargecreate(ChargeCreateParams params)To charge a credit card or other payment source, you create aChargeobject.static Chargecreate(ChargeCreateParams params, RequestOptions options)To charge a credit card or other payment source, you create aChargeobject.static Chargecreate(java.util.Map<java.lang.String,java.lang.Object> params)To charge a credit card or other payment source, you create aChargeobject.static Chargecreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)To charge a credit card or other payment source, you create aChargeobject.booleanequals(java.lang.Object o)Charge.AlternateStatementDescriptorsgetAlternateStatementDescriptors()java.lang.LonggetAmount()Amount intended to be collected by this payment.java.lang.LonggetAmountCaptured()Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made).java.lang.LonggetAmountRefunded()Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued).java.lang.StringgetApplication()Get ID of expandableapplicationobject.java.lang.StringgetApplicationFee()Get ID of expandableapplicationFeeobject.java.lang.LonggetApplicationFeeAmount()The amount of the application fee (if any) requested for the charge.ApplicationFeegetApplicationFeeObject()Get expandedapplicationFee.ApplicationgetApplicationObject()Get expandedapplication.java.lang.StringgetAuthorizationCode()Authorization code on the charge.java.lang.StringgetBalanceTransaction()Get ID of expandablebalanceTransactionobject.BalanceTransactiongetBalanceTransactionObject()Get expandedbalanceTransaction.PaymentMethod.BillingDetailsgetBillingDetails()java.lang.StringgetCalculatedStatementDescriptor()The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements.java.lang.BooleangetCaptured()If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured.java.lang.LonggetCreated()Time at which the object was created.java.lang.StringgetCurrency()Three-letter ISO currency code, in lowercase.java.lang.StringgetCustomer()Get ID of expandablecustomerobject.CustomergetCustomerObject()Get expandedcustomer.java.lang.StringgetDescription()An arbitrary string attached to the object.java.lang.StringgetDestination()Get ID of expandabledestinationobject.AccountgetDestinationObject()Get expandeddestination.java.lang.StringgetDispute()Get ID of expandabledisputeobject.java.lang.BooleangetDisputed()Whether the charge has been disputed.DisputegetDisputeObject()Get expandeddispute.java.lang.StringgetFailureCode()Error code explaining reason for charge failure if available (see the errors section for a list of codes).java.lang.StringgetFailureMessage()Message to user further explaining reason for charge failure if available.Charge.FraudDetailsgetFraudDetails()Information on fraud assessments for the charge.java.lang.StringgetId()Unique identifier for the object.java.lang.StringgetInvoice()Get ID of expandableinvoiceobject.InvoicegetInvoiceObject()Get expandedinvoice.Charge.Level3getLevel3()java.lang.BooleangetLivemode()Has the valuetrueif the object exists in live mode or the valuefalseif 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.StringgetObject()String representing the object's type.java.lang.StringgetOnBehalfOf()Get ID of expandableonBehalfOfobject.AccountgetOnBehalfOfObject()Get expandedonBehalfOf.java.lang.StringgetOrder()Get ID of expandableorderobject.OrdergetOrderObject()Get expandedorder.Charge.OutcomegetOutcome()Details about whether the payment was accepted, and why.java.lang.BooleangetPaid()trueif the charge succeeded, or was successfully authorized for later capture.java.lang.StringgetPaymentIntent()Get ID of expandablepaymentIntentobject.PaymentIntentgetPaymentIntentObject()Get expandedpaymentIntent.java.lang.StringgetPaymentMethod()ID of the payment method used in this charge.Charge.PaymentMethodDetailsgetPaymentMethodDetails()Details about the payment method at the time of the transaction.java.lang.StringgetReceiptEmail()This is the email address that the receipt for this charge was sent to.java.lang.StringgetReceiptNumber()This is the transaction number that appears on email receipts sent for this charge.java.lang.StringgetReceiptUrl()This is the URL to view the receipt for this charge.java.lang.BooleangetRefunded()Whether the charge has been fully refunded.RefundCollectiongetRefunds()A list of refunds that have been applied to the charge.java.lang.StringgetReview()Get ID of expandablereviewobject.ReviewgetReviewObject()Get expandedreview.ShippingDetailsgetShipping()Shipping information for the charge.PaymentSourcegetSource()This is a legacy field that will be removed in the future.java.lang.StringgetSourceTransfer()Get ID of expandablesourceTransferobject.TransfergetSourceTransferObject()Get expandedsourceTransfer.java.lang.StringgetStatementDescriptor()For card charges, usestatement_descriptor_suffixinstead.java.lang.StringgetStatementDescriptorSuffix()Provides information about the charge that customers see on their statements.java.lang.StringgetStatus()The status of the payment is eithersucceeded,pending, orfailed.java.lang.StringgetTransfer()Get ID of expandabletransferobject.Charge.TransferDatagetTransferData()An optional dictionary including the account to automatically transfer to as part of a destination charge.java.lang.StringgetTransferGroup()A string that identifies this transaction as part of a group.TransfergetTransferObject()Get expandedtransfer.inthashCode()static ChargeCollectionlist(ChargeListParams params)Returns a list of charges you’ve previously created.static ChargeCollectionlist(ChargeListParams params, RequestOptions options)Returns a list of charges you’ve previously created.static ChargeCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of charges you’ve previously created.static ChargeCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of charges you’ve previously created.static Chargeretrieve(java.lang.String charge)Retrieves the details of a charge that has previously been created.static Chargeretrieve(java.lang.String charge, RequestOptions options)Retrieves the details of a charge that has previously been created.static Chargeretrieve(java.lang.String charge, ChargeRetrieveParams params, RequestOptions options)Retrieves the details of a charge that has previously been created.static Chargeretrieve(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.voidsetAlternateStatementDescriptors(Charge.AlternateStatementDescriptors alternateStatementDescriptors)voidsetAmount(java.lang.Long amount)Amount intended to be collected by this payment.voidsetAmountCaptured(java.lang.Long amountCaptured)Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made).voidsetAmountRefunded(java.lang.Long amountRefunded)Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued).voidsetApplication(java.lang.String id)voidsetApplicationFee(java.lang.String id)voidsetApplicationFeeAmount(java.lang.Long applicationFeeAmount)The amount of the application fee (if any) requested for the charge.voidsetApplicationFeeObject(ApplicationFee expandableObject)voidsetApplicationObject(Application expandableObject)voidsetAuthorizationCode(java.lang.String authorizationCode)Authorization code on the charge.voidsetBalanceTransaction(java.lang.String id)voidsetBalanceTransactionObject(BalanceTransaction expandableObject)voidsetBillingDetails(PaymentMethod.BillingDetails billingDetails)voidsetCalculatedStatementDescriptor(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.voidsetCaptured(java.lang.Boolean captured)If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured.voidsetCreated(java.lang.Long created)Time at which the object was created.voidsetCurrency(java.lang.String currency)Three-letter ISO currency code, in lowercase.voidsetCustomer(java.lang.String id)voidsetCustomerObject(Customer expandableObject)voidsetDescription(java.lang.String description)An arbitrary string attached to the object.voidsetDestination(java.lang.String id)voidsetDestinationObject(Account expandableObject)voidsetDispute(java.lang.String id)voidsetDisputed(java.lang.Boolean disputed)Whether the charge has been disputed.voidsetDisputeObject(Dispute expandableObject)voidsetFailureCode(java.lang.String failureCode)Error code explaining reason for charge failure if available (see the errors section for a list of codes).voidsetFailureMessage(java.lang.String failureMessage)Message to user further explaining reason for charge failure if available.voidsetFraudDetails(Charge.FraudDetails fraudDetails)Information on fraud assessments for the charge.voidsetId(java.lang.String id)Unique identifier for the object.voidsetInvoice(java.lang.String id)voidsetInvoiceObject(Invoice expandableObject)voidsetLevel3(Charge.Level3 level3)voidsetLivemode(java.lang.Boolean livemode)Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetObject(java.lang.String object)String representing the object's type.voidsetOnBehalfOf(java.lang.String id)voidsetOnBehalfOfObject(Account expandableObject)voidsetOrder(java.lang.String id)voidsetOrderObject(Order expandableObject)voidsetOutcome(Charge.Outcome outcome)Details about whether the payment was accepted, and why.voidsetPaid(java.lang.Boolean paid)trueif the charge succeeded, or was successfully authorized for later capture.voidsetPaymentIntent(java.lang.String id)voidsetPaymentIntentObject(PaymentIntent expandableObject)voidsetPaymentMethod(java.lang.String paymentMethod)ID of the payment method used in this charge.voidsetPaymentMethodDetails(Charge.PaymentMethodDetails paymentMethodDetails)Details about the payment method at the time of the transaction.voidsetReceiptEmail(java.lang.String receiptEmail)This is the email address that the receipt for this charge was sent to.voidsetReceiptNumber(java.lang.String receiptNumber)This is the transaction number that appears on email receipts sent for this charge.voidsetReceiptUrl(java.lang.String receiptUrl)This is the URL to view the receipt for this charge.voidsetRefunded(java.lang.Boolean refunded)Whether the charge has been fully refunded.voidsetRefunds(RefundCollection refunds)A list of refunds that have been applied to the charge.voidsetReview(java.lang.String id)voidsetReviewObject(Review expandableObject)voidsetShipping(ShippingDetails shipping)Shipping information for the charge.voidsetSource(PaymentSource source)This is a legacy field that will be removed in the future.voidsetSourceTransfer(java.lang.String id)voidsetSourceTransferObject(Transfer expandableObject)voidsetStatementDescriptor(java.lang.String statementDescriptor)For card charges, usestatement_descriptor_suffixinstead.voidsetStatementDescriptorSuffix(java.lang.String statementDescriptorSuffix)Provides information about the charge that customers see on their statements.voidsetStatus(java.lang.String status)The status of the payment is eithersucceeded,pending, orfailed.voidsetTransfer(java.lang.String id)voidsetTransferData(Charge.TransferData transferData)An optional dictionary including the account to automatically transfer to as part of a destination charge.voidsetTransferGroup(java.lang.String transferGroup)A string that identifies this transaction as part of a group.voidsetTransferObject(Transfer expandableObject)Chargeupdate(ChargeUpdateParams params)Updates the specified charge by setting the values of the parameters passed.Chargeupdate(ChargeUpdateParams params, RequestOptions options)Updates the specified charge by setting the values of the parameters passed.Chargeupdate(java.util.Map<java.lang.String,java.lang.Object> params)Updates the specified charge by setting the values of the parameters passed.Chargeupdate(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 expandableapplicationobject.
-
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 expandableapplicationFeeobject.
-
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 expandablebalanceTransactionobject.
-
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 expandablecustomerobject.
-
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 expandabledestinationobject.
-
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 expandabledisputeobject.
-
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 expandableinvoiceobject.
-
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 expandableonBehalfOfobject.
-
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 expandableorderobject.
-
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 expandablepaymentIntentobject.
-
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 expandablereviewobject.
-
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 expandablesourceTransferobject.
-
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 expandabletransferobject.
-
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 aChargeobject. 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 aChargeobject. 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 aChargeobject. 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 aChargeobject. 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:
updatein 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:
updatein 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 valuetrueif the object exists in live mode or the valuefalseif 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()
trueif 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 benulluntil 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_methodorpayment_method_detailsinstead.
-
getStatementDescriptor
public java.lang.String getStatementDescriptor()
For card charges, usestatement_descriptor_suffixinstead. 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 valuetrueif the object exists in live mode or the valuefalseif 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)
trueif 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 benulluntil 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_methodorpayment_method_detailsinstead.
-
setStatementDescriptor
public void setStatementDescriptor(java.lang.String statementDescriptor)
For card charges, usestatement_descriptor_suffixinstead. 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:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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:
getMetadatain interfaceMetadataStore<Charge>
-
-