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
}
}