dodo_payments 0.1.1

This is Unoffical SDK of dodopayments.com
Documentation
use dodo_payments::{DodoPayments, client::DodoPaymentsConfigBuilder};
use std::collections::HashMap;
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 webhook_id = env::var("DODO_PAYMENTS_WEBHOOK_ID")
        .expect("DODO_PAYMENTS_WEBHOOK_ID must be set in env variables");

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

    let mut headers = HashMap::new();
    headers.insert("X-Custom-Header".to_string(), "CustomValue".to_string());

    let response = client
        .update_webhook_headers(webhook_id, headers)
        .send()
        .await;

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