rust_paystack 0.1.2

A Rust library for interacting with the Paystack API
Documentation
rust_paystack-0.1.2 has been yanked.

LinkedIn Crate Badge Repo Badge Docs Badge [License Badge]

a rust library for interacting with Paystack API

Getting Started

run this command in your project directory

cargo add rust_paystack

Including the library in your project:

use rust_paystack::Paystack;

Creating a new instance

when creating a new instance, api key should be parsed to string

let rust_p = RustPaystack::new(PAYSTACK_SECRET_KEY.to_string());

Initializing a transaction

#[tokio::main]
!async fn main() {
    let rust_p = RustPaystack::new(PAYSTACK_SECRET_KEY.to_string());
    let req = rust_p.initialize_transaction( "test@testmail.com", 10.50).await;
     
    println!("{:?}", req);
}

Verfiying a transaction

#[tokio::main]
async fn main() {
    let rust_p = RustPaystack::new(PAYSTACK_SECRET_KEY.to_string());
    let req = rust_p.verify_payment("reference").await;
     
     println!("{:?}", req);
}

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Abukari Einus - einusabukari@gmail.com

Project Link: https://github.com/blackdante101/rust_paystack