Skip to content

Commit

Permalink
fix: url override replaces site (PL-000) (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
trs committed Dec 11, 2023
1 parent 8bf491a commit 76438ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/chargebee.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class ChargebeeService extends ChargebeeResourceWrapper {
function configureChargebee(options: ChargebeeModuleOptions) {
const client = new ChargeBee();
client.configure({
site: options.site,
site: options.override?.url ? "" : options.site,
api_key: options.apiKey,
...(options.override?.url ? extractURLOptions(options.override.url) : {}),
...(options.override?.timeout ? { timeout: options.override.timeout } : {}),
Expand All @@ -32,7 +32,7 @@ function extractURLOptions(urlStr: string) {
const url = new URL(urlStr);

return {
hostSuffix: "." + url.host,
hostSuffix: url.host,
apiPath: url.pathname,
protocol: url.protocol.replace(":", ""),
port: url.port,
Expand Down

0 comments on commit 76438ae

Please sign in to comment.