paystack

Crates.iopaystack
lib.rspaystack
version0.1.1
sourcesrc
created_at2020-07-25 15:04:41.369112
updated_at2020-07-25 15:11:07.872321
descriptionRust package for working with Paystack
homepagehttps://github.com/Henadadme/paystack-rust
repositoryhttps://github.com/Henadadme/paystack-rust
max_upload_size
id269501
size37,450
Emmanuel Adebayo (toluwaanimi)

documentation

https://github.com/Henadadme/paystack-rust/blob/master/README.md

README

Paystack

Introduction

Paystack Package for Rust

Usage

Install Package

paystack = "0.1.1"
  • Initialise Paystack
    pub async fn main() -> Result<(), Error> {
        let _paystack = Paystack::new("sk_test_00000000000000000000000000000".to_string());
        Ok(())
    }
...

NOTE
Ensure you pass your paystack secret key

  • Initiate charge
...
pub async fn main() -> Result<(), Error> {
    let transaction = paystack.initialize("adebayo@emmanuel.com".to_string(), "5000".to_string()).await;
    println!("{:#?}", transaction);
    Ok(())
}
  • Verify charge
...
pub async fn main() -> Result<(), Error> {
    let verify = paystack.verify_payment("xxxxxxxx".to_string()).await;
    println!("{:#?}", verify);
    Ok(())
}

  • Charge charge
...
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 the example directory to see a sample implementation

Contribution

Please contribute

Commit count: 10

cargo fmt