From faf84198c687154ba269d56ba23a6e6b769f7dea Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Fri, 4 Jun 2021 12:35:25 -0400 Subject: [PATCH] API Updates (#981) --- .travis.yml | 2 +- lib/stripe/object_types.rb | 1 + lib/stripe/resources.rb | 1 + lib/stripe/resources/tax_code.rb | 10 ++++++++++ test/stripe/tax_code_test.rb | 20 ++++++++++++++++++++ test/test_helper.rb | 2 +- 6 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 lib/stripe/resources/tax_code.rb create mode 100644 test/stripe/tax_code_test.rb diff --git a/.travis.yml b/.travis.yml index 976e144a..5e2f355e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ notifications: env: global: # If changing this number, please also change it in `test/test_helper.rb`. - - STRIPE_MOCK_VERSION=0.105.0 + - STRIPE_MOCK_VERSION=0.106.0 cache: directories: diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 58d0cf93..ab974e58 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -84,6 +84,7 @@ module Stripe Subscription::OBJECT_NAME => Subscription, SubscriptionItem::OBJECT_NAME => SubscriptionItem, SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule, + TaxCode::OBJECT_NAME => TaxCode, TaxId::OBJECT_NAME => TaxId, TaxRate::OBJECT_NAME => TaxRate, Terminal::ConnectionToken::OBJECT_NAME => Terminal::ConnectionToken, diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index 50dae4fb..2f40b080 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -73,6 +73,7 @@ require "stripe/resources/source_transaction" require "stripe/resources/subscription" require "stripe/resources/subscription_item" require "stripe/resources/subscription_schedule" +require "stripe/resources/tax_code" require "stripe/resources/tax_id" require "stripe/resources/tax_rate" require "stripe/resources/terminal/connection_token" diff --git a/lib/stripe/resources/tax_code.rb b/lib/stripe/resources/tax_code.rb new file mode 100644 index 00000000..f3e27d98 --- /dev/null +++ b/lib/stripe/resources/tax_code.rb @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + class TaxCode < APIResource + extend Stripe::APIOperations::List + + OBJECT_NAME = "tax_code" + end +end diff --git a/test/stripe/tax_code_test.rb b/test/stripe/tax_code_test.rb new file mode 100644 index 00000000..fc56e1b5 --- /dev/null +++ b/test/stripe/tax_code_test.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require ::File.expand_path("../test_helper", __dir__) + +module Stripe + class TaxCodeTest < Test::Unit::TestCase + should "be listable" do + tax_codes = Stripe::TaxCode.list + assert_requested :get, "#{Stripe.api_base}/v1/tax_codes" + assert tax_codes.data.is_a?(Array) + assert tax_codes.first.is_a?(Stripe::TaxCode) + end + + should "be retrievable" do + tax_code = Stripe::TaxCode.retrieve("txcd_123") + assert_requested :get, "#{Stripe.api_base}/v1/tax_codes/txcd_123" + assert tax_code.is_a?(Stripe::TaxCode) + end + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb index 13a0956f..ee5b6660 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -13,7 +13,7 @@ require ::File.expand_path("test_data", __dir__) require ::File.expand_path("stripe_mock", __dir__) # If changing this number, please also change it in `.travis.yml`. -MOCK_MINIMUM_VERSION = "0.105.0" +MOCK_MINIMUM_VERSION = "0.106.0" MOCK_PORT = Stripe::StripeMock.start # Disable all real network connections except those that are outgoing to