GitHub PullRequestReviewCommentEvent at 2014-12-19 01:04:44
Repository: stripe-php
Actor: bkrausz
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/stripe/stripe-php/pulls/comments/22084213","id":22084213,"diff_hunk":"@@ -91,37 +92,44 @@ private static function _validateCall($method, $params=null, $apiKey=null)\n       throw new Stripe_Error($message);\n     }\n \n-    if ($apiKey && !is_string($apiKey)) {\n+    if ($options && (!is_string($options) && !is_array($options))) {\n       $message = 'The second argument to Stripe API method calls is an '\n-               . 'optional per-request apiKey, which must be a string.  '\n+               . 'optional per-request apiKey, which must be a string, or '\n+               . 'per-request options, which must be an array. '\n                . '(HINT: you can set a global apiKey by '\n                . '\"Stripe::setApiKey(<apiKey>)\")';\n       throw new Stripe_Error($message);\n     }\n   }\n \n-  protected static function _scopedAll($class, $params=null, $apiKey=null)\n+  protected static function _scopedAll($class, $params=null, $options=null)\n   {\n-    self::_validateCall('all', $params, $apiKey);\n-    $requestor = new Stripe_ApiRequestor($apiKey);\n+    self::_validateCall('all', $params, $options);\n+    $opts = Stripe_RequestOptions::parse($options);\n+    $requestor = new Stripe_ApiRequestor($opts->apiKey);\n     $url = self::_scopedLsb($class, 'classUrl', $class);\n-    list($response, $apiKey) = $requestor->request('get', $url, $params);\n-    return Stripe_Util::convertToStripeObject($response, $apiKey);\n+    list($response, $apiKey) = \n+      $requestor->request('get', $url, $params, $opts->headers);\n+    return Stripe_Util::convertToStripeObject($response, $opts->apiKey);","path":"lib/Stripe/ApiResource.php","position":51,"original_position":51,"commit_id":"9174873246e791cec38ae2927804d465af9bd339","original_commit_id":"9174873246e791cec38ae2927804d465af9bd339","user":{"login":"bkrausz","id":364070,"avatar_url":"https://avatars.githubusercontent.com/u/364070?v=3","gravatar_id":"","url":"https://api.github.com/users/bkrausz","html_url":"https://github.com/bkrausz","followers_url":"https://api.github.com/users/bkrausz/followers","following_url":"https://api.github.com/users/bkrausz/following{/other_user}","gists_url":"https://api.github.com/users/bkrausz/gists{/gist_id}","starred_url":"https://api.github.com/users/bkrausz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkrausz/subscriptions","organizations_url":"https://api.github.com/users/bkrausz/orgs","repos_url":"https://api.github.com/users/bkrausz/repos","events_url":"https://api.github.com/users/bkrausz/events{/privacy}","received_events_url":"https://api.github.com/users/bkrausz/received_events","type":"User","site_admin":false},"body":"This should be the old apiKey, since `$requestor->request` parses that out and returns it.","created_at":"2014-12-19T01:04:44Z","updated_at":"2014-12-19T01:04:44Z","html_url":"https://github.com/stripe/stripe-php/pull/117#discussion_r22084213","pull_request_url":"https://api.github.com/repos/stripe/stripe-php/pulls/117","_links":{"self":{"href":"https://api.github.com/repos/stripe/stripe-php/pulls/comments/22084213"},"html":{"href":"https://github.com/stripe/stripe-php/pull/117#discussion_r22084213"},"pull_request":{"href":"https://api.github.com/repos/stripe/stripe-php/pulls/117"}}},"pull_request":{"url":"https://api.github.com/repos/stripe/stripe-php/pulls/117","id":26280405,"html_url":"https://github.com/stripe/stripe-php/pull/117","diff_url":"https://github.com/stripe/stripe-php/pull/117.diff","patch_url":"https://github.com/stripe/stripe-php/pull/117.patch","issue_url":"https://api.github.com/repos/stripe/stripe-php/issues/117","number":117,"state":"open","locked":false,"title":"first attempt at passing in headers","user":{"login":"kyleconroy","id":34893,"avatar_url":"https://avatars.githubusercontent.com/u/34893?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleconroy","html_url":"https://github.com/kyleconroy","followers_url":"https://api.github.com/users/kyleconroy/followers","following_url":"https://api.github.com/users/kyleconroy/following{/other_user}","gists_url":"https://api.github.com/users/kyleconroy/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleconroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleconroy/subscriptions","organizations_url":"https://api.github.com/users/kyleconroy/orgs","repos_url":"https://api.github.com/users/kyleconroy/repos","events_url":"https://api.github.com/users/kyleconroy/events{/privacy}","received_events_url":"https://api.github.com/users/kyleconroy/received_events","type":"User","site_admin":false},"body":"WIP not ready\r\n","created_at":"2014-12-18T06:36:44Z","updated_at":"2014-12-19T01:04:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad640bcceacb8e03a246f71b495d3844b4b3d0c5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stripe/stripe-php/pulls/117/commits","review_comments_url":"https://api.github.com/repos/stripe/stripe-php/pulls/117/comments","review_comment_url":"https://api.github.com/repos/stripe/stripe-php/pulls/comments/{number}","comments_url":"https://api.github.com/repos/stripe/stripe-php/issues/117/comments","statuses_url":"https://api.github.com/repos/stripe/stripe-php/statuses/9174873246e791cec38ae2927804d465af9bd339","head":{"label":"stripe:per-request-options","ref":"per-request-options","sha":"9174873246e791cec38ae2927804d465af9bd339","user":{"login":"stripe","id":856813,"avatar_url":"https://avatars.githubusercontent.com/u/856813?v=3","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"repo":{"id":1953386,"name":"stripe-php","full_name":"stripe/stripe-php","owner":{"login":"stripe","id":856813,"avatar_url":"https://avatars.githubusercontent.com/u/856813?v=3","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stripe/stripe-php","description":"Stripe PHP bindings","fork":false,"url":"https://api.github.com/repos/stripe/stripe-php","forks_url":"https://api.github.com/repos/stripe/stripe-php/forks","keys_url":"https://api.github.com/repos/stripe/stripe-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stripe/stripe-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stripe/stripe-php/teams","hooks_url":"https://api.github.com/repos/stripe/stripe-php/hooks","issue_events_url":"https://api.github.com/repos/stripe/stripe-php/issues/events{/number}","events_url":"https://api.github.com/repos/stripe/stripe-php/events","assignees_url":"https://api.github.com/repos/stripe/stripe-php/assignees{/user}","branches_url":"https://api.github.com/repos/stripe/stripe-php/branches{/branch}","tags_url":"https://api.github.com/repos/stripe/stripe-php/tags","blobs_url":"https://api.github.com/repos/stripe/stripe-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stripe/stripe-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stripe/stripe-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/stripe/stripe-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stripe/stripe-php/statuses/{sha}","languages_url":"https://api.github.com/repos/stripe/stripe-php/languages","stargazers_url":"https://api.github.com/repos/stripe/stripe-php/stargazers","contributors_url":"https://api.github.com/repos/stripe/stripe-php/contributors","subscribers_url":"https://api.github.com/repos/stripe/stripe-php/subscribers","subscription_url":"https://api.github.com/repos/stripe/stripe-php/subscription","commits_url":"https://api.github.com/repos/stripe/stripe-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/stripe/stripe-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/stripe/stripe-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/stripe/stripe-php/issues/comments/{number}","contents_url":"https://api.github.com/repos/stripe/stripe-php/contents/{+path}","compare_url":"https://api.github.com/repos/stripe/stripe-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stripe/stripe-php/merges","archive_url":"https://api.github.com/repos/stripe/stripe-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stripe/stripe-php/downloads","issues_url":"https://api.github.com/repos/stripe/stripe-php/issues{/number}","pulls_url":"https://api.github.com/repos/stripe/stripe-php/pulls{/number}","milestones_url":"https://api.github.com/repos/stripe/stripe-php/milestones{/number}","notifications_url":"https://api.github.com/repos/stripe/stripe-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stripe/stripe-php/labels{/name}","releases_url":"https://api.github.com/repos/stripe/stripe-php/releases{/id}","created_at":"2011-06-25T19:52:24Z","updated_at":"2014-12-18T19:50:46Z","pushed_at":"2014-12-19T00:33:34Z","git_url":"git://github.com/stripe/stripe-php.git","ssh_url":"git@github.com:stripe/stripe-php.git","clone_url":"https://github.com/stripe/stripe-php.git","svn_url":"https://github.com/stripe/stripe-php","homepage":"https://stripe.com","size":1858,"stargazers_count":532,"watchers_count":532,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":126,"mirror_url":null,"open_issues_count":7,"forks":126,"open_issues":7,"watchers":532,"default_branch":"master"}},"base":{"label":"stripe:master","ref":"master","sha":"a2a21885c0d602895c9578b6d2b0a1ff63dc376e","user":{"login":"stripe","id":856813,"avatar_url":"https://avatars.githubusercontent.com/u/856813?v=3","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"repo":{"id":1953386,"name":"stripe-php","full_name":"stripe/stripe-php","owner":{"login":"stripe","id":856813,"avatar_url":"https://avatars.githubusercontent.com/u/856813?v=3","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stripe/stripe-php","description":"Stripe PHP bindings","fork":false,"url":"https://api.github.com/repos/stripe/stripe-php","forks_url":"https://api.github.com/repos/stripe/stripe-php/forks","keys_url":"https://api.github.com/repos/stripe/stripe-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stripe/stripe-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stripe/stripe-php/teams","hooks_url":"https://api.github.com/repos/stripe/stripe-php/hooks","issue_events_url":"https://api.github.com/repos/stripe/stripe-php/issues/events{/number}","events_url":"https://api.github.com/repos/stripe/stripe-php/events","assignees_url":"https://api.github.com/repos/stripe/stripe-php/assignees{/user}","branches_url":"https://api.github.com/repos/stripe/stripe-php/branches{/branch}","tags_url":"https://api.github.com/repos/stripe/stripe-php/tags","blobs_url":"https://api.github.com/repos/stripe/stripe-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stripe/stripe-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stripe/stripe-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/stripe/stripe-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stripe/stripe-php/statuses/{sha}","languages_url":"https://api.github.com/repos/stripe/stripe-php/languages","stargazers_url":"https://api.github.com/repos/stripe/stripe-php/stargazers","contributors_url":"https://api.github.com/repos/stripe/stripe-php/contributors","subscribers_url":"https://api.github.com/repos/stripe/stripe-php/subscribers","subscription_url":"https://api.github.com/repos/stripe/stripe-php/subscription","commits_url":"https://api.github.com/repos/stripe/stripe-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/stripe/stripe-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/stripe/stripe-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/stripe/stripe-php/issues/comments/{number}","contents_url":"https://api.github.com/repos/stripe/stripe-php/contents/{+path}","compare_url":"https://api.github.com/repos/stripe/stripe-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stripe/stripe-php/merges","archive_url":"https://api.github.com/repos/stripe/stripe-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stripe/stripe-php/downloads","issues_url":"https://api.github.com/repos/stripe/stripe-php/issues{/number}","pulls_url":"https://api.github.com/repos/stripe/stripe-php/pulls{/number}","milestones_url":"https://api.github.com/repos/stripe/stripe-php/milestones{/number}","notifications_url":"https://api.github.com/repos/stripe/stripe-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stripe/stripe-php/labels{/name}","releases_url":"https://api.github.com/repos/stripe/stripe-php/releases{/id}","created_at":"2011-06-25T19:52:24Z","updated_at":"2014-12-18T19:50:46Z","pushed_at":"2014-12-19T00:33:34Z","git_url":"git://github.com/stripe/stripe-php.git","ssh_url":"git@github.com:stripe/stripe-php.git","clone_url":"https://github.com/stripe/stripe-php.git","svn_url":"https://github.com/stripe/stripe-php","homepage":"https://stripe.com","size":1858,"stargazers_count":532,"watchers_count":532,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":126,"mirror_url":null,"open_issues_count":7,"forks":126,"open_issues":7,"watchers":532,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stripe/stripe-php/pulls/117"},"html":{"href":"https://github.com/stripe/stripe-php/pull/117"},"issue":{"href":"https://api.github.com/repos/stripe/stripe-php/issues/117"},"comments":{"href":"https://api.github.com/repos/stripe/stripe-php/issues/117/comments"},"review_comments":{"href":"https://api.github.com/repos/stripe/stripe-php/pulls/117/comments"},"review_comment":{"href":"https://api.github.com/repos/stripe/stripe-php/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/stripe/stripe-php/pulls/117/commits"},"statuses":{"href":"https://api.github.com/repos/stripe/stripe-php/statuses/9174873246e791cec38ae2927804d465af9bd339"}}}}