-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operators #28
Operators #28
Conversation
No more commits, should be ready for your review. Feel free to close if you have reservations about the PR. Thanks once again for an amazing package 👏 |
Nice work man. I like the idea of the abstraction and supporting multiple providers as well. Why leave the test for us to write though 😂. Just joking |
Thanks buddy for the kind words. I had the feeling that tests were incomplete at the time of writing the comment but has since improved the situation with 6384581 and are open to add tests for any uncovered areas. |
Thanks, @SamuelMwangiW for your contribution. However, I would like to remove implementations for operators in the library to prevent us from having to maintain that in the future. Since this is not a major version, I would like for us to prevent making changes to the config file. I would therefor merge this to a different branch and do the changes and let you review if you are okay with it. |
Thanks @cybersai for your review. |
Thanks, @SamuelMwangiW, you can check #29 and submit your comments. |
Thanks for the amazing work 👏🏽.
This PR proposes to introduce an decorator pattern to customize the request and response parameters to suit each service provider.
Am also not sure of the names and went Operator as you call them operators in the docs. I was also unsure interface method name therefore I welcome suggestions besides
decorate
.This allows the developer to define their operator in the config the init the machine in the controller as the docs and everything just works TM.
The Operator only needs to implement
Sparors\Ussd\Contracts\OperatorContract::class
. Samples from #22 (comment) are provided but the developer is at liberty to use their own.If properly set, the following should just workTM.
This has the added benefit that the same code can be used for different providers and the configured provider is dynamically set in say a middleware 💪
Tests might need to improvement therefore any help is welcome.
Once approved, kindly squash merge 😜