| Crates.io | rust_paystack |
| lib.rs | rust_paystack |
| version | 0.1.4 |
| created_at | 2025-02-22 22:45:17.532063+00 |
| updated_at | 2025-02-25 09:17:54.023262+00 |
| description | A Rust library for interacting with the Paystack API |
| homepage | https://github.com/blackdante101/rust_paystack |
| repository | https://github.com/blackdante101/rust_paystack |
| max_upload_size | |
| id | 1565884 |
| size | 61,928 |
a rust library for interacting with Paystack API
run this command in your project directory
cargo add rust_paystack
cargo add rust_decimal_macros // for parsing the amount
Including the library in your project:
use rust_paystack::Paystack;
when creating a new instance, api key should be parsed to string
let rust_p = RustPaystack::new("sk_xxxxxxxxxx".to_string());
use rust_paystack::RustPaystack;
use rust_decimal_macros::dec;
#[tokio::main]
async fn main() {
let rust_p = RustPaystack::new("sk_xxxxxxxxxx".to_string());
let email = "test@testmail.com";
let amount = dec!(10.50); // amount should be parsed using rust_decimal_macros
let response = rust_p.initialize_transaction(email, amount).await;
println!("{:?}", response);
}
use rust_paystack::RustPaystack;
#[tokio::main]
async fn main() {
let rust_p = RustPaystack::new("sk_xxxxxxxxxx".to_string());
let req = rust_p.verify_payment("reference").await;
println!("{:?}", req);
}
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)Abukari Einus - einusabukari@gmail.com
Project Link: https://github.com/blackdante101/rust_paystack