mpesa 0.0.1

A wrapper around the M-PESA API in Rust.
Documentation
mpesa-0.0.1 has been yanked.

A Rust wrapper around the Safaricom API for accessing M-Pesa services. Currently, a work in progress project.

Notes

Do not use in production yet, still in development

RoadMap

  • Create Mpesa Client struct
  • Implement Auth
  • Error handling
  • Generate security credentials
  • Implement B2C payment
  • Query transaction status
  • Simulate C2B Payment
  • Query status of Lipa na M-Pesa
  • Initiate Lipa na M-Pesa online w/ STK push
  • Register C2B Confirmation and Validation URLs
  • Integration tests
  • Rewrite in async
  • Publish on https://crates.io
  • Setup travis-ci

Install & Usage

In your Cargo.toml file:

[dependencies]
mpesa = "0.0.1"

In your lib or binary crate:

extern crate mpesa;

use mpesa::Mpesa;

Examples

Use dotenv crate to store your keys as environmental variables instead of hard coding them like done in the example below.

use mpesa::{Mpesa, Environment};

let client = Mpesa::new(
      String::from("your_client_key"),
      String::from("your_client_secret"),
      Environment::Sandbox,
      String::from("your_initiator_password"),
);

Author

Collins Muriuki

Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

License

Copyright © 2020 Collins Muriuki. This project is MIT licensed.