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
44
45
use std::borrow::Cow;
use derive_builder::Builder;
use crate::{data::payment::*, endpoint::Endpoint};
#[derive(Debug, Default, Clone, Builder)]
pub struct GetAuthorizedPayment {
pub authorization_id: String,
}
impl GetAuthorizedPayment {
pub fn new(authorization_id: impl ToString) -> Self {
Self {
authorization_id: authorization_id.to_string(),
}
}
}
impl Endpoint for GetAuthorizedPayment {
type Query = ();
type Body = ();
type Response = AuthorizedPaymentDetails;
fn relative_path(&self) -> Cow<str> {
Cow::Owned(format!("/v2/payments/authorizations/{}", self.authorization_id))
}
fn method(&self) -> reqwest::Method {
reqwest::Method::GET
}
}