pub struct PaymentMethodsApi<'a> { /* private fields */ }Expand description
API for managing payment methods.
This API provides endpoints for listing and retrieving payment methods.
Implementations§
Source§impl<'a> PaymentMethodsApi<'a>
impl<'a> PaymentMethodsApi<'a>
Sourcepub async fn list(&self) -> Result<Vec<PaymentMethod>>
pub async fn list(&self) -> Result<Vec<PaymentMethod>>
List all payment methods.
§Example
let client = RestClient::builder()
.credentials(Credentials::from_env()?)
.build()?;
let payment_methods = client.payment_methods().list().await?;
for pm in payment_methods {
println!("{}: {} ({})", pm.id, pm.name, pm.payment_type);
}Sourcepub async fn get(&self, payment_method_id: &str) -> Result<PaymentMethod>
pub async fn get(&self, payment_method_id: &str) -> Result<PaymentMethod>
Get a specific payment method by ID.
§Example
let client = RestClient::builder()
.credentials(Credentials::from_env()?)
.build()?;
let payment_method = client.payment_methods().get("payment-method-id").await?;
println!("Payment method: {} - {}", payment_method.name, payment_method.payment_type);Auto Trait Implementations§
impl<'a> Freeze for PaymentMethodsApi<'a>
impl<'a> !RefUnwindSafe for PaymentMethodsApi<'a>
impl<'a> Send for PaymentMethodsApi<'a>
impl<'a> Sync for PaymentMethodsApi<'a>
impl<'a> Unpin for PaymentMethodsApi<'a>
impl<'a> !UnwindSafe for PaymentMethodsApi<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more