rust_paystack/lib.rs
1//! # Rust Paystack
2//!
3//! a rust library for interacting with Paystack API
4//!
5//! # Getting Started
6//! run this command in your project directory
7//! ```no_run
8//! cargo add rust_paystack
9//! ```
10//! Including the library in your project:
11//! ```no_run
12//! use rust_paystack::Paystack;
13//! ```
14//! # Creating a new instance
15//! when creating a new instance, api key should be parsed to string
16//! ```no_run
17//! let rust_p = RustPaystack::new(PAYSTACK_SECRET_KEY.to_string());
18//! ```
19//! # Initializing a transaction
20//! ```no_run
21//! #[tokio::main]
22//!async fn main() {
23//! let rust_p = RustPaystack::new(PAYSTACK_SECRET_KEY.to_string());
24//! let req = rust_p.initialize_transaction( "test@testmail.com", 10.50).await;
25//!
26//! println!("{:?}", req);
27//!}
28//! ```
29//!
30//! # Verfiying a transaction
31//!
32//! ```no_run
33//! #[tokio::main]
34//!async fn main() {
35//! let rust_p = RustPaystack::new(PAYSTACK_SECRET_KEY.to_string());
36//! let req = rust_p.verify_payment("reference").await;
37//!
38//! println!("{:?}", req);
39//!}
40//! ```
41
42mod payment;
43
44pub use payment::RustPaystack;
45
46