Crates.io | paystack |
lib.rs | paystack |
version | 0.1.1 |
source | src |
created_at | 2020-07-25 15:04:41.369112 |
updated_at | 2020-07-25 15:11:07.872321 |
description | Rust package for working with Paystack |
homepage | https://github.com/Henadadme/paystack-rust |
repository | https://github.com/Henadadme/paystack-rust |
max_upload_size | |
id | 269501 |
size | 37,450 |
Paystack Package for Rust
paystack = "0.1.1"
pub async fn main() -> Result<(), Error> {
let _paystack = Paystack::new("sk_test_00000000000000000000000000000".to_string());
Ok(())
}
...
NOTE
Ensure you pass your paystack secret key
...
pub async fn main() -> Result<(), Error> {
let transaction = paystack.initialize("adebayo@emmanuel.com".to_string(), "5000".to_string()).await;
println!("{:#?}", transaction);
Ok(())
}
...
pub async fn main() -> Result<(), Error> {
let verify = paystack.verify_payment("xxxxxxxx".to_string()).await;
println!("{:#?}", verify);
Ok(())
}
...
pub async fn main() -> Result<(), Error> {
let charge_card = paystack.charge_card("AUTH_xxxxx".to_string(), "a@a.com".to_string(), "5000".to_string()).await;
println!("{:#?}", charge_card);
Ok(())
}
NOTE
Check theexample
directory to see a sample implementation
Please contribute