Class Refund
- All Implemented Interfaces:
BalanceTransactionSource,HasId,MetadataStore<Refund>,StripeActiveObject,StripeObjectInterface
Related guide: Refunds
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about DestinationDetails, please refer to the API Reference.static classFor more details about NextAction, please refer to the API Reference.static classFor more details about PresentmentDetails, please refer to the API Reference.static classNested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncancel()Cancels a refund with a status ofrequires_action.cancel(RequestOptions options) Cancels a refund with a status ofrequires_action.cancel(RefundCancelParams params) Cancels a refund with a status ofrequires_action.cancel(RefundCancelParams params, RequestOptions options) Cancels a refund with a status ofrequires_action.Cancels a refund with a status ofrequires_action.cancel(Map<String, Object> params, RequestOptions options) Cancels a refund with a status ofrequires_action.protected booleanstatic Refundcreate(RefundCreateParams params) When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.static Refundcreate(RefundCreateParams params, RequestOptions options) When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.static RefundWhen you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.static Refundcreate(Map<String, Object> params, RequestOptions options) When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.booleanAmount, in cents (or local equivalent).Get ID of expandablebalanceTransactionobject.Get expandedbalanceTransaction.Get ID of expandablechargeobject.Get expandedcharge.Time at which the object was created.Three-letter ISO currency code, in lowercase.An arbitrary string attached to the object.Get ID of expandablefailureBalanceTransactionobject.Get expandedfailureBalanceTransaction.Provides the reason for the refund failure.getId()Unique identifier for the object.For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions.Set of key-value pairs that you can attach to an object.String representing the object's type.Get ID of expandablepaymentIntentobject.Get expandedpaymentIntent.Provides the reason for why the refund is pending.Reason for the refund, which is either user-provided (duplicate,fraudulent, orrequested_by_customer) or generated by Stripe internally (expired_uncaptured_charge).This is the transaction number that appears on email receipts sent for this refund.Get ID of expandablesourceTransferReversalobject.Get expandedsourceTransferReversal.Status of the refund.Get ID of expandabletransferReversalobject.Get expandedtransferReversal.inthashCode()static RefundCollectionlist(RefundListParams params) Returns a list of all refunds you created.static RefundCollectionlist(RefundListParams params, RequestOptions options) Returns a list of all refunds you created.static RefundCollectionReturns a list of all refunds you created.static RefundCollectionlist(Map<String, Object> params, RequestOptions options) Returns a list of all refunds you created.static RefundRetrieves the details of an existing refund.static Refundretrieve(String refund, RequestOptions options) Retrieves the details of an existing refund.static Refundretrieve(String refund, RefundRetrieveParams params, RequestOptions options) Retrieves the details of an existing refund.static RefundRetrieves the details of an existing refund.voidAmount, in cents (or local equivalent).voidvoidsetBalanceTransactionObject(BalanceTransaction expandableObject) voidvoidsetChargeObject(Charge expandableObject) voidsetCreated(Long created) Time at which the object was created.voidsetCurrency(String currency) Three-letter ISO currency code, in lowercase.voidsetDescription(String description) An arbitrary string attached to the object.voidsetDestinationDetails(Refund.DestinationDetails destinationDetails) voidvoidsetFailureBalanceTransactionObject(BalanceTransaction expandableObject) voidsetFailureReason(String failureReason) Provides the reason for the refund failure.voidUnique identifier for the object.voidsetInstructionsEmail(String instructionsEmail) For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions.voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidsetNextAction(Refund.NextAction nextAction) voidString representing the object's type.voidvoidsetPaymentIntentObject(PaymentIntent expandableObject) voidsetPendingReason(String pendingReason) Provides the reason for why the refund is pending.voidsetPresentmentDetails(Refund.PresentmentDetails presentmentDetails) voidReason for the refund, which is either user-provided (duplicate,fraudulent, orrequested_by_customer) or generated by Stripe internally (expired_uncaptured_charge).voidsetReceiptNumber(String receiptNumber) This is the transaction number that appears on email receipts sent for this refund.voidsetResponseGetter(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.voidvoidsetSourceTransferReversalObject(TransferReversal expandableObject) voidStatus of the refund.voidvoidsetTransferReversalObject(TransferReversal expandableObject) update(RefundUpdateParams params) Updates the refund that you specify by setting the values of the passed parameters.update(RefundUpdateParams params, RequestOptions options) Updates the refund that you specify by setting the values of the passed parameters.Updates the refund that you specify by setting the values of the passed parameters.update(Map<String, Object> params, RequestOptions options) Updates the refund that you specify by setting the values of the passed parameters.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetterMethods inherited from interface com.stripe.model.StripeObjectInterface
getLastResponse, setLastResponse
-
Constructor Details
-
Refund
public Refund()
-
-
Method Details
-
getBalanceTransaction
Get ID of expandablebalanceTransactionobject. -
setBalanceTransaction
-
getBalanceTransactionObject
Get expandedbalanceTransaction. -
setBalanceTransactionObject
-
getCharge
Get ID of expandablechargeobject. -
setCharge
-
getChargeObject
Get expandedcharge. -
setChargeObject
-
getFailureBalanceTransaction
Get ID of expandablefailureBalanceTransactionobject. -
setFailureBalanceTransaction
-
getFailureBalanceTransactionObject
Get expandedfailureBalanceTransaction. -
setFailureBalanceTransactionObject
-
getPaymentIntent
Get ID of expandablepaymentIntentobject. -
setPaymentIntent
-
getPaymentIntentObject
Get expandedpaymentIntent. -
setPaymentIntentObject
-
getSourceTransferReversal
Get ID of expandablesourceTransferReversalobject. -
setSourceTransferReversal
-
getSourceTransferReversalObject
Get expandedsourceTransferReversal. -
setSourceTransferReversalObject
-
getTransferReversal
Get ID of expandabletransferReversalobject. -
setTransferReversal
-
getTransferReversalObject
Get expandedtransferReversal. -
setTransferReversalObject
-
cancel
Cancels a refund with a status ofrequires_action.You can’t cancel refunds in other states. Only refunds for payment methods that require customer action can enter the
requires_actionstate.- Throws:
StripeException
-
cancel
Cancels a refund with a status ofrequires_action.You can’t cancel refunds in other states. Only refunds for payment methods that require customer action can enter the
requires_actionstate.- Throws:
StripeException
-
cancel
Cancels a refund with a status ofrequires_action.You can’t cancel refunds in other states. Only refunds for payment methods that require customer action can enter the
requires_actionstate.- Throws:
StripeException
-
cancel
Cancels a refund with a status ofrequires_action.You can’t cancel refunds in other states. Only refunds for payment methods that require customer action can enter the
requires_actionstate.- Throws:
StripeException
-
cancel
Cancels a refund with a status ofrequires_action.You can’t cancel refunds in other states. Only refunds for payment methods that require customer action can enter the
requires_actionstate.- Throws:
StripeException
-
cancel
Cancels a refund with a status ofrequires_action.You can’t cancel refunds in other states. Only refunds for payment methods that require customer action can enter the
requires_actionstate.- Throws:
StripeException
-
create
When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.Creating a new refund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged.
You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded.
Once entirely refunded, a charge can’t be refunded again. This method will raise an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge.
- Throws:
StripeException
-
create
public static Refund create(Map<String, Object> params, RequestOptions options) throws StripeExceptionWhen you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.Creating a new refund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged.
You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded.
Once entirely refunded, a charge can’t be refunded again. This method will raise an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge.
- Throws:
StripeException
-
create
When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.Creating a new refund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged.
You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded.
Once entirely refunded, a charge can’t be refunded again. This method will raise an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge.
- Throws:
StripeException
-
create
public static Refund create(RefundCreateParams params, RequestOptions options) throws StripeException When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.Creating a new refund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged.
You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded.
Once entirely refunded, a charge can’t be refunded again. This method will raise an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge.
- Throws:
StripeException
-
list
Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object.- Throws:
StripeException
-
list
public static RefundCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object.- Throws:
StripeException
-
list
Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object.- Throws:
StripeException
-
list
public static RefundCollection list(RefundListParams params, RequestOptions options) throws StripeException Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object.- Throws:
StripeException
-
retrieve
Retrieves the details of an existing refund.- Throws:
StripeException
-
retrieve
Retrieves the details of an existing refund.- Throws:
StripeException
-
retrieve
public static Refund retrieve(String refund, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the details of an existing refund.- Throws:
StripeException
-
retrieve
public static Refund retrieve(String refund, RefundRetrieveParams params, RequestOptions options) throws StripeException Retrieves the details of an existing refund.- Throws:
StripeException
-
update
Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don’t provide remain unchanged.This request only accepts
metadataas an argument.- Specified by:
updatein interfaceMetadataStore<Refund>- Throws:
StripeException
-
update
Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don’t provide remain unchanged.This request only accepts
metadataas an argument.- Specified by:
updatein interfaceMetadataStore<Refund>- Throws:
StripeException
-
update
Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don’t provide remain unchanged.This request only accepts
metadataas an argument.- Throws:
StripeException
-
update
Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don’t provide remain unchanged.This request only accepts
metadataas an argument.- Throws:
StripeException
-
getTestHelpers
-
setResponseGetter
Description copied from interface:StripeActiveObjectMethod is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getAmount
Amount, in cents (or local equivalent). -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getDescription
An arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only). -
getDestinationDetails
-
getFailureReason
Provides the reason for the refund failure. Possible values are:lost_or_stolen_card,expired_or_canceled_card,charge_for_pending_refund_disputed,insufficient_funds,declined,merchant_request, orunknown. -
getInstructionsEmail
For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions. -
getNextAction
-
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
refund. -
getPendingReason
Provides the reason for why the refund is pending. Possible values are:processing,insufficient_funds, orcharge_pending.One of
charge_pending,insufficient_funds, orprocessing. -
getPresentmentDetails
-
getReason
Reason for the refund, which is either user-provided (duplicate,fraudulent, orrequested_by_customer) or generated by Stripe internally (expired_uncaptured_charge).One of
duplicate,expired_uncaptured_charge,fraudulent, orrequested_by_customer. -
getReceiptNumber
This is the transaction number that appears on email receipts sent for this refund. -
getStatus
Status of the refund. This can bepending,requires_action,succeeded,failed, orcanceled. Learn more about failed refunds. -
setAmount
Amount, in cents (or local equivalent). -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setDescription
An arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only). -
setDestinationDetails
-
setFailureReason
Provides the reason for the refund failure. Possible values are:lost_or_stolen_card,expired_or_canceled_card,charge_for_pending_refund_disputed,insufficient_funds,declined,merchant_request, orunknown. -
setId
Unique identifier for the object. -
setInstructionsEmail
For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions. -
setMetadata
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. -
setNextAction
-
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
refund. -
setPendingReason
Provides the reason for why the refund is pending. Possible values are:processing,insufficient_funds, orcharge_pending.One of
charge_pending,insufficient_funds, orprocessing. -
setPresentmentDetails
-
setReason
Reason for the refund, which is either user-provided (duplicate,fraudulent, orrequested_by_customer) or generated by Stripe internally (expired_uncaptured_charge).One of
duplicate,expired_uncaptured_charge,fraudulent, orrequested_by_customer. -
setReceiptNumber
This is the transaction number that appears on email receipts sent for this refund. -
setStatus
Status of the refund. This can bepending,requires_action,succeeded,failed, orcanceled. Learn more about failed refunds. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object. -
getMetadata
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.- Specified by:
getMetadatain interfaceMetadataStore<Refund>
-