1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! # Rust Paystack
//!
//! A Rust library for interacting with the Paystack API.
//!
//! ## Getting Started
//! Run this command in your project directory:
//! ```rust,no_run
//! cargo add rust_paystack
//! cargo add rust_decimal_macros // for parsing the amount
//! ```
//!
//! ## Including the Library in Your Project
//! ```rust,no_run
//! use rust_paystack::Paystack;
//! ```
//!
//! ## Creating a New Instance
//! When creating a new instance, the API key should be passed as a string:
//! ```rust,no_run
//! let rust_p = RustPaystack::new("sk_xxxxxxxxxx".to_string());
//! ```
//!
//! ## Initializing a Transaction
//! ```rust,no_run
//! use rust_paystack::Paystack;
//! use rust_decimal_macros::dec;
//!
//! #[tokio::main]
//! async fn main() {
//! let rust_p = RustPaystack::new("sk_xxxxxxxxxx".to_string());
//!
//! let amount = dec!(10.50); // Amount should be parsed using rust_decimal_macros
//! let email = "test@testmail.com";
//!
//! let response = rust_p.initialize_transaction(email, amount).await;
//!
//! println!("{:?}", response);
//! }
//! ```
//!
//! ## Verifying a Transaction
//! ```rust,no_run
//! use rust_paystack::Paystack;
//!
//! #[tokio::main]
//! async fn main() {
//! let rust_p = RustPaystack::new("sk_xxxxxxxxxx".to_string());
//! let response = rust_p.verify_payment("reference").await;
//!
//! println!("{:?}", response);
//! }
//! ```
pub use RustPaystack;