stripe_core/payout/
requests.rs

1use stripe_client_core::{
2    RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone, Debug, serde::Serialize)]
6struct ListPayoutBuilder {
7    #[serde(skip_serializing_if = "Option::is_none")]
8    arrival_date: Option<stripe_types::RangeQueryTs>,
9    #[serde(skip_serializing_if = "Option::is_none")]
10    created: Option<stripe_types::RangeQueryTs>,
11    #[serde(skip_serializing_if = "Option::is_none")]
12    destination: Option<String>,
13    #[serde(skip_serializing_if = "Option::is_none")]
14    ending_before: Option<String>,
15    #[serde(skip_serializing_if = "Option::is_none")]
16    expand: Option<Vec<String>>,
17    #[serde(skip_serializing_if = "Option::is_none")]
18    limit: Option<i64>,
19    #[serde(skip_serializing_if = "Option::is_none")]
20    starting_after: Option<String>,
21    #[serde(skip_serializing_if = "Option::is_none")]
22    status: Option<String>,
23}
24impl ListPayoutBuilder {
25    fn new() -> Self {
26        Self {
27            arrival_date: None,
28            created: None,
29            destination: None,
30            ending_before: None,
31            expand: None,
32            limit: None,
33            starting_after: None,
34            status: None,
35        }
36    }
37}
38/// Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you.
39/// The payouts return in sorted order, with the most recently created payouts appearing first.
40#[derive(Clone, Debug, serde::Serialize)]
41pub struct ListPayout {
42    inner: ListPayoutBuilder,
43}
44impl ListPayout {
45    /// Construct a new `ListPayout`.
46    pub fn new() -> Self {
47        Self { inner: ListPayoutBuilder::new() }
48    }
49    /// Only return payouts that are expected to arrive during the given date interval.
50    pub fn arrival_date(mut self, arrival_date: impl Into<stripe_types::RangeQueryTs>) -> Self {
51        self.inner.arrival_date = Some(arrival_date.into());
52        self
53    }
54    /// Only return payouts that were created during the given date interval.
55    pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
56        self.inner.created = Some(created.into());
57        self
58    }
59    /// The ID of an external account - only return payouts sent to this external account.
60    pub fn destination(mut self, destination: impl Into<String>) -> Self {
61        self.inner.destination = Some(destination.into());
62        self
63    }
64    /// A cursor for use in pagination.
65    /// `ending_before` is an object ID that defines your place in the list.
66    /// 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.
67    pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
68        self.inner.ending_before = Some(ending_before.into());
69        self
70    }
71    /// Specifies which fields in the response should be expanded.
72    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
73        self.inner.expand = Some(expand.into());
74        self
75    }
76    /// A limit on the number of objects to be returned.
77    /// Limit can range between 1 and 100, and the default is 10.
78    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
79        self.inner.limit = Some(limit.into());
80        self
81    }
82    /// A cursor for use in pagination.
83    /// `starting_after` is an object ID that defines your place in the list.
84    /// 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.
85    pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
86        self.inner.starting_after = Some(starting_after.into());
87        self
88    }
89    /// Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`.
90    pub fn status(mut self, status: impl Into<String>) -> Self {
91        self.inner.status = Some(status.into());
92        self
93    }
94}
95impl Default for ListPayout {
96    fn default() -> Self {
97        Self::new()
98    }
99}
100impl ListPayout {
101    /// Send the request and return the deserialized response.
102    pub async fn send<C: StripeClient>(
103        &self,
104        client: &C,
105    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
106        self.customize().send(client).await
107    }
108
109    /// Send the request and return the deserialized response, blocking until completion.
110    pub fn send_blocking<C: StripeBlockingClient>(
111        &self,
112        client: &C,
113    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
114        self.customize().send_blocking(client)
115    }
116
117    pub fn paginate(
118        &self,
119    ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::Payout>> {
120        stripe_client_core::ListPaginator::new_list("/payouts", &self.inner)
121    }
122}
123
124impl StripeRequest for ListPayout {
125    type Output = stripe_types::List<stripe_shared::Payout>;
126
127    fn build(&self) -> RequestBuilder {
128        RequestBuilder::new(StripeMethod::Get, "/payouts").query(&self.inner)
129    }
130}
131#[derive(Clone, Debug, serde::Serialize)]
132struct RetrievePayoutBuilder {
133    #[serde(skip_serializing_if = "Option::is_none")]
134    expand: Option<Vec<String>>,
135}
136impl RetrievePayoutBuilder {
137    fn new() -> Self {
138        Self { expand: None }
139    }
140}
141/// Retrieves the details of an existing payout.
142/// Supply the unique payout ID from either a payout creation request or the payout list.
143/// Stripe returns the corresponding payout information.
144#[derive(Clone, Debug, serde::Serialize)]
145pub struct RetrievePayout {
146    inner: RetrievePayoutBuilder,
147    payout: stripe_shared::PayoutId,
148}
149impl RetrievePayout {
150    /// Construct a new `RetrievePayout`.
151    pub fn new(payout: impl Into<stripe_shared::PayoutId>) -> Self {
152        Self { payout: payout.into(), inner: RetrievePayoutBuilder::new() }
153    }
154    /// Specifies which fields in the response should be expanded.
155    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
156        self.inner.expand = Some(expand.into());
157        self
158    }
159}
160impl RetrievePayout {
161    /// Send the request and return the deserialized response.
162    pub async fn send<C: StripeClient>(
163        &self,
164        client: &C,
165    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
166        self.customize().send(client).await
167    }
168
169    /// Send the request and return the deserialized response, blocking until completion.
170    pub fn send_blocking<C: StripeBlockingClient>(
171        &self,
172        client: &C,
173    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
174        self.customize().send_blocking(client)
175    }
176}
177
178impl StripeRequest for RetrievePayout {
179    type Output = stripe_shared::Payout;
180
181    fn build(&self) -> RequestBuilder {
182        let payout = &self.payout;
183        RequestBuilder::new(StripeMethod::Get, format!("/payouts/{payout}")).query(&self.inner)
184    }
185}
186#[derive(Clone, Debug, serde::Serialize)]
187struct CreatePayoutBuilder {
188    amount: i64,
189    currency: stripe_types::Currency,
190    #[serde(skip_serializing_if = "Option::is_none")]
191    description: Option<String>,
192    #[serde(skip_serializing_if = "Option::is_none")]
193    destination: Option<String>,
194    #[serde(skip_serializing_if = "Option::is_none")]
195    expand: Option<Vec<String>>,
196    #[serde(skip_serializing_if = "Option::is_none")]
197    metadata: Option<std::collections::HashMap<String, String>>,
198    #[serde(skip_serializing_if = "Option::is_none")]
199    method: Option<CreatePayoutMethod>,
200    #[serde(skip_serializing_if = "Option::is_none")]
201    payout_method: Option<String>,
202    #[serde(skip_serializing_if = "Option::is_none")]
203    source_type: Option<CreatePayoutSourceType>,
204    #[serde(skip_serializing_if = "Option::is_none")]
205    statement_descriptor: Option<String>,
206}
207impl CreatePayoutBuilder {
208    fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
209        Self {
210            amount: amount.into(),
211            currency: currency.into(),
212            description: None,
213            destination: None,
214            expand: None,
215            metadata: None,
216            method: None,
217            payout_method: None,
218            source_type: None,
219            statement_descriptor: None,
220        }
221    }
222}
223/// The method used to send this payout, which is `standard` or `instant`.
224/// We support `instant` for payouts to debit cards and bank accounts in certain countries.
225/// Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks).
226#[derive(Clone, Eq, PartialEq)]
227#[non_exhaustive]
228pub enum CreatePayoutMethod {
229    Instant,
230    Standard,
231    /// An unrecognized value from Stripe. Should not be used as a request parameter.
232    Unknown(String),
233}
234impl CreatePayoutMethod {
235    pub fn as_str(&self) -> &str {
236        use CreatePayoutMethod::*;
237        match self {
238            Instant => "instant",
239            Standard => "standard",
240            Unknown(v) => v,
241        }
242    }
243}
244
245impl std::str::FromStr for CreatePayoutMethod {
246    type Err = std::convert::Infallible;
247    fn from_str(s: &str) -> Result<Self, Self::Err> {
248        use CreatePayoutMethod::*;
249        match s {
250            "instant" => Ok(Instant),
251            "standard" => Ok(Standard),
252            v => {
253                tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreatePayoutMethod");
254                Ok(Unknown(v.to_owned()))
255            }
256        }
257    }
258}
259impl std::fmt::Display for CreatePayoutMethod {
260    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
261        f.write_str(self.as_str())
262    }
263}
264
265impl std::fmt::Debug for CreatePayoutMethod {
266    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
267        f.write_str(self.as_str())
268    }
269}
270impl serde::Serialize for CreatePayoutMethod {
271    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
272    where
273        S: serde::Serializer,
274    {
275        serializer.serialize_str(self.as_str())
276    }
277}
278#[cfg(feature = "deserialize")]
279impl<'de> serde::Deserialize<'de> for CreatePayoutMethod {
280    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
281        use std::str::FromStr;
282        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
283        Ok(Self::from_str(&s).expect("infallible"))
284    }
285}
286/// The balance type of your Stripe balance to draw this payout from.
287/// Balances for different payment sources are kept separately.
288/// You can find the amounts with the Balances API.
289/// One of `bank_account`, `card`, or `fpx`.
290#[derive(Clone, Eq, PartialEq)]
291#[non_exhaustive]
292pub enum CreatePayoutSourceType {
293    BankAccount,
294    Card,
295    Fpx,
296    /// An unrecognized value from Stripe. Should not be used as a request parameter.
297    Unknown(String),
298}
299impl CreatePayoutSourceType {
300    pub fn as_str(&self) -> &str {
301        use CreatePayoutSourceType::*;
302        match self {
303            BankAccount => "bank_account",
304            Card => "card",
305            Fpx => "fpx",
306            Unknown(v) => v,
307        }
308    }
309}
310
311impl std::str::FromStr for CreatePayoutSourceType {
312    type Err = std::convert::Infallible;
313    fn from_str(s: &str) -> Result<Self, Self::Err> {
314        use CreatePayoutSourceType::*;
315        match s {
316            "bank_account" => Ok(BankAccount),
317            "card" => Ok(Card),
318            "fpx" => Ok(Fpx),
319            v => {
320                tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreatePayoutSourceType");
321                Ok(Unknown(v.to_owned()))
322            }
323        }
324    }
325}
326impl std::fmt::Display for CreatePayoutSourceType {
327    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
328        f.write_str(self.as_str())
329    }
330}
331
332impl std::fmt::Debug for CreatePayoutSourceType {
333    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
334        f.write_str(self.as_str())
335    }
336}
337impl serde::Serialize for CreatePayoutSourceType {
338    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
339    where
340        S: serde::Serializer,
341    {
342        serializer.serialize_str(self.as_str())
343    }
344}
345#[cfg(feature = "deserialize")]
346impl<'de> serde::Deserialize<'de> for CreatePayoutSourceType {
347    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
348        use std::str::FromStr;
349        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
350        Ok(Self::from_str(&s).expect("infallible"))
351    }
352}
353/// To send funds to your own bank account, create a new payout object.
354/// Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount.
355/// If it doesn’t, you receive an “Insufficient Funds” error.
356///
357/// If your API key is in test mode, money won’t actually be sent, though every other action occurs as if you’re in live mode.
358///
359/// If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from.
360/// The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type.
361#[derive(Clone, Debug, serde::Serialize)]
362pub struct CreatePayout {
363    inner: CreatePayoutBuilder,
364}
365impl CreatePayout {
366    /// Construct a new `CreatePayout`.
367    pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
368        Self { inner: CreatePayoutBuilder::new(amount.into(), currency.into()) }
369    }
370    /// An arbitrary string attached to the object. Often useful for displaying to users.
371    pub fn description(mut self, description: impl Into<String>) -> Self {
372        self.inner.description = Some(description.into());
373        self
374    }
375    /// The ID of a bank account or a card to send the payout to.
376    /// If you don't provide a destination, we use the default external account for the specified currency.
377    pub fn destination(mut self, destination: impl Into<String>) -> Self {
378        self.inner.destination = Some(destination.into());
379        self
380    }
381    /// Specifies which fields in the response should be expanded.
382    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
383        self.inner.expand = Some(expand.into());
384        self
385    }
386    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
387    /// This can be useful for storing additional information about the object in a structured format.
388    /// Individual keys can be unset by posting an empty value to them.
389    /// All keys can be unset by posting an empty value to `metadata`.
390    pub fn metadata(
391        mut self,
392        metadata: impl Into<std::collections::HashMap<String, String>>,
393    ) -> Self {
394        self.inner.metadata = Some(metadata.into());
395        self
396    }
397    /// The method used to send this payout, which is `standard` or `instant`.
398    /// We support `instant` for payouts to debit cards and bank accounts in certain countries.
399    /// Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks).
400    pub fn method(mut self, method: impl Into<CreatePayoutMethod>) -> Self {
401        self.inner.method = Some(method.into());
402        self
403    }
404    /// The ID of a v2 FinancialAccount to send funds to.
405    pub fn payout_method(mut self, payout_method: impl Into<String>) -> Self {
406        self.inner.payout_method = Some(payout_method.into());
407        self
408    }
409    /// The balance type of your Stripe balance to draw this payout from.
410    /// Balances for different payment sources are kept separately.
411    /// You can find the amounts with the Balances API.
412    /// One of `bank_account`, `card`, or `fpx`.
413    pub fn source_type(mut self, source_type: impl Into<CreatePayoutSourceType>) -> Self {
414        self.inner.source_type = Some(source_type.into());
415        self
416    }
417    /// A string that displays on the recipient's bank or card statement (up to 22 characters).
418    /// A `statement_descriptor` that's longer than 22 characters return an error.
419    /// Most banks truncate this information and display it inconsistently.
420    /// Some banks might not display it at all.
421    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
422        self.inner.statement_descriptor = Some(statement_descriptor.into());
423        self
424    }
425}
426impl CreatePayout {
427    /// Send the request and return the deserialized response.
428    pub async fn send<C: StripeClient>(
429        &self,
430        client: &C,
431    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
432        self.customize().send(client).await
433    }
434
435    /// Send the request and return the deserialized response, blocking until completion.
436    pub fn send_blocking<C: StripeBlockingClient>(
437        &self,
438        client: &C,
439    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
440        self.customize().send_blocking(client)
441    }
442}
443
444impl StripeRequest for CreatePayout {
445    type Output = stripe_shared::Payout;
446
447    fn build(&self) -> RequestBuilder {
448        RequestBuilder::new(StripeMethod::Post, "/payouts").form(&self.inner)
449    }
450}
451#[derive(Clone, Debug, serde::Serialize)]
452struct UpdatePayoutBuilder {
453    #[serde(skip_serializing_if = "Option::is_none")]
454    expand: Option<Vec<String>>,
455    #[serde(skip_serializing_if = "Option::is_none")]
456    metadata: Option<std::collections::HashMap<String, String>>,
457}
458impl UpdatePayoutBuilder {
459    fn new() -> Self {
460        Self { expand: None, metadata: None }
461    }
462}
463/// Updates the specified payout by setting the values of the parameters you pass.
464/// We don’t change parameters that you don’t provide.
465/// This request only accepts the metadata as arguments.
466#[derive(Clone, Debug, serde::Serialize)]
467pub struct UpdatePayout {
468    inner: UpdatePayoutBuilder,
469    payout: stripe_shared::PayoutId,
470}
471impl UpdatePayout {
472    /// Construct a new `UpdatePayout`.
473    pub fn new(payout: impl Into<stripe_shared::PayoutId>) -> Self {
474        Self { payout: payout.into(), inner: UpdatePayoutBuilder::new() }
475    }
476    /// Specifies which fields in the response should be expanded.
477    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
478        self.inner.expand = Some(expand.into());
479        self
480    }
481    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
482    /// This can be useful for storing additional information about the object in a structured format.
483    /// Individual keys can be unset by posting an empty value to them.
484    /// All keys can be unset by posting an empty value to `metadata`.
485    pub fn metadata(
486        mut self,
487        metadata: impl Into<std::collections::HashMap<String, String>>,
488    ) -> Self {
489        self.inner.metadata = Some(metadata.into());
490        self
491    }
492}
493impl UpdatePayout {
494    /// Send the request and return the deserialized response.
495    pub async fn send<C: StripeClient>(
496        &self,
497        client: &C,
498    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
499        self.customize().send(client).await
500    }
501
502    /// Send the request and return the deserialized response, blocking until completion.
503    pub fn send_blocking<C: StripeBlockingClient>(
504        &self,
505        client: &C,
506    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
507        self.customize().send_blocking(client)
508    }
509}
510
511impl StripeRequest for UpdatePayout {
512    type Output = stripe_shared::Payout;
513
514    fn build(&self) -> RequestBuilder {
515        let payout = &self.payout;
516        RequestBuilder::new(StripeMethod::Post, format!("/payouts/{payout}")).form(&self.inner)
517    }
518}
519#[derive(Clone, Debug, serde::Serialize)]
520struct CancelPayoutBuilder {
521    #[serde(skip_serializing_if = "Option::is_none")]
522    expand: Option<Vec<String>>,
523}
524impl CancelPayoutBuilder {
525    fn new() -> Self {
526        Self { expand: None }
527    }
528}
529/// You can cancel a previously created payout if its status is `pending`.
530/// Stripe refunds the funds to your available balance.
531/// You can’t cancel automatic Stripe payouts.
532#[derive(Clone, Debug, serde::Serialize)]
533pub struct CancelPayout {
534    inner: CancelPayoutBuilder,
535    payout: stripe_shared::PayoutId,
536}
537impl CancelPayout {
538    /// Construct a new `CancelPayout`.
539    pub fn new(payout: impl Into<stripe_shared::PayoutId>) -> Self {
540        Self { payout: payout.into(), inner: CancelPayoutBuilder::new() }
541    }
542    /// Specifies which fields in the response should be expanded.
543    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
544        self.inner.expand = Some(expand.into());
545        self
546    }
547}
548impl CancelPayout {
549    /// Send the request and return the deserialized response.
550    pub async fn send<C: StripeClient>(
551        &self,
552        client: &C,
553    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
554        self.customize().send(client).await
555    }
556
557    /// Send the request and return the deserialized response, blocking until completion.
558    pub fn send_blocking<C: StripeBlockingClient>(
559        &self,
560        client: &C,
561    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
562        self.customize().send_blocking(client)
563    }
564}
565
566impl StripeRequest for CancelPayout {
567    type Output = stripe_shared::Payout;
568
569    fn build(&self) -> RequestBuilder {
570        let payout = &self.payout;
571        RequestBuilder::new(StripeMethod::Post, format!("/payouts/{payout}/cancel"))
572            .form(&self.inner)
573    }
574}
575#[derive(Clone, Debug, serde::Serialize)]
576struct ReversePayoutBuilder {
577    #[serde(skip_serializing_if = "Option::is_none")]
578    expand: Option<Vec<String>>,
579    #[serde(skip_serializing_if = "Option::is_none")]
580    metadata: Option<std::collections::HashMap<String, String>>,
581}
582impl ReversePayoutBuilder {
583    fn new() -> Self {
584        Self { expand: None, metadata: None }
585    }
586}
587/// Reverses a payout by debiting the destination bank account.
588/// At this time, you can only reverse payouts for connected accounts to US and Canadian bank accounts.
589/// If the payout is manual and in the `pending` status, use `/v1/payouts/:id/cancel` instead.
590///
591/// By requesting a reversal through `/v1/payouts/:id/reverse`, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required.
592#[derive(Clone, Debug, serde::Serialize)]
593pub struct ReversePayout {
594    inner: ReversePayoutBuilder,
595    payout: stripe_shared::PayoutId,
596}
597impl ReversePayout {
598    /// Construct a new `ReversePayout`.
599    pub fn new(payout: impl Into<stripe_shared::PayoutId>) -> Self {
600        Self { payout: payout.into(), inner: ReversePayoutBuilder::new() }
601    }
602    /// Specifies which fields in the response should be expanded.
603    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
604        self.inner.expand = Some(expand.into());
605        self
606    }
607    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
608    /// This can be useful for storing additional information about the object in a structured format.
609    /// Individual keys can be unset by posting an empty value to them.
610    /// All keys can be unset by posting an empty value to `metadata`.
611    pub fn metadata(
612        mut self,
613        metadata: impl Into<std::collections::HashMap<String, String>>,
614    ) -> Self {
615        self.inner.metadata = Some(metadata.into());
616        self
617    }
618}
619impl ReversePayout {
620    /// Send the request and return the deserialized response.
621    pub async fn send<C: StripeClient>(
622        &self,
623        client: &C,
624    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
625        self.customize().send(client).await
626    }
627
628    /// Send the request and return the deserialized response, blocking until completion.
629    pub fn send_blocking<C: StripeBlockingClient>(
630        &self,
631        client: &C,
632    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
633        self.customize().send_blocking(client)
634    }
635}
636
637impl StripeRequest for ReversePayout {
638    type Output = stripe_shared::Payout;
639
640    fn build(&self) -> RequestBuilder {
641        let payout = &self.payout;
642        RequestBuilder::new(StripeMethod::Post, format!("/payouts/{payout}/reverse"))
643            .form(&self.inner)
644    }
645}