Closed jezzsantos closed 5 months ago
This is still an issue, we need a way to overrride the ApiBaseUrl so we can use a tool like WireMock to stub out the responses when writing unit tests.
Hi @jezzsantos, we have included this in version v3.12.1
please upgrade our package to >=v3.12.1
. After that You will be able to set base URL in the following way, ApiConfig.SetBaseUrl("https://test-url.cargebee.com/api/v2");
Please let us know if this is not working for you.
Hi @jezzsantos — can you confirm if this is working for you in v3.12.1 or later?
Hi @jezzsantos, I'm closing this issue for now. Please open a new one if you're still facing this issue. Thanks.
Sorry @cb-sriramthiagarajan, thanks you heaps for putting this in the product. I've been delayed implementing this for some weeks now. Hope to get there in the coming month, to verify.
No worries @jezzsantos. Let us know how it goes 🙌
We want to redirect this client library to use our own Stub (that simulates chargebee.com) when we are running locally (ie manual testing), so that we are not hitting chargebee.com.
Most other client libraries (eg Stripe) allow use to re-define the
BaseUrl
that their client uses, so that we can achieve this. However, this library does not allow us to do that.Examining this:
https://github.com/chargebee/chargebee-dotnet/blob/afd9f77e9e2cbb819b7e0ef529b71e6eb65341e2/ChargeBee/Api/ApiConfig.cs#L20
It appears that we can change the
ApiConfig.Site
and theApiConfig.DomainSuffix
but these are still concatenated together with a '.', and the/api
part and version are enforced, but what we really need to do is set the ApiBaseUrl to something like:https://localhost:5656/chargebee
(where 5656 is the port of our stubservices).Is it possible to change
ApiConfig
in some way to allow us to set:ApiConfig.ApiBaseUrl = https://localhost:5656/chargebee
?