plaid/request/
transfer_refund_cancel.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use crate::FluentRequest;
use serde::{Serialize, Deserialize};
use httpclient::InMemoryResponseExt;
/**You should use this struct via [`PlaidClient::transfer_refund_cancel`].

On request success, this will return a [`TransferRefundCancelResponse`].*/
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TransferRefundCancelRequest {
    pub refund_id: String,
}
impl FluentRequest<'_, TransferRefundCancelRequest> {}
impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRefundCancelRequest> {
    type Output = httpclient::InMemoryResult<crate::model::TransferRefundCancelResponse>;
    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
    fn into_future(self) -> Self::IntoFuture {
        Box::pin(async move {
            let url = "/transfer/refund/cancel";
            let mut r = self.client.client.post(url);
            r = r.json(serde_json::json!({ "refund_id" : self.params.refund_id }));
            r = self.client.authenticate(r);
            let res = r.await?;
            res.json().map_err(Into::into)
        })
    }
}
impl crate::PlaidClient {
    /**Cancel a refund

Use the `/transfer/refund/cancel` endpoint to cancel a refund.  A refund is eligible for cancellation if it has not yet been submitted to the payment network.

See endpoint docs at <https://plaid.com/docs/api/products/transfer/refunds/#transferrefundcancel>.*/
    pub fn transfer_refund_cancel(
        &self,
        refund_id: &str,
    ) -> FluentRequest<'_, TransferRefundCancelRequest> {
        FluentRequest {
            client: self,
            params: TransferRefundCancelRequest {
                refund_id: refund_id.to_owned(),
            },
        }
    }
}