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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! Convenient rust bindings and types for the Paystack HTTP API aiming to support the entire API surface.
//! Not the case? Please open an issue. I update the definitions on a weekly basis.
//!
//! # Documentation
//! See the [Rust API docs](https://docs.rs/paystack-rs) or the [examples](/examples).
//!
//! ## Installation
//!
//! `paystack-rs` uses the `reqwest` http client under the hood and the `tokio` runtime for async operations
//!
//! ```toml
//! [dependencies]
//! paystack-rs = "1.6.0"
//! ```
//!
//! ## Usage
//!
//! Initializing an instance of the Paystack client and creating a transaction.
//!
//! ```rust
//! use std::env;
//! use std::error::Error;
//! use dotenv::dotenv;
//! use paystack::{PaystackClient, TransactionRequestBuilder, PaystackAPIError, Currency, Channel, ReqwestClient};
//!
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//! dotenv().ok();
//! use std::error::Error;
//! let api_key = env::var("PAYSTACK_API_KEY").unwrap();
//! let client = PaystackClient::<ReqwestClient>::new(api_key);
//!
//!
//! let email = "email@example.com".to_string();
//! let amount ="10000".to_string();
//! let body = TransactionRequestBuilder::default()
//! .amount(amount)
//! .email(email)
//! .currency(Currency::NGN)
//! .channel(vec![
//! Channel::Card,
//! Channel::ApplePay,
//! Channel::BankTransfer,
//! Channel::Bank,
//! ])
//! .build()?;
//!
//! let res = client
//! .transactions
//! .initialize_transaction(body)
//! .await
//! .expect("Unable to create transaction");
//!
//! Ok(())
//! }
//! ```
//!
//! ## Contributing
//!
//! See [CONTRIBUTING.md](/CONTRIBUTING.md) for information on contributing to paystack-rs.
//!
// ## License
//!
//! Licensed under MIT license ([LICENSE-MIT](/LICENSE-MIT)).
//!
// public re-export of modules
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
/// Custom result type for the Paystack API
pub type PaystackResult<T> = ;