This is Unoffical SDK of dodopayments.com. Almost all features are implemented with a example script. A good amount of testing is required.
🏆 The dodo-payments-rs is listed in Dodo Payments Community Projects
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);
}
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
- Checkout Session
- Payments
- Subscriptions
- Discounts
- Licenses
- Customers
- Products
- Addons
- Meters
- Usage Events
- Refunds
- Disputes
- Payouts
- Brands
- Webhooks
- Miscellaneous
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.
.png)


