diff --git a/lib/stripe.rb b/lib/stripe.rb index 243fa8585..890c4a9bc 100644 --- a/lib/stripe.rb +++ b/lib/stripe.rb @@ -15,6 +15,7 @@ require "forwardable" # Version +require "stripe/api_version" require "stripe/version" # API operations diff --git a/lib/stripe/api_version.rb b/lib/stripe/api_version.rb new file mode 100644 index 000000000..b375f80fb --- /dev/null +++ b/lib/stripe/api_version.rb @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module ApiVersion + CURRENT = "2020-08-27" + end +end diff --git a/lib/stripe/stripe_configuration.rb b/lib/stripe/stripe_configuration.rb index 1fd94df05..0ef8e215a 100644 --- a/lib/stripe/stripe_configuration.rb +++ b/lib/stripe/stripe_configuration.rb @@ -63,6 +63,8 @@ def reverse_duplicate_merge(hash) end def initialize + @api_version = ApiVersion::CURRENT + @ca_bundle_path = Stripe::DEFAULT_CA_BUNDLE_PATH @enable_telemetry = true @verify_ssl_certs = true diff --git a/test/stripe/stripe_configuration_test.rb b/test/stripe/stripe_configuration_test.rb index 9f34293b3..fe8b8b006 100644 --- a/test/stripe/stripe_configuration_test.rb +++ b/test/stripe/stripe_configuration_test.rb @@ -20,7 +20,7 @@ class StripeConfigurationTest < Test::Unit::TestCase assert_equal "https://api.stripe.com", config.api_base assert_equal "https://connect.stripe.com", config.connect_base assert_equal "https://files.stripe.com", config.uploads_base - assert_equal nil, config.api_version + assert !config.api_version.nil? end should "allow for overrides when a block is passed" do