pub struct CreateRefund { /* private fields */ }
Expand description
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.
Implementations§
Source§impl CreateRefund
impl CreateRefund
pub fn amount(self, amount: impl Into<i64>) -> Self
Sourcepub fn currency(self, currency: impl Into<Currency>) -> Self
pub fn currency(self, currency: impl Into<Currency>) -> Self
Three-letter ISO currency code, in lowercase. Must be a supported currency.
Sourcepub fn customer(self, customer: impl Into<String>) -> Self
pub fn customer(self, customer: impl Into<String>) -> Self
Customer whose customer balance to refund from.
Sourcepub fn expand(self, expand: impl Into<Vec<String>>) -> Self
pub fn expand(self, expand: impl Into<Vec<String>>) -> Self
Specifies which fields in the response should be expanded.
Sourcepub fn instructions_email(self, instructions_email: impl Into<String>) -> Self
pub fn instructions_email(self, instructions_email: impl Into<String>) -> Self
For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions.
Sourcepub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self
pub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self
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.
Individual keys can be unset by posting an empty value to them.
All keys can be unset by posting an empty value to metadata
.
Sourcepub fn origin(self, origin: impl Into<CreateRefundOrigin>) -> Self
pub fn origin(self, origin: impl Into<CreateRefundOrigin>) -> Self
Origin of the refund
Sourcepub fn payment_intent(self, payment_intent: impl Into<String>) -> Self
pub fn payment_intent(self, payment_intent: impl Into<String>) -> Self
The identifier of the PaymentIntent to refund.
Sourcepub fn reason(self, reason: impl Into<CreateRefundReason>) -> Self
pub fn reason(self, reason: impl Into<CreateRefundReason>) -> Self
String indicating the reason for the refund.
If set, possible values are duplicate
, fraudulent
, and requested_by_customer
.
If you believe the charge to be fraudulent, specifying fraudulent
as the reason will add the associated card and email to your block lists, and will also help us improve our fraud detection algorithms.
Sourcepub fn refund_application_fee(
self,
refund_application_fee: impl Into<bool>,
) -> Self
pub fn refund_application_fee( self, refund_application_fee: impl Into<bool>, ) -> Self
Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge.
Sourcepub fn reverse_transfer(self, reverse_transfer: impl Into<bool>) -> Self
pub fn reverse_transfer(self, reverse_transfer: impl Into<bool>) -> Self
Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount).
A transfer can be reversed only by the application that created the charge.
Source§impl CreateRefund
impl CreateRefund
Sourcepub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
pub async fn send<C: StripeClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>
Send the request and return the deserialized response.
Sourcepub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
pub fn send_blocking<C: StripeBlockingClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>
Send the request and return the deserialized response, blocking until completion.
Trait Implementations§
Source§impl Clone for CreateRefund
impl Clone for CreateRefund
Source§fn clone(&self) -> CreateRefund
fn clone(&self) -> CreateRefund
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more