chargebee / chargebee-php

PHP library for the Chargebee API.

Home Page:https://apidocs.chargebee.com/docs/api?lang=php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Would you accept a contribution with redesigned client?

Wojciechem opened this issue · comments

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?

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

Hello Chargebee maintainers,

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

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.

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.

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

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

bump 😉