Class Refund
- All Implemented Interfaces:
BalanceTransactionSource
,HasId
,MetadataStore<Refund>
,StripeObjectInterface
Refund
objects allow you to 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.
Related guide: Refunds.
-
Nested Class Summary
Nested ClassesNested 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 -
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) Create a refund.static Refund
create
(RefundCreateParams params, RequestOptions options) Create a refund.static Refund
Create a refund.static Refund
create
(Map<String, Object> params, RequestOptions options) Create a refund.boolean
Amount, in %s.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
.If the refund failed, the reason for refund failure if known.getId()
Unique identifier for the object.Email to which refund instructions, if required, are sent to.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, 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’ve previously created.static RefundCollection
list
(RefundListParams params, RequestOptions options) Returns a list of all refunds you’ve previously created.static RefundCollection
Returns a list of all refunds you’ve previously created.static RefundCollection
list
(Map<String, Object> params, RequestOptions options) Returns a list of all refunds you’ve previously 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 %s.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
void
setFailureBalanceTransactionObject
(BalanceTransaction expandableObject) void
setFailureReason
(String failureReason) If the refund failed, the reason for refund failure if known.void
Unique identifier for the object.void
setInstructionsEmail
(String instructionsEmail) Email to which refund instructions, if required, are sent to.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, 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
void
setSourceTransferReversalObject
(TransferReversal expandableObject) void
Status of the refund.void
void
setTransferReversalObject
(TransferReversal expandableObject) update
(RefundUpdateParams params) Updates the specified refund by setting the values of the parameters passed.update
(RefundUpdateParams params, RequestOptions options) Updates the specified refund by setting the values of the parameters passed.Updates the specified refund by setting the values of the parameters passed.update
(Map<String, Object> params, RequestOptions options) Updates the specified refund 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, requestSearchResult, requestSearchResult, requestStream, requestStream, 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
-
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
.Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the
requires_action
state.- Throws:
StripeException
-
cancel
Cancels a refund with a status ofrequires_action
.Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the
requires_action
state.- Throws:
StripeException
-
cancel
Cancels a refund with a status ofrequires_action
.Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the
requires_action
state.- Throws:
StripeException
-
cancel
Cancels a refund with a status ofrequires_action
.Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the
requires_action
state.- Throws:
StripeException
-
cancel
Cancels a refund with a status ofrequires_action
.Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the
requires_action
state.- Throws:
StripeException
-
cancel
Cancels a refund with a status ofrequires_action
.Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the
requires_action
state.- Throws:
StripeException
-
create
Create a refund.- Throws:
StripeException
-
create
public static Refund create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreate a refund.- Throws:
StripeException
-
create
Create a refund.- Throws:
StripeException
-
create
public static Refund create(RefundCreateParams params, RequestOptions options) throws StripeException Create a refund.- Throws:
StripeException
-
list
Returns a list of all refunds you’ve previously created. The refunds are returned in sorted order, with the most recent refunds appearing first. For convenience, 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’ve previously created. The refunds are returned in sorted order, with the most recent refunds appearing first. For convenience, the 10 most recent refunds are always available by default on the charge object.- Throws:
StripeException
-
list
Returns a list of all refunds you’ve previously created. The refunds are returned in sorted order, with the most recent refunds appearing first. For convenience, 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’ve previously created. The refunds are returned in sorted order, with the most recent refunds appearing first. For convenience, 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 specified refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged.This request only accepts
metadata
as an argument.- Specified by:
update
in interfaceMetadataStore<Refund>
- Throws:
StripeException
-
update
Updates the specified refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged.This request only accepts
metadata
as an argument.- Specified by:
update
in interfaceMetadataStore<Refund>
- Throws:
StripeException
-
update
Updates the specified refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged.This request only accepts
metadata
as an argument.- Throws:
StripeException
-
update
Updates the specified refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged.This request only accepts
metadata
as an argument.- Throws:
StripeException
-
getTestHelpers
The recipient's email address. -
getAmount
Amount, in %s. -
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. Often useful for displaying to users. (Available on non-card refunds only) -
getFailureReason
If the refund failed, the reason for refund failure if known. Possible values arelost_or_stolen_card
,expired_or_canceled_card
, orunknown
. -
getInstructionsEmail
Email to which refund instructions, if required, are sent to. -
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, 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. For credit card refunds, this can bepending
,succeeded
, orfailed
. For other types of refunds, it can bepending
,requires_action
,succeeded
,failed
, orcanceled
. Refer to our refunds documentation for more details. -
setAmount
Amount, in %s. -
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. Often useful for displaying to users. (Available on non-card refunds only) -
setFailureReason
If the refund failed, the reason for refund failure if known. Possible values arelost_or_stolen_card
,expired_or_canceled_card
, orunknown
. -
setId
Unique identifier for the object. -
setInstructionsEmail
Email to which refund instructions, if required, are sent to. -
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, 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. For credit card refunds, this can bepending
,succeeded
, orfailed
. For other types of refunds, it can bepending
,requires_action
,succeeded
,failed
, orcanceled
. Refer to our refunds documentation for more details. -
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>
-