morukele / paystack-rs

A Rust wrapper for the Paystack API
https://crates.io/crates/paystack-rs
MIT License
14 stars 5 forks source link

added get and post functions to reduce repetition #8

Closed morukele closed 1 year ago

morukele commented 1 year ago

Added get_request and post_request methods to the API client class. These functions are private to the client.

The logic behind this decision is that there is a lot of repetition of either post or get requests in the different methods of the API client. This has the potential to cause cumbersome error-handling issues from the HTTP request, thus having them in their specific method limits the error handling to just those methods.

This change also makes the maintenance of the client easier in the long run.