Skip to content

Commit

Permalink
Adds support for 'partner_id' in 'set_app_info'
Browse files Browse the repository at this point in the history
Signed-off-by: zach wick <[email protected]>
  • Loading branch information
zwick-stripe committed Jun 28, 2018
1 parent 89d1994 commit 15029ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/stripe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
2 changes: 2 additions & 0 deletions test/stripe/stripe_client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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])
Expand Down
2 changes: 2 additions & 0 deletions test/stripe_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 15029ff

Please sign in to comment.