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
//! ## About //! //! A Rust wrapper around the [Safaricom API](https://developer.safaricom.co.ke/docs?shell#introduction) for accessing M-Pesa services. // Currently, a work in progress project. // //! ## Notes //! **Warning!** v0.*. Expect bugs therefore not recommended for use in production. Pull requests and issues very welcome. //! //! ## Install & Usage //! In your `Cargo.toml` file: //! //! ```md //! [dependencies] //! mpesa = "0.1.6" //! ``` //! //! In your lib or binary crate: //! ```rs //! use mpesa::Mpesa; //! ``` //! //! ## Examples //! //! Use [`dotenv`](https://docs.rs/dotenv/0.15.0/dotenv/fn.dotenv.html) crate to store your keys as environmental variables instead of hard coding them like done in the example below. //! //! ```rs //! use mpesa::{Mpesa, Environment}; //! use std::env; //! //! let client = Mpesa::new( //! env::var("CLIENT_KEY")?, //! env::var("CLIENT_SECRET")?, //! Environment::Sandbox, //! env::var("INIT_PASSWORD")?, //! ); //! ``` //! //! ## Author //! //! **Collins Muriuki** //! //! ## License //! This project is MIT licensed mod client; pub mod constants; pub mod environment; pub mod mpesa_security; pub mod payloads; pub use client::Mpesa; pub use constants::{CommandId, IdentifierTypes}; pub use environment::Environment; pub use mpesa_security::MpesaSecurity; pub use payloads::ResponseType;