From 8bc64b1af9365d39e49ca24193282d56943b3f3e Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 3 Jun 2021 13:42:40 -0400 Subject: [PATCH 1/3] Codegen for openapi 1ad8d09 --- lib/stripe/object_types.rb | 1 + lib/stripe/resources.rb | 1 + lib/stripe/resources/tax_code.rb | 10 ++++++++++ 3 files changed, 12 insertions(+) create mode 100644 lib/stripe/resources/tax_code.rb diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 58d0cf938..ab974e58c 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -84,6 +84,7 @@ def self.object_names_to_classes 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 50dae4fbc..2f40b0801 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -73,6 +73,7 @@ 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 000000000..f3e27d981 --- /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 From 727c816e232d7b58bfbc454774fc9cf3ca9a3764 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 3 Jun 2021 23:27:08 -0400 Subject: [PATCH 2/3] Bump stripe-mock --- .travis.yml | 2 +- test/test_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 976e144af..5e2f355e9 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/test/test_helper.rb b/test/test_helper.rb index 13a0956f7..ee5b66608 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -13,7 +13,7 @@ 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 From 00fbd486ea4431f69437927c22ee25bdf9cbc2d2 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 3 Jun 2021 23:36:22 -0400 Subject: [PATCH 3/3] Test --- test/stripe/tax_code_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/stripe/tax_code_test.rb diff --git a/test/stripe/tax_code_test.rb b/test/stripe/tax_code_test.rb new file mode 100644 index 000000000..fc56e1b5c --- /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