[−][src]Struct aiven_rs::payment::PaymentApi
Methods
impl PaymentApi
[src]
pub async fn add_credit_card<'_, '_, T: Serialize + ?Sized>(
&'_ self,
json_body: &'_ T
) -> Result<ResCard, AivenError>
[src]
&'_ self,
json_body: &'_ T
) -> Result<ResCard, AivenError>
Add credit card for user
https://api.aiven.io/doc/#api-Payment-CreditCardAdd
Arguments
stripe_token
- Credit card Stripe token
Examples
Basic usage:
use serde_json::json; use std::collections::HashMap; #[tokio::main] async fn main()-> Result<(), Box<dyn std::error::Error>>{ let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token"); let mut json = HashMap::new(); json.insert("stripe_token", "tok_17JIPf2eZvKY2CIkGwJXpO"); let response = client .payment() .add_credit_card(&json) .await?; Ok(()) }
pub async fn delete_credit_card<'_, '_>(
&'_ self,
card_id: &'_ str
) -> Result<(), AivenError>
[src]
&'_ self,
card_id: &'_ str
) -> Result<(), AivenError>
Delete user's credit card
https://api.aiven.io/doc/#api-Payment-CreditCardDelete
Examples
Basic usage:
#[tokio::main] async fn main()-> Result<(), Box<dyn std::error::Error>>{ let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token"); let response = client .payment() .delete_credit_card("unique-card-id") .await?; Ok(()) }
pub async fn list_credit_cards<'_>(&'_ self) -> Result<ResCards, AivenError>
[src]
List user's credit cards
https://api.aiven.io/doc/#api-Payment-CreditCardsList
Examples
Basic usage:
#[tokio::main] async fn main()-> Result<(), Box<dyn std::error::Error>>{ let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token"); let response = client .payment() .list_credit_cards() .await?; Ok(()) }
pub async fn update_credit_card<'_, '_, '_, T: Serialize + ?Sized>(
&'_ self,
card_id: &'_ str,
json_body: &'_ T
) -> Result<ResCard, AivenError>
[src]
&'_ self,
card_id: &'_ str,
json_body: &'_ T
) -> Result<ResCard, AivenError>
Update user's credit card
https://api.aiven.io/doc/#api-Payment-CreditCardUpdate
Examples
Basic usage:
use serde_json::json; #[tokio::main] async fn main()-> Result<(), Box<dyn std::error::Error>>{ let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token"); let json = json!({ "exp_month": 1, "exp_year": 2015, "name": "John Smith" }); let response = client .payment() .update_credit_card("cardid",&json) .await?; Ok(()) }
Auto Trait Implementations
impl !RefUnwindSafe for PaymentApi
impl Send for PaymentApi
impl Sync for PaymentApi
impl Unpin for PaymentApi
impl !UnwindSafe for PaymentApi
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,