c12i / mpesa-rust

A MPESA API sdk in Rust
https://c12i.github.io/mpesa-rust/mpesa/index.html
MIT License
44 stars 16 forks source link

Employ builder pattern #22

Closed c12i closed 3 years ago

c12i commented 3 years ago

Will prevent passing of many function parameters to Client methods.

For each service, we will need a builder struct. The builder struct will have adaptor methods that basically accept mut self as a parameter, and return self on transforming the data.

The builder consumer method will build the main struct and perform the necessary api call