From 15029ff6cb07a7e5ef3258d3829eec4975214efa Mon Sep 17 00:00:00 2001 From: zach wick Date: Fri, 15 Jun 2018 12:43:04 -0400 Subject: [PATCH 1/2] Adds support for 'partner_id' in 'set_app_info' Signed-off-by: zach wick --- lib/stripe.rb | 5 +++-- test/stripe/stripe_client_test.rb | 2 ++ test/stripe_test.rb | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/stripe.rb b/lib/stripe.rb index e5732d19f..593dd69bf 100644 --- a/lib/stripe.rb +++ b/lib/stripe.rb @@ -212,10 +212,11 @@ def self.max_network_retries=(val) # with API requests. Useful for plugin authors to identify their plugin when # communicating with Stripe. # - # Takes a name and optional version and plugin URL. - def self.set_app_info(name, version: nil, url: nil) + # Takes a name and optional partner program ID, plugin URL, and version. + def self.set_app_info(name, partner_id: nil, url: nil, version: nil) @app_info = { name: name, + partner_id: partner_id, url: url, version: version, } diff --git a/test/stripe/stripe_client_test.rb b/test/stripe/stripe_client_test.rb index c9ef34359..dd62555c7 100644 --- a/test/stripe/stripe_client_test.rb +++ b/test/stripe/stripe_client_test.rb @@ -345,6 +345,7 @@ class StripeClientTest < Test::Unit::TestCase old = Stripe.app_info Stripe.set_app_info( "MyAwesomePlugin", + partner_id: "partner_1234", url: "https://myawesomeplugin.info", version: "1.2.34" ) @@ -361,6 +362,7 @@ class StripeClientTest < Test::Unit::TestCase assert_equal({ name: "MyAwesomePlugin", + partner_id: "partner_1234", url: "https://myawesomeplugin.info", version: "1.2.34", }, data[:application]) diff --git a/test/stripe_test.rb b/test/stripe_test.rb index 571a8ac88..c3a1d5901 100644 --- a/test/stripe_test.rb +++ b/test/stripe_test.rb @@ -21,11 +21,13 @@ class StripeTest < Test::Unit::TestCase old = Stripe.app_info Stripe.set_app_info( "MyAwesomePlugin", + partner_id: "partner_1234", url: "https://myawesomeplugin.info", version: "1.2.34" ) assert_equal({ name: "MyAwesomePlugin", + partner_id: "partner_1234", url: "https://myawesomeplugin.info", version: "1.2.34", }, Stripe.app_info) From 389d1b41c9c0204deaee99787f7b4c2a77fff9c2 Mon Sep 17 00:00:00 2001 From: zach wick Date: Thu, 28 Jun 2018 11:03:37 -0400 Subject: [PATCH 2/2] Updates rubocop configuration Signed-off-by: zach wick --- .rubocop_todo.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ca8e415ce..242ac7659 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2018-02-23 14:17:07 +0100 using RuboCop version 0.50.0. +# on 2018-06-28 10:59:56 -0400 using RuboCop version 0.50.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -13,18 +13,18 @@ Metrics/AbcSize: # Offense count: 27 # Configuration parameters: CountComments, ExcludedMethods. Metrics/BlockLength: - Max: 496 + Max: 498 # Offense count: 8 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 624 + Max: 626 # Offense count: 11 Metrics/CyclomaticComplexity: Max: 15 -# Offense count: 259 +# Offense count: 269 # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Metrics/LineLength: @@ -55,6 +55,6 @@ Style/ClassVars: - 'lib/stripe/stripe_object.rb' - 'test/stripe/api_resource_test.rb' -# Offense count: 53 +# Offense count: 55 Style/Documentation: Enabled: false