dodo_payments

Crates.iododo_payments
lib.rsdodo_payments
version0.1.1
created_at2025-09-22 17:58:58.194211+00
updated_at2025-09-23 18:12:40.528204+00
descriptionThis is Unoffical SDK of dodopayments.com
homepage
repositoryhttps://github.com/PiyushXCoder/dodo-payments-rs
max_upload_size
id1850463
size467,644
Piyush मिश्र: (PiyushXCoder)

documentation

README

Unoffical Dodo Payment SDK


Image

This is Unoffical SDK of dodopayments.com. Almost all features are implemented with a example script. A good amount of testing is required.

How to use

For now the basic usage looks much like.

use dodo_payments::{
    DodoPayments, client::DodoPaymentsConfigBuilder, operations::common::structs::ProductItem,
};
use std::env;

#[tokio::main]
async fn main() {
    let bearer_token = env::var("DODO_PAYMENTS_BEARER_TOKEN")
        .expect("DODO_PAYMENTS_BEARER_TOKEN must be set in env variables");
    let product_id = env::var("DODO_PAYMENTS_PRODUCT_ID")
        .expect("DODO_PAYMENTS_PRODUCT_ID must be set in env variables");

    let client = DodoPayments::new(
        DodoPaymentsConfigBuilder::new()
            .bearer_token(&bearer_token)
            .environment("test_mode"),
    );

    let response = client
        .checkout_sessions(vec![ProductItem {
            product_id: product_id,
            quantity: 1,
            amount: None,
        }])
        .send()
        .await;

    println!("Response: {:#?}", response);
}

Running example

Check examples directory to understanding usage

export DODO_PAYMENTS_BEARER_TOKEN="<your token>"
export DODO_PAYMENTS_PRODUCT_ID="<your product id>"
cargo run --example checkout_sessions

Roadmap

  • Checkout Session
  • Payments
  • Subscriptions
  • Discounts
  • Licenses
  • Customers
  • Products
  • Addons
  • Meters
  • Usage Events
  • Refunds
  • Disputes
  • Payouts
  • Brands
  • Webhooks
  • Miscellaneous

Contributing

Welcome aboard! 🎉 We’re excited to have you here. If you’re adding a new operation, please make sure to also include a clear example that demonstrates its usage. We also encourage you to contribute by testing and refining existing operations to help maintain overall stability and reliability of the project. Every contribution—big or small—helps improve the ecosystem for everyone.

Commit count: 123

cargo fmt