Skip to content
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

Would you accept a contribution with redesigned client? #50

Open
Wojciechem opened this issue Apr 24, 2023 · 7 comments
Open

Would you accept a contribution with redesigned client? #50

Wojciechem opened this issue Apr 24, 2023 · 7 comments

Comments

@Wojciechem
Copy link
Contributor

Hello Chargebee,

We've been having problems testing the client API provided with the Chargebee SDK, and for the past few meetings we've been thinking about modernizing the code to make it more testable.

It would greatly improve our experience of integrating with Chargebee. Currently we implement the required abstraction in our code, but the possibilities are limited this way. We feel that improving the open source client is more future-proof and beneficial than re-writing the API integration on our side.

Main points we would like to address with such redesign are:

  • using dependency inversion and PSR-18 abstraction over http client
  • ability to inject a mock http client, in order to simulate different types of network errors / responses

Would you be interested in such a contribution?

@Wojciechem
Copy link
Contributor Author

Wojciechem commented Apr 25, 2023

As an example of a nice library design we would like to achieve: https://github.com/mailgun/mailgun-php

@Arminek
Copy link

Arminek commented Jul 12, 2023

Hello Chargebee maintainers,

@cb-yateshmathuria @cb-khushbubibay Do you have any thoughts about this?

@cb-khushbubibay
Copy link
Contributor

Hi @Wojciechem @Arminek
Thank you for raising this concern. We sincerely appreciate your input. If it's possible, could you please create a forked repository and raise a pull request with the suggested changes? This way, we can check its feasibility and review the modifications.

@yched
Copy link

yched commented Aug 10, 2023

Very interested in this as well, we need to inject a custom HTTP client.
For now we will go with a simple fork that allows us to inject a custom Guzzle handler stack of middewares, but ideally the Chargebee library would accept a PSR-18 client as suggested in the OP.

@Wojciechem
Copy link
Contributor Author

Apologies, I did not have the capacity to look at it yet, but I will try to work on the fork next week :)

@Wojciechem
Copy link
Contributor Author

Not a proper redesign, but I made some refactoring to address the points from my issue.
It should also help other use-cases like customizing request headers / specific http client configuration.
CC @cb-khushbubibay

@Wojciechem
Copy link
Contributor Author

bump 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants