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

Conversation

anniel-stripe
Copy link
Contributor

@anniel-stripe anniel-stripe commented Nov 1, 2022

Summary

Remove deprecated configuration setter methods. Update tests that use these methods to set the corresponding property on the config object instead.

Changelog

  • Remove deprecated configuration setter methods (setHost, setProtocol, setPort, setApiVersion, setApiKey, setTimeout, setAppInfo, setHttpAgent, setMaxNetworkRetries, and setTelemetryEnabled). Use the config object to set these options instead, for example:
    const stripe = Stripe('sk_test_...', {
      apiVersion: '2019-08-08',
      maxNetworkRetries: 1,
      httpAgent: new ProxyAgent(process.env.http_proxy),
      timeout: 1000,
      host: 'api.example.com',
      port: 123,
      telemetry: true,
    });

test/stripe.spec.js Outdated Show resolved Hide resolved
@pakrym-stripe
Copy link
Contributor

Do you mind adding a code snippet to the changelog message that illustrates the new way?

@@ -1023,8 +1023,6 @@ describe('StripeResource', () => {

describe('Request Timeout', () => {
it('should allow the setting of a request timeout on a per-request basis', (done) => {
stripe.setTimeout(1000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why didn't this test start failing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tests that the request is sent with a timeout of 10 when configured as a per-request option

@anniel-stripe anniel-stripe merged commit 71f615b into sdk-release/next-major Nov 1, 2022
@anniel-stripe anniel-stripe deleted the anniel-remove-deprecated branch November 1, 2022 21:39
anniel-stripe added a commit that referenced this pull request Nov 16, 2022
* Update StripeSignatureVerificationError to accept header and payload strings

* Build

* Update supported runtime versions

* Remove Orders and subscription_data[items]

* Remove SKU resource

* Remove SKUs.spec.js

* Remove deprecated configuration setter methods (#1597)

* Remove deprecated config properties

* Update test and remove config properties from types/

* Remove setProtocol from types, refactor old tests

* Replace more require('../lib/stripe') with Stripe

* Remove global stripe from EphemeralKeys test

* Rename local stripe to newStripe in stripe.spec.js

* Refactor EphemeralKeys.spec.js

* Remove more deprecated items (#1600)

Remove remaining deprecated items

* Generate files for next major (#1603)

* Generate next major

* Deprecate StripeResource.path and related interfaces (#1604)

* Deprecate path

* More fully deprecate

* Fix linting errors

* Revert "Fix linting errors"

This reverts commit 68ac772.

* Revert "Deprecate StripeResource.path and related interfaces (#1604)"

This reverts commit 9c9de9e.

* fix tests to work without Invoices defining fullPAth

Co-authored-by: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com>
Co-authored-by: Richard Marmorstein <richardm@stripe.com>

* Update LatestApiVersion and types reference

* Update all references to latest API version

* Regenerate

* Latest API version

* fix tests

* Update API_VERSION and references

* Format

Co-authored-by: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com>
Co-authored-by: Richard Marmorstein <richardm@stripe.com>
Co-authored-by: Pavel Krymets <pakrym@stripe.com>
Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants