paystack_transaction/lib.rs
1//! # Paystack Transaction
2//!
3//! A Simple to use package to use Paystack with Rust
4//!
5//! # Usage
6//! ```no_run
7//! use paystack_transaction::{cred_from_env, PaymentBuilder, Payment, MobileMoney};
8//!
9//! async fn build() {
10//! let key = cred_from_env("SECRET_KEY".to_string()).unwrap();
11//!
12//! let mut builder = Payment::builder(
13//! "test@example.com".to_string(),
14//! 100.0,
15//! key,
16//! );
17//!
18//! builder.mobile_money(
19//! MobileMoney {
20//! phone: "08123456789".to_string(),
21//! provider: "MTN".to_string(),
22//! }
23//! );
24//! builder.label("label".to_string());
25//! builder.reference("reference".to_string());
26//!
27//! builder.build().send().await.unwrap();
28//! }
29//! ```
30
31mod channels;
32mod cred;
33mod error;
34mod initialize;
35mod verify;
36
37pub use initialize::{Currency, Payment, PaymentBuilder};
38
39pub use cred::{cred_from_env, expose_secret};
40
41pub use channels::MobileMoney;
42
43pub use error::{AuthError, ResponseError};
44
45pub use verify::{verify_transaction, VerificationData, VerificationResult, Verify};