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

Remove deprecated configuration setter methods #1597

Merged
merged 7 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 0 additions & 158 deletions lib/stripe.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

168 changes: 0 additions & 168 deletions src/stripe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,98 +178,6 @@ Stripe.createSubtleCryptoProvider = (subtleCrypto) => {
};

Stripe.prototype = {
/**
* @deprecated will be removed in a future major version. Use the config object instead:
*
* const stripe = new Stripe(API_KEY, {
* host: 'example.com',
* port: '8080',
* protocol: 'http',
* });
*
*/
setHost(host, port, protocol) {
emitWarning(
'`setHost` is deprecated. Use the `host` config option instead.'
);
this._setApiField('host', host);
if (port) {
this.setPort(port);
}
if (protocol) {
this.setProtocol(protocol);
}
},

/**
* @deprecated will be removed in a future major version. Use the config object instead:
*
* const stripe = new Stripe(API_KEY, {
* protocol: 'http',
* });
*
*/
setProtocol(protocol) {
emitWarning(
'`setProtocol` is deprecated. Use the `protocol` config option instead.'
);
this._setApiField('protocol', protocol.toLowerCase());
},

/**
* @deprecated will be removed in a future major version. Use the config object instead:
*
* const stripe = new Stripe(API_KEY, {
* port: 3000,
* });
*
*/
setPort(port) {
emitWarning(
'`setPort` is deprecated. Use the `port` config option instead.'
);
this._setApiField('port', port);
},

/**
* @deprecated will be removed in a future major version. Use the config object instead:
*
* const stripe = new Stripe(API_KEY, {
* apiVersion: API_VERSION,
* });
*
*/
setApiVersion(version) {
emitWarning(
'`setApiVersion` is deprecated. Use the `apiVersion` config or request option instead.'
);
if (version) {
this._setApiField('version', version);
}
},

/**
* @deprecated will be removed in a future major version. Use the config object instead:
*
* const stripe = new Stripe(API_KEY);
*
* Or, for Stripe Connect, use `stripeAccount` instead:
*
* const stripe = new Stripe(API_KEY, {
* stripeAccount: 'acct_...',
* });
*
* Or, to use a different apiKey on a given request:
*
* stripe.customers.create(params, {apiKey: 'sk_test_...'});
*/
setApiKey(key) {
emitWarning(
'`setApiKey` is deprecated. Use the `apiKey` request option instead.'
);
this._setApiKey(key);
},

/**
* @private
*/
Expand All @@ -279,39 +187,6 @@ Stripe.prototype = {
}
},

/**
* @deprecated will be removed in a future major version. Use the config object instead:
*
* const stripe = new Stripe(API_KEY, {
* timeout: TIMEOUT_MS,
* });
*/
setTimeout(timeout) {
emitWarning(
'`setTimeout` is deprecated. Use the `timeout` config or request option instead.'
);
this._setApiField('timeout', timeout == null ? DEFAULT_TIMEOUT : timeout);
},

/**
* @deprecated will be removed in a future major version. Use the config object instead:
*
* const stripe = new Stripe(API_KEY, {
* appInfo: {
* name: 'MyPlugin',
* version: '1.4.2',
* url: 'https://myplugin.com',
* partner_id: '1234',
* },
* });
*/
setAppInfo(info) {
emitWarning(
'`setAppInfo` is deprecated. Use the `appInfo` config option instead.'
);
this._setAppInfo(info);
},

/**
* @private
* This may be removed in the future.
Expand Down Expand Up @@ -343,22 +218,6 @@ Stripe.prototype = {
this._appInfo = appInfo;
},

/**
* @deprecated will be removed in a future major version. Use the config object instead:
*
* const ProxyAgent = require('https-proxy-agent');
* const stripe = new Stripe(API_KEY, {
* httpAgent: new ProxyAgent(process.env.http_proxy),
* });
*
*/
setHttpAgent(agent) {
emitWarning(
'`setHttpAgent` is deprecated. Use the `httpAgent` config option instead.'
);
this._setApiField('agent', agent);
},

/**
* @private
* This may be removed in the future.
Expand Down Expand Up @@ -417,18 +276,6 @@ Stripe.prototype = {
return this.getApiField('maxNetworkRetries');
},

/**
* @deprecated will be removed in a future major version. Use the config object instead:
*
* const stripe = new Stripe(API_KEY, {
* maxNetworkRetries: 2,
* });
*
*/
setMaxNetworkRetries(maxNetworkRetries) {
this._setApiNumberField('maxNetworkRetries', maxNetworkRetries);
},

/**
* @private
* This may be removed in the future.
Expand Down Expand Up @@ -533,21 +380,6 @@ Stripe.prototype = {
return formatted;
},

/**
* @deprecated will be removed in a future major version. Use the config object instead:
*
* const stripe = new Stripe(API_KEY, {
* telemetry: false,
* });
*
*/
setTelemetryEnabled(enableTelemetry) {
emitWarning(
'`setTelemetryEnabled` is deprecated. Use the `telemetry` config option instead.'
);
this._enableTelemetry = enableTelemetry;
},

getTelemetryEnabled() {
return this._enableTelemetry;
},
Expand Down
Loading