Skip to content

Commit

Permalink
Merge pull request #488 from stripe/zwick_partner_id_set_app_info
Browse files Browse the repository at this point in the history
Adds support for 'partner_id' to 'setAppInfo'
  • Loading branch information
ob-stripe authored Jun 28, 2018
2 parents e9b759f + 516c322 commit 8d3aa1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/Stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,13 @@ public static function getAppInfo()
* @param string $appVersion The application's version
* @param string $appUrl The application's URL
*/
public static function setAppInfo($appName, $appVersion = null, $appUrl = null)
public static function setAppInfo($appName, $appVersion = null, $appUrl = null, $appPartnerId = null)
{
self::$appInfo = self::$appInfo ?: [];
self::$appInfo['name'] = $appName;
self::$appInfo['version'] = $appVersion;
self::$appInfo['partner_id'] = $appPartnerId;
self::$appInfo['url'] = $appUrl;
self::$appInfo['version'] = $appVersion;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion tests/Stripe/ApiRequestorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testDefaultHeaders()
$method->setAccessible(true);

// no way to stub static methods with PHPUnit 4.x :(
Stripe::setAppInfo('MyTestApp', '1.2.34', 'https://mytestapp.example');
Stripe::setAppInfo('MyTestApp', '1.2.34', 'https://mytestapp.example', 'partner_1234');
$apiKey = 'sk_test_notarealkey';
$clientInfo = ['httplib' => 'testlib 0.1.2'];

Expand All @@ -67,6 +67,7 @@ public function testDefaultHeaders()
$this->assertSame($ua->application->name, 'MyTestApp');
$this->assertSame($ua->application->version, '1.2.34');
$this->assertSame($ua->application->url, 'https://mytestapp.example');
$this->assertSame($ua->application->partner_id, 'partner_1234');

$this->assertSame($ua->httplib, 'testlib 0.1.2');

Expand Down

0 comments on commit 8d3aa1a

Please sign in to comment.