Caution
This SDK is currently in early development. The foundation is complete, but API implementations are stubs. Not ready for production use yet!
Unofficial Rust SDK for PayRex
- Foundations
- APIs
- Payment Intents
- Customers
- Billing Statements
- Checkout Sessions
- Webhooks
- Events
- Refunds
- Payouts
- Final
- Integration tests
- Documentation improvements
- Publish to crates.io
For now, you can use it from git:
[dependencies]
payrex = { git = "https://github.com/mayspc/payrex-rust" }
tokio = { version = "1", features = ["full"] }Note
These examples show the intended API design. Currently, all methods return stub/placeholder data.
use payrex::{Client, Currency};
use payrex::resources::payment_intents::{CreatePaymentIntent, CaptureMethod};
#[tokio::main]
async fn main() -> Result<(), payrex::Error> {
// Initialize the client with your API key
let client = Client::new("your_secret_key");
// Create a payment intent (currently returns stub data)
let params = CreatePaymentIntent::new(10000, Currency::PHP)
.description("Order #12345")
.capture_method(CaptureMethod::Automatic);
let payment_intent = client.payment_intents().create(params).await?;
println!("Created payment intent: {}", payment_intent.id);
println!("Status: {:?}", payment_intent.status);
Ok(())
}use payrex::{Client, Config};
use std::time::Duration;
let config = Config::builder()
.api_key("your_secret_key")
.timeout(Duration::from_secs(30))
.max_retries(3)
.test_mode(true)
.build()?;
let client = Client::with_config(config)?;The SDK will include comprehensive tests. Run them with:
cargo testSee the examples directory for more usage examples:
basic_usage.rs- Basic payment intent creation
- Rust 1.90 or later
Contributions are welcome! This is an early-stage project, so there's plenty to do.
Feel free to open issues or submit PRs!
Built for the Rust and PayRex communities.