From 65de86785fddf8fea267094535396cabac9ca070 Mon Sep 17 00:00:00 2001 From: zach wick Date: Wed, 27 Jun 2018 12:02:19 -0400 Subject: [PATCH] Adds support for an optional 'partner_id' parameter in 'setAppInfo' --- lib/stripe.js | 2 +- test/stripe.spec.js | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/stripe.js b/lib/stripe.js index 9e5b564d67..edbdd54284 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -21,7 +21,7 @@ Stripe.USER_AGENT = { Stripe.USER_AGENT_SERIALIZED = null; -var APP_INFO_PROPERTIES = ['name', 'version', 'url']; +var APP_INFO_PROPERTIES = ['name', 'version', 'url', 'partner_id']; var EventEmitter = require('events').EventEmitter; var exec = require('child_process').exec; diff --git a/test/stripe.spec.js b/test/stripe.spec.js index b307fa13b6..b8ec572b90 100644 --- a/test/stripe.spec.js +++ b/test/stripe.spec.js @@ -96,7 +96,7 @@ describe('Stripe Module', function() { }); describe('when given at least a `name`', function() { - it('should set name, version and url of stripe._appInfo', function() { + it('should set name, partner ID, url, and version of stripe._appInfo', function() { stripe.setAppInfo({ name: 'MyAwesomeApp', }); @@ -121,17 +121,29 @@ describe('Stripe Module', function() { name: 'MyAwesomeApp', url: 'https://myawesomeapp.info', }); + + stripe.setAppInfo({ + name: 'MyAwesomeApp', + partner_id: 'partner_1234', + }); + expect(stripe._appInfo).to.eql({ + name: 'MyAwesomeApp', + partner_id: 'partner_1234', + }); + }); it('should ignore any invalid properties', function() { stripe.setAppInfo({ name: 'MyAwesomeApp', + partner_id: 'partner_1234', version: '1.2.345', url: 'https://myawesomeapp.info', countOfRadishes: 512, }); expect(stripe._appInfo).to.eql({ name: 'MyAwesomeApp', + partner_id: 'partner_1234', version: '1.2.345', url: 'https://myawesomeapp.info', });