use crate::config::{Client, Response};
use crate::ids::{CustomerId, PaymentMethodId};
use crate::resources::PaymentMethod;
use serde_derive::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AttachPaymentMethod {
pub customer: CustomerId,
}
impl PaymentMethod {
pub fn attach(
client: &Client,
payment_method_id: &PaymentMethodId,
params: AttachPaymentMethod,
) -> Response<PaymentMethod> {
client.post_form(&format!("/payment_methods/{}/attach", payment_method_id), params)
}
}