| Crates.io | payrust |
| lib.rs | payrust |
| version | 0.1.0 |
| created_at | 2025-12-13 00:19:35.578767+00 |
| updated_at | 2025-12-13 00:19:35.578767+00 |
| description | PayPal REST API client for Rust |
| homepage | https://github.com/Nonanti/payrust |
| repository | https://github.com/Nonanti/payrust |
| max_upload_size | |
| id | 1982392 |
| size | 96,283 |
PayPal REST API client for Rust.
[dependencies]
payrust = "0.1"
use payrust::prelude::*;
#[tokio::main]
async fn main() -> payrust::Result<()> {
let client = PayPal::sandbox("CLIENT_ID", "SECRET").await?;
let order = client.create_order()
.amount(29.99, Currency::USD)
.item("Product", 1, 29.99)
.return_url("https://example.com/success")
.cancel_url("https://example.com/cancel")
.send()
.await?;
println!("{}", order.approve_url().unwrap());
// after approval
let captured = client.capture(&order.id).await?;
Ok(())
}
MIT