stripe_core/refund/
requests.rs

1use stripe_client_core::{
2    RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone, Debug, serde::Serialize)]
6struct ListRefundBuilder {
7    #[serde(skip_serializing_if = "Option::is_none")]
8    charge: Option<String>,
9    #[serde(skip_serializing_if = "Option::is_none")]
10    created: Option<stripe_types::RangeQueryTs>,
11    #[serde(skip_serializing_if = "Option::is_none")]
12    ending_before: Option<String>,
13    #[serde(skip_serializing_if = "Option::is_none")]
14    expand: Option<Vec<String>>,
15    #[serde(skip_serializing_if = "Option::is_none")]
16    limit: Option<i64>,
17    #[serde(skip_serializing_if = "Option::is_none")]
18    payment_intent: Option<String>,
19    #[serde(skip_serializing_if = "Option::is_none")]
20    starting_after: Option<String>,
21}
22impl ListRefundBuilder {
23    fn new() -> Self {
24        Self {
25            charge: None,
26            created: None,
27            ending_before: None,
28            expand: None,
29            limit: None,
30            payment_intent: None,
31            starting_after: None,
32        }
33    }
34}
35/// Returns a list of all refunds you created.
36/// We return the refunds in sorted order, with the most recent refunds appearing first.
37/// The 10 most recent refunds are always available by default on the Charge object.
38#[derive(Clone, Debug, serde::Serialize)]
39pub struct ListRefund {
40    inner: ListRefundBuilder,
41}
42impl ListRefund {
43    /// Construct a new `ListRefund`.
44    pub fn new() -> Self {
45        Self { inner: ListRefundBuilder::new() }
46    }
47    /// Only return refunds for the charge specified by this charge ID.
48    pub fn charge(mut self, charge: impl Into<String>) -> Self {
49        self.inner.charge = Some(charge.into());
50        self
51    }
52    /// Only return refunds that were created during the given date interval.
53    pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
54        self.inner.created = Some(created.into());
55        self
56    }
57    /// A cursor for use in pagination.
58    /// `ending_before` is an object ID that defines your place in the list.
59    /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
60    pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
61        self.inner.ending_before = Some(ending_before.into());
62        self
63    }
64    /// Specifies which fields in the response should be expanded.
65    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
66        self.inner.expand = Some(expand.into());
67        self
68    }
69    /// A limit on the number of objects to be returned.
70    /// Limit can range between 1 and 100, and the default is 10.
71    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
72        self.inner.limit = Some(limit.into());
73        self
74    }
75    /// Only return refunds for the PaymentIntent specified by this ID.
76    pub fn payment_intent(mut self, payment_intent: impl Into<String>) -> Self {
77        self.inner.payment_intent = Some(payment_intent.into());
78        self
79    }
80    /// A cursor for use in pagination.
81    /// `starting_after` is an object ID that defines your place in the list.
82    /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
83    pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
84        self.inner.starting_after = Some(starting_after.into());
85        self
86    }
87}
88impl Default for ListRefund {
89    fn default() -> Self {
90        Self::new()
91    }
92}
93impl ListRefund {
94    /// Send the request and return the deserialized response.
95    pub async fn send<C: StripeClient>(
96        &self,
97        client: &C,
98    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
99        self.customize().send(client).await
100    }
101
102    /// Send the request and return the deserialized response, blocking until completion.
103    pub fn send_blocking<C: StripeBlockingClient>(
104        &self,
105        client: &C,
106    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
107        self.customize().send_blocking(client)
108    }
109
110    pub fn paginate(
111        &self,
112    ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::Refund>> {
113        stripe_client_core::ListPaginator::new_list("/refunds", &self.inner)
114    }
115}
116
117impl StripeRequest for ListRefund {
118    type Output = stripe_types::List<stripe_shared::Refund>;
119
120    fn build(&self) -> RequestBuilder {
121        RequestBuilder::new(StripeMethod::Get, "/refunds").query(&self.inner)
122    }
123}
124#[derive(Clone, Debug, serde::Serialize)]
125struct RetrieveRefundBuilder {
126    #[serde(skip_serializing_if = "Option::is_none")]
127    expand: Option<Vec<String>>,
128}
129impl RetrieveRefundBuilder {
130    fn new() -> Self {
131        Self { expand: None }
132    }
133}
134/// Retrieves the details of an existing refund.
135#[derive(Clone, Debug, serde::Serialize)]
136pub struct RetrieveRefund {
137    inner: RetrieveRefundBuilder,
138    refund: stripe_shared::RefundId,
139}
140impl RetrieveRefund {
141    /// Construct a new `RetrieveRefund`.
142    pub fn new(refund: impl Into<stripe_shared::RefundId>) -> Self {
143        Self { refund: refund.into(), inner: RetrieveRefundBuilder::new() }
144    }
145    /// Specifies which fields in the response should be expanded.
146    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
147        self.inner.expand = Some(expand.into());
148        self
149    }
150}
151impl RetrieveRefund {
152    /// Send the request and return the deserialized response.
153    pub async fn send<C: StripeClient>(
154        &self,
155        client: &C,
156    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
157        self.customize().send(client).await
158    }
159
160    /// Send the request and return the deserialized response, blocking until completion.
161    pub fn send_blocking<C: StripeBlockingClient>(
162        &self,
163        client: &C,
164    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
165        self.customize().send_blocking(client)
166    }
167}
168
169impl StripeRequest for RetrieveRefund {
170    type Output = stripe_shared::Refund;
171
172    fn build(&self) -> RequestBuilder {
173        let refund = &self.refund;
174        RequestBuilder::new(StripeMethod::Get, format!("/refunds/{refund}")).query(&self.inner)
175    }
176}
177#[derive(Clone, Debug, serde::Serialize)]
178struct CreateRefundBuilder {
179    #[serde(skip_serializing_if = "Option::is_none")]
180    amount: Option<i64>,
181    #[serde(skip_serializing_if = "Option::is_none")]
182    charge: Option<String>,
183    #[serde(skip_serializing_if = "Option::is_none")]
184    currency: Option<stripe_types::Currency>,
185    #[serde(skip_serializing_if = "Option::is_none")]
186    customer: Option<String>,
187    #[serde(skip_serializing_if = "Option::is_none")]
188    expand: Option<Vec<String>>,
189    #[serde(skip_serializing_if = "Option::is_none")]
190    instructions_email: Option<String>,
191    #[serde(skip_serializing_if = "Option::is_none")]
192    metadata: Option<std::collections::HashMap<String, String>>,
193    #[serde(skip_serializing_if = "Option::is_none")]
194    origin: Option<CreateRefundOrigin>,
195    #[serde(skip_serializing_if = "Option::is_none")]
196    payment_intent: Option<String>,
197    #[serde(skip_serializing_if = "Option::is_none")]
198    reason: Option<CreateRefundReason>,
199    #[serde(skip_serializing_if = "Option::is_none")]
200    refund_application_fee: Option<bool>,
201    #[serde(skip_serializing_if = "Option::is_none")]
202    reverse_transfer: Option<bool>,
203}
204impl CreateRefundBuilder {
205    fn new() -> Self {
206        Self {
207            amount: None,
208            charge: None,
209            currency: None,
210            customer: None,
211            expand: None,
212            instructions_email: None,
213            metadata: None,
214            origin: None,
215            payment_intent: None,
216            reason: None,
217            refund_application_fee: None,
218            reverse_transfer: None,
219        }
220    }
221}
222/// Origin of the refund
223#[derive(Clone, Eq, PartialEq)]
224#[non_exhaustive]
225pub enum CreateRefundOrigin {
226    CustomerBalance,
227    /// An unrecognized value from Stripe. Should not be used as a request parameter.
228    Unknown(String),
229}
230impl CreateRefundOrigin {
231    pub fn as_str(&self) -> &str {
232        use CreateRefundOrigin::*;
233        match self {
234            CustomerBalance => "customer_balance",
235            Unknown(v) => v,
236        }
237    }
238}
239
240impl std::str::FromStr for CreateRefundOrigin {
241    type Err = std::convert::Infallible;
242    fn from_str(s: &str) -> Result<Self, Self::Err> {
243        use CreateRefundOrigin::*;
244        match s {
245            "customer_balance" => Ok(CustomerBalance),
246            v => {
247                tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreateRefundOrigin");
248                Ok(Unknown(v.to_owned()))
249            }
250        }
251    }
252}
253impl std::fmt::Display for CreateRefundOrigin {
254    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
255        f.write_str(self.as_str())
256    }
257}
258
259impl std::fmt::Debug for CreateRefundOrigin {
260    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
261        f.write_str(self.as_str())
262    }
263}
264impl serde::Serialize for CreateRefundOrigin {
265    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
266    where
267        S: serde::Serializer,
268    {
269        serializer.serialize_str(self.as_str())
270    }
271}
272#[cfg(feature = "deserialize")]
273impl<'de> serde::Deserialize<'de> for CreateRefundOrigin {
274    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
275        use std::str::FromStr;
276        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
277        Ok(Self::from_str(&s).expect("infallible"))
278    }
279}
280/// String indicating the reason for the refund.
281/// If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`.
282/// If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms.
283#[derive(Clone, Eq, PartialEq)]
284#[non_exhaustive]
285pub enum CreateRefundReason {
286    Duplicate,
287    Fraudulent,
288    RequestedByCustomer,
289    /// An unrecognized value from Stripe. Should not be used as a request parameter.
290    Unknown(String),
291}
292impl CreateRefundReason {
293    pub fn as_str(&self) -> &str {
294        use CreateRefundReason::*;
295        match self {
296            Duplicate => "duplicate",
297            Fraudulent => "fraudulent",
298            RequestedByCustomer => "requested_by_customer",
299            Unknown(v) => v,
300        }
301    }
302}
303
304impl std::str::FromStr for CreateRefundReason {
305    type Err = std::convert::Infallible;
306    fn from_str(s: &str) -> Result<Self, Self::Err> {
307        use CreateRefundReason::*;
308        match s {
309            "duplicate" => Ok(Duplicate),
310            "fraudulent" => Ok(Fraudulent),
311            "requested_by_customer" => Ok(RequestedByCustomer),
312            v => {
313                tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreateRefundReason");
314                Ok(Unknown(v.to_owned()))
315            }
316        }
317    }
318}
319impl std::fmt::Display for CreateRefundReason {
320    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
321        f.write_str(self.as_str())
322    }
323}
324
325impl std::fmt::Debug for CreateRefundReason {
326    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
327        f.write_str(self.as_str())
328    }
329}
330impl serde::Serialize for CreateRefundReason {
331    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
332    where
333        S: serde::Serializer,
334    {
335        serializer.serialize_str(self.as_str())
336    }
337}
338#[cfg(feature = "deserialize")]
339impl<'de> serde::Deserialize<'de> for CreateRefundReason {
340    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
341        use std::str::FromStr;
342        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
343        Ok(Self::from_str(&s).expect("infallible"))
344    }
345}
346/// When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.
347///
348/// Creating a new refund will refund a charge that has previously been created but not yet refunded.
349/// Funds will be refunded to the credit or debit card that was originally charged.
350///
351/// You can optionally refund only part of a charge.
352/// You can do so multiple times, until the entire charge has been refunded.
353///
354/// Once entirely refunded, a charge can’t be refunded again.
355/// This method will raise an error when called on an already-refunded charge,
356/// or when trying to refund more money than is left on a charge.
357#[derive(Clone, Debug, serde::Serialize)]
358pub struct CreateRefund {
359    inner: CreateRefundBuilder,
360}
361impl CreateRefund {
362    /// Construct a new `CreateRefund`.
363    pub fn new() -> Self {
364        Self { inner: CreateRefundBuilder::new() }
365    }
366    pub fn amount(mut self, amount: impl Into<i64>) -> Self {
367        self.inner.amount = Some(amount.into());
368        self
369    }
370    /// The identifier of the charge to refund.
371    pub fn charge(mut self, charge: impl Into<String>) -> Self {
372        self.inner.charge = Some(charge.into());
373        self
374    }
375    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
376    /// Must be a [supported currency](https://stripe.com/docs/currencies).
377    pub fn currency(mut self, currency: impl Into<stripe_types::Currency>) -> Self {
378        self.inner.currency = Some(currency.into());
379        self
380    }
381    /// Customer whose customer balance to refund from.
382    pub fn customer(mut self, customer: impl Into<String>) -> Self {
383        self.inner.customer = Some(customer.into());
384        self
385    }
386    /// Specifies which fields in the response should be expanded.
387    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
388        self.inner.expand = Some(expand.into());
389        self
390    }
391    /// For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions.
392    pub fn instructions_email(mut self, instructions_email: impl Into<String>) -> Self {
393        self.inner.instructions_email = Some(instructions_email.into());
394        self
395    }
396    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
397    /// This can be useful for storing additional information about the object in a structured format.
398    /// Individual keys can be unset by posting an empty value to them.
399    /// All keys can be unset by posting an empty value to `metadata`.
400    pub fn metadata(
401        mut self,
402        metadata: impl Into<std::collections::HashMap<String, String>>,
403    ) -> Self {
404        self.inner.metadata = Some(metadata.into());
405        self
406    }
407    /// Origin of the refund
408    pub fn origin(mut self, origin: impl Into<CreateRefundOrigin>) -> Self {
409        self.inner.origin = Some(origin.into());
410        self
411    }
412    /// The identifier of the PaymentIntent to refund.
413    pub fn payment_intent(mut self, payment_intent: impl Into<String>) -> Self {
414        self.inner.payment_intent = Some(payment_intent.into());
415        self
416    }
417    /// String indicating the reason for the refund.
418    /// If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`.
419    /// If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms.
420    pub fn reason(mut self, reason: impl Into<CreateRefundReason>) -> Self {
421        self.inner.reason = Some(reason.into());
422        self
423    }
424    /// Boolean indicating whether the application fee should be refunded when refunding this charge.
425    /// If a full charge refund is given, the full application fee will be refunded.
426    /// Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded.
427    /// An application fee can be refunded only by the application that created the charge.
428    pub fn refund_application_fee(mut self, refund_application_fee: impl Into<bool>) -> Self {
429        self.inner.refund_application_fee = Some(refund_application_fee.into());
430        self
431    }
432    /// Boolean indicating whether the transfer should be reversed when refunding this charge.
433    /// The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount).
434    ///
435    /// A transfer can be reversed only by the application that created the charge.
436    pub fn reverse_transfer(mut self, reverse_transfer: impl Into<bool>) -> Self {
437        self.inner.reverse_transfer = Some(reverse_transfer.into());
438        self
439    }
440}
441impl Default for CreateRefund {
442    fn default() -> Self {
443        Self::new()
444    }
445}
446impl CreateRefund {
447    /// Send the request and return the deserialized response.
448    pub async fn send<C: StripeClient>(
449        &self,
450        client: &C,
451    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
452        self.customize().send(client).await
453    }
454
455    /// Send the request and return the deserialized response, blocking until completion.
456    pub fn send_blocking<C: StripeBlockingClient>(
457        &self,
458        client: &C,
459    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
460        self.customize().send_blocking(client)
461    }
462}
463
464impl StripeRequest for CreateRefund {
465    type Output = stripe_shared::Refund;
466
467    fn build(&self) -> RequestBuilder {
468        RequestBuilder::new(StripeMethod::Post, "/refunds").form(&self.inner)
469    }
470}
471#[derive(Clone, Debug, serde::Serialize)]
472struct UpdateRefundBuilder {
473    #[serde(skip_serializing_if = "Option::is_none")]
474    expand: Option<Vec<String>>,
475    #[serde(skip_serializing_if = "Option::is_none")]
476    metadata: Option<std::collections::HashMap<String, String>>,
477}
478impl UpdateRefundBuilder {
479    fn new() -> Self {
480        Self { expand: None, metadata: None }
481    }
482}
483/// Updates the refund that you specify by setting the values of the passed parameters.
484/// Any parameters that you don’t provide remain unchanged.
485///
486/// This request only accepts `metadata` as an argument.
487#[derive(Clone, Debug, serde::Serialize)]
488pub struct UpdateRefund {
489    inner: UpdateRefundBuilder,
490    refund: stripe_shared::RefundId,
491}
492impl UpdateRefund {
493    /// Construct a new `UpdateRefund`.
494    pub fn new(refund: impl Into<stripe_shared::RefundId>) -> Self {
495        Self { refund: refund.into(), inner: UpdateRefundBuilder::new() }
496    }
497    /// Specifies which fields in the response should be expanded.
498    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
499        self.inner.expand = Some(expand.into());
500        self
501    }
502    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
503    /// This can be useful for storing additional information about the object in a structured format.
504    /// Individual keys can be unset by posting an empty value to them.
505    /// All keys can be unset by posting an empty value to `metadata`.
506    pub fn metadata(
507        mut self,
508        metadata: impl Into<std::collections::HashMap<String, String>>,
509    ) -> Self {
510        self.inner.metadata = Some(metadata.into());
511        self
512    }
513}
514impl UpdateRefund {
515    /// Send the request and return the deserialized response.
516    pub async fn send<C: StripeClient>(
517        &self,
518        client: &C,
519    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
520        self.customize().send(client).await
521    }
522
523    /// Send the request and return the deserialized response, blocking until completion.
524    pub fn send_blocking<C: StripeBlockingClient>(
525        &self,
526        client: &C,
527    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
528        self.customize().send_blocking(client)
529    }
530}
531
532impl StripeRequest for UpdateRefund {
533    type Output = stripe_shared::Refund;
534
535    fn build(&self) -> RequestBuilder {
536        let refund = &self.refund;
537        RequestBuilder::new(StripeMethod::Post, format!("/refunds/{refund}")).form(&self.inner)
538    }
539}
540#[derive(Clone, Debug, serde::Serialize)]
541struct CancelRefundBuilder {
542    #[serde(skip_serializing_if = "Option::is_none")]
543    expand: Option<Vec<String>>,
544}
545impl CancelRefundBuilder {
546    fn new() -> Self {
547        Self { expand: None }
548    }
549}
550/// Cancels a refund with a status of `requires_action`.
551///
552/// You can’t cancel refunds in other states.
553/// Only refunds for payment methods that require customer action can enter the `requires_action` state.
554#[derive(Clone, Debug, serde::Serialize)]
555pub struct CancelRefund {
556    inner: CancelRefundBuilder,
557    refund: stripe_shared::RefundId,
558}
559impl CancelRefund {
560    /// Construct a new `CancelRefund`.
561    pub fn new(refund: impl Into<stripe_shared::RefundId>) -> Self {
562        Self { refund: refund.into(), inner: CancelRefundBuilder::new() }
563    }
564    /// Specifies which fields in the response should be expanded.
565    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
566        self.inner.expand = Some(expand.into());
567        self
568    }
569}
570impl CancelRefund {
571    /// Send the request and return the deserialized response.
572    pub async fn send<C: StripeClient>(
573        &self,
574        client: &C,
575    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
576        self.customize().send(client).await
577    }
578
579    /// Send the request and return the deserialized response, blocking until completion.
580    pub fn send_blocking<C: StripeBlockingClient>(
581        &self,
582        client: &C,
583    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
584        self.customize().send_blocking(client)
585    }
586}
587
588impl StripeRequest for CancelRefund {
589    type Output = stripe_shared::Refund;
590
591    fn build(&self) -> RequestBuilder {
592        let refund = &self.refund;
593        RequestBuilder::new(StripeMethod::Post, format!("/refunds/{refund}/cancel"))
594            .form(&self.inner)
595    }
596}
597#[derive(Clone, Debug, serde::Serialize)]
598struct ExpireRefundBuilder {
599    #[serde(skip_serializing_if = "Option::is_none")]
600    expand: Option<Vec<String>>,
601}
602impl ExpireRefundBuilder {
603    fn new() -> Self {
604        Self { expand: None }
605    }
606}
607/// Expire a refund with a status of `requires_action`.
608#[derive(Clone, Debug, serde::Serialize)]
609pub struct ExpireRefund {
610    inner: ExpireRefundBuilder,
611    refund: String,
612}
613impl ExpireRefund {
614    /// Construct a new `ExpireRefund`.
615    pub fn new(refund: impl Into<String>) -> Self {
616        Self { refund: refund.into(), inner: ExpireRefundBuilder::new() }
617    }
618    /// Specifies which fields in the response should be expanded.
619    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
620        self.inner.expand = Some(expand.into());
621        self
622    }
623}
624impl ExpireRefund {
625    /// Send the request and return the deserialized response.
626    pub async fn send<C: StripeClient>(
627        &self,
628        client: &C,
629    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
630        self.customize().send(client).await
631    }
632
633    /// Send the request and return the deserialized response, blocking until completion.
634    pub fn send_blocking<C: StripeBlockingClient>(
635        &self,
636        client: &C,
637    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
638        self.customize().send_blocking(client)
639    }
640}
641
642impl StripeRequest for ExpireRefund {
643    type Output = stripe_shared::Refund;
644
645    fn build(&self) -> RequestBuilder {
646        let refund = &self.refund;
647        RequestBuilder::new(StripeMethod::Post, format!("/test_helpers/refunds/{refund}/expire"))
648            .form(&self.inner)
649    }
650}