Class Refund
- All Implemented Interfaces:
BalanceTransactionSource
,HasId
,MetadataStore<Refund>
,StripeActiveObject
,StripeObjectInterface
Related guide: Refunds
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSON
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
-
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 boolean
static Refund
create
(RefundCreateParams params) When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.static Refund
create
(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 Refund
When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.static Refund
create
(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.boolean
Amount, in cents (or local equivalent).Get ID of expandablebalanceTransaction
object.Get expandedbalanceTransaction
.Get ID of expandablecharge
object.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 expandablefailureBalanceTransaction
object.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 expandablepaymentIntent
object.Get expandedpaymentIntent
.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 expandablesourceTransferReversal
object.Get expandedsourceTransferReversal
.Status of the refund.The recipient's email address.Get ID of expandabletransferReversal
object.Get expandedtransferReversal
.int
hashCode()
static RefundCollection
list
(RefundListParams params) Returns a list of all refunds you created.static RefundCollection
list
(RefundListParams params, RequestOptions options) Returns a list of all refunds you created.static RefundCollection
Returns a list of all refunds you created.static RefundCollection
list
(Map<String, Object> params, RequestOptions options) Returns a list of all refunds you created.static Refund
Retrieves the details of an existing refund.static Refund
retrieve
(String refund, RequestOptions options) Retrieves the details of an existing refund.static Refund
retrieve
(String refund, RefundRetrieveParams params, RequestOptions options) Retrieves the details of an existing refund.static Refund
Retrieves the details of an existing refund.void
Amount, in cents (or local equivalent).void
void
setBalanceTransactionObject
(BalanceTransaction expandableObject) void
void
setChargeObject
(Charge expandableObject) void
setCreated
(Long created) Time at which the object was created.void
setCurrency
(String currency) Three-letter ISO currency code, in lowercase.void
setDescription
(String description) An arbitrary string attached to the object.void
setDestinationDetails
(Refund.DestinationDetails destinationDetails) void
void
setFailureBalanceTransactionObject
(BalanceTransaction expandableObject) void
setFailureReason
(String failureReason) Provides the reason for the refund failure.void
Unique identifier for the object.void
setInstructionsEmail
(String instructionsEmail) For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions.void
setMetadata
(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.void
setNextAction
(Refund.NextAction nextAction) void
String representing the object's type.void
void
setPaymentIntentObject
(PaymentIntent expandableObject) void
Reason for the refund, which is either user-provided (duplicate
,fraudulent
, orrequested_by_customer
) or generated by Stripe internally (expired_uncaptured_charge
).void
setReceiptNumber
(String receiptNumber) This is the transaction number that appears on email receipts sent for this refund.void
setResponseGetter
(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetter
implementations to set theStripeResponseGetter
instance used to make further requests.void
void
setSourceTransferReversalObject
(TransferReversal expandableObject) void
Status of the refund.void
void
setTransferReversalObject
(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, setStripeResponseGetter, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, 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.StripeActiveObject
trySetResponseGetter
Methods inherited from interface com.stripe.model.StripeObjectInterface
getLastResponse, setLastResponse
-
Constructor Details
-
Refund
public Refund()
-
-
Method Details
-
getBalanceTransaction
Get ID of expandablebalanceTransaction
object. -
setBalanceTransaction
-
getBalanceTransactionObject
Get expandedbalanceTransaction
. -
setBalanceTransactionObject
-
getCharge
Get ID of expandablecharge
object. -
setCharge
-
getChargeObject
Get expandedcharge
. -
setChargeObject
-
getFailureBalanceTransaction
Get ID of expandablefailureBalanceTransaction
object. -
setFailureBalanceTransaction
-
getFailureBalanceTransactionObject
Get expandedfailureBalanceTransaction
. -
setFailureBalanceTransactionObject
-
getPaymentIntent
Get ID of expandablepaymentIntent
object. -
setPaymentIntent
-
getPaymentIntentObject
Get expandedpaymentIntent
. -
setPaymentIntentObject
-
getSourceTransferReversal
Get ID of expandablesourceTransferReversal
object. -
setSourceTransferReversal
-
getSourceTransferReversalObject
Get expandedsourceTransferReversal
. -
setSourceTransferReversalObject
-
getTransferReversal
Get ID of expandabletransferReversal
object. -
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_action
state.- 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_action
state.- 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_action
state.- 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_action
state.- 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_action
state.- 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_action
state.- 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
metadata
as an argument.- Specified by:
update
in 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
metadata
as an argument.- Specified by:
update
in 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
metadata
as 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
metadata
as an argument.- Throws:
StripeException
-
getTestHelpers
The recipient's email address. -
setResponseGetter
Description copied from interface:StripeActiveObject
Method is used by the containing object orStripeResponseGetter
implementations to set theStripeResponseGetter
instance used to make further requests.- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance 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
. -
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
. -
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:
getMetadata
in interfaceMetadataStore<Refund>
-