dodopayments_rust

Crates.iododopayments_rust
lib.rsdodopayments_rust
version0.2.0
created_at2025-08-22 16:57:40.690447+00
updated_at2025-09-18 19:10:51.674856+00
descriptionRust SDK for Dodo Payments API
homepagehttps://github.com/Muhammad-Owais-Warsi/dodpayments_rust_sdk
repositoryhttps://github.com/Muhammad-Owais-Warsi/dodpayments_rust_sdk
max_upload_size
id1806607
size94,754
Muhammad Owais Warsi (Muhammad-Owais-Warsi)

documentation

https://docs.rs/dodopayments_rust

README

Dodo Payments Rust SDK

Rust sdk to interact with dodopayments REST API.

The REST API documentation can be found on docs.dodopayments.com.

Installation

cargo add dodopayments_rust

Usage

use dodopayments_rust::{DodoPaymentsClient, DodoPaymentsClientBuilder, ResponseData};
use std::collections::HashMap;

#[tokio::main]
async fn main() {
    let client: DodoPaymentsClient = DodoPaymentsClientBuilder::new()
        .bearer_token("")
        .enviroment("test_mode")
        .build()
        .unwrap();

    let mut query_params = HashMap::new();
    query_params.insert("status", "succeeded");

    let body = None;
    let ext_path = None;

    match client
        .payments()
        .list(Some(query_params), body, ext_path)
        .await
    {
        Ok(resp) => match resp {
            ResponseData::Text(text) => {
                println!("Text response: {}", text);
            }
            ResponseData::Blob(bytes) => {
                std::fs::write("invoice.pdf", &bytes).expect("Failed to write file");
            }
        },
        Err(err) => eprintln!("Error: {}", err),
    }
}

Examples

You can checkout examples folder to view the usage of all the endpoints. To run any example run the following command in your root

  cargo run --example <file_name>
Commit count: 12

cargo fmt