snippe 0.1.0

Async Rust client for the Snippe payments API (Tanzania) — collections, hosted checkout sessions, disbursements, and verified webhooks.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Print the current account balance.

use snippe::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let api_key = std::env::var("SNIPPE_API_KEY").expect("set SNIPPE_API_KEY");
    let client = Client::new(api_key)?;
    let balance = client.payments().balance().await?;
    println!(
        "available: {} TZS  |  total balance: {} TZS",
        balance.available.value, balance.balance.value
    );
    Ok(())
}