{"action":"created","comment":{"url":"https://api.github.com/repos/recurly/recurly-client-php/pulls/comments/74662884","id":74662884,"diff_hunk":"@@ -62,6 +62,7 @@ class Recurly_Client\n   const PATH_COUPON_REDEMPTION = '/redemption';\n   const PATH_COUPON_REDEMPTIONS = '/redemptions';\n   const PATH_COUPONS = '/coupons';\n+  const PATH_GIFT_CARDS = '/gift_cards';","path":"lib/recurly/client.php","position":13,"original_position":13,"commit_id":"104b96a334e4b388270953ba0eca1d09776b71d1","original_commit_id":"104b96a334e4b388270953ba0eca1d09776b71d1","user":{"login":"bhelx","id":185919,"avatar_url":"https://avatars.githubusercontent.com/u/185919?v=3","gravatar_id":"","url":"https://api.github.com/users/bhelx","html_url":"https://github.com/bhelx","followers_url":"https://api.github.com/users/bhelx/followers","following_url":"https://api.github.com/users/bhelx/following{/other_user}","gists_url":"https://api.github.com/users/bhelx/gists{/gist_id}","starred_url":"https://api.github.com/users/bhelx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhelx/subscriptions","organizations_url":"https://api.github.com/users/bhelx/orgs","repos_url":"https://api.github.com/users/bhelx/repos","events_url":"https://api.github.com/users/bhelx/events{/privacy}","received_events_url":"https://api.github.com/users/bhelx/received_events","type":"User","site_admin":false},"body":"What do you think the original intention was? Keeping them all in one place? Could they be referenced from different classes? It seems to me like it's better for the endpoint to live with the class responsible for maintaining it. It would be nice to understand why this was done though. I'm cool with changing it if you can't think of a reason why it should stay like this.","created_at":"2016-08-12T21:26:05Z","updated_at":"2016-08-12T21:26:05Z","html_url":"https://github.com/recurly/recurly-client-php/pull/261#discussion_r74662884","pull_request_url":"https://api.github.com/repos/recurly/recurly-client-php/pulls/261","_links":{"self":{"href":"https://api.github.com/repos/recurly/recurly-client-php/pulls/comments/74662884"},"html":{"href":"https://github.com/recurly/recurly-client-php/pull/261#discussion_r74662884"},"pull_request":{"href":"https://api.github.com/repos/recurly/recurly-client-php/pulls/261"}}},"pull_request":{"url":"https://api.github.com/repos/recurly/recurly-client-php/pulls/261","id":80534618,"html_url":"https://github.com/recurly/recurly-client-php/pull/261","diff_url":"https://github.com/recurly/recurly-client-php/pull/261.diff","patch_url":"https://github.com/recurly/recurly-client-php/pull/261.patch","issue_url":"https://api.github.com/repos/recurly/recurly-client-php/issues/261","number":261,"state":"open","locked":false,"title":"Gift card support","user":{"login":"bhelx","id":185919,"avatar_url":"https://avatars.githubusercontent.com/u/185919?v=3","gravatar_id":"","url":"https://api.github.com/users/bhelx","html_url":"https://github.com/bhelx","followers_url":"https://api.github.com/users/bhelx/followers","following_url":"https://api.github.com/users/bhelx/following{/other_user}","gists_url":"https://api.github.com/users/bhelx/gists{/gist_id}","starred_url":"https://api.github.com/users/bhelx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhelx/subscriptions","organizations_url":"https://api.github.com/users/bhelx/orgs","repos_url":"https://api.github.com/users/bhelx/repos","events_url":"https://api.github.com/users/bhelx/events{/privacy}","received_events_url":"https://api.github.com/users/bhelx/received_events","type":"User","site_admin":false},"body":"# Usage\r\n\r\n```php\r\n$giftCard = new Recurly_GiftCard();\r\n$giftCard->product_code = 'test_gift_card';\r\n$giftCard->currency = 'USD';\r\n$giftCard->unit_amount_in_cents = 2000;\r\n$giftCard->gifter_account = new Recurly_Account('RI5THpFRhh');\r\n$giftCard->delivery = new Recurly_Delivery();\r\n$giftCard->delivery->email_address = 'john.smith@example.com';\r\n$giftCard->delivery->first_name = 'John';\r\n$giftCard->delivery->last_name = 'Smith';\r\n$giftCard->delivery->personal_message= 'Hey from sally';\r\n$giftCard->delivery->gifter_name = 'Sally';\r\n$giftCard->delivery->method = 'email'; //email or post\r\n\r\n// once everything is loaded, we can do a preview\r\n$giftCard->preview();\r\n\r\n// or a purchase (create)\r\n$giftCard->create();\r\n\r\nprint $giftCard;\r\n\r\n/*\r\n<Recurly_GiftCard[new] created_at=\"2016-08-09 16:54:06 +00:00\", currency=\"USD\", \r\n  delivery=\"<Recurly_Delivery[new] email_address=\"john.smith@example.com\", \r\n  first_name=\"John\", gifter_name=\"Sally\", last_name=\"Smith\", method=\"email\", \r\n  personal_message=\"Hey from sally\">\", gifter_account=<Recurly_Stub[gifter_account] \r\n  href=https://api.recurly.com/v2/accounts/RI5THpFRhh>, \r\n  id=2013212623260209317, invoice=<Recurly_Stub[invoice] \r\n  href=https://api.recurly.com/v2/invoices/1189>, product_code=\"test_gift_card\", \r\n  redemption_code=\"3C1C99E25796D78D\", unit_amount_in_cents=2000, \r\n  updated_at=\"2016-08-09 16:54:06 +00:00\">\r\n*/\r\n\r\n// suppose we only have the code\r\n$redemptionCode = $giftCard->redemption_code;\r\n$giftCard = new Recurly_GiftCard();\r\n$giftCard->redemption_code = $redemptionCode;\r\n\r\n// we can redeem directly with an account code\r\n$giftCard->redeem('RI5THpFRhh');\r\n\r\n// or make it part of a subscription\r\n\r\n$subscription = new Recurly_Subscription();\r\n$subscription->plan_code = 'gold';\r\n$subscription->currency = 'USD';\r\n\r\n$account = new Recurly_Account();\r\n$account->account_code = 'RI5THpFRhh';\r\n\r\n$subscription->account = $account;\r\n$subscription->gift_card = $giftCard;\r\n\r\n$subscription->create();\r\n\r\nprint $subscription;\r\n```","created_at":"2016-08-08T22:41:48Z","updated_at":"2016-08-12T21:26:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0bb04214b4e84c99d6406b45b56ae942b3bbeb27","assignee":{"login":"drewish","id":68750,"avatar_url":"https://avatars.githubusercontent.com/u/68750?v=3","gravatar_id":"","url":"https://api.github.com/users/drewish","html_url":"https://github.com/drewish","followers_url":"https://api.github.com/users/drewish/followers","following_url":"https://api.github.com/users/drewish/following{/other_user}","gists_url":"https://api.github.com/users/drewish/gists{/gist_id}","starred_url":"https://api.github.com/users/drewish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewish/subscriptions","organizations_url":"https://api.github.com/users/drewish/orgs","repos_url":"https://api.github.com/users/drewish/repos","events_url":"https://api.github.com/users/drewish/events{/privacy}","received_events_url":"https://api.github.com/users/drewish/received_events","type":"User","site_admin":false},"assignees":[{"login":"drewish","id":68750,"avatar_url":"https://avatars.githubusercontent.com/u/68750?v=3","gravatar_id":"","url":"https://api.github.com/users/drewish","html_url":"https://github.com/drewish","followers_url":"https://api.github.com/users/drewish/followers","following_url":"https://api.github.com/users/drewish/following{/other_user}","gists_url":"https://api.github.com/users/drewish/gists{/gist_id}","starred_url":"https://api.github.com/users/drewish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewish/subscriptions","organizations_url":"https://api.github.com/users/drewish/orgs","repos_url":"https://api.github.com/users/drewish/repos","events_url":"https://api.github.com/users/drewish/events{/privacy}","received_events_url":"https://api.github.com/users/drewish/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/recurly/recurly-client-php/pulls/261/commits","review_comments_url":"https://api.github.com/repos/recurly/recurly-client-php/pulls/261/comments","review_comment_url":"https://api.github.com/repos/recurly/recurly-client-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/recurly/recurly-client-php/issues/261/comments","statuses_url":"https://api.github.com/repos/recurly/recurly-client-php/statuses/104b96a334e4b388270953ba0eca1d09776b71d1","head":{"label":"recurly:gift_card_support","ref":"gift_card_support","sha":"104b96a334e4b388270953ba0eca1d09776b71d1","user":{"login":"recurly","id":144605,"avatar_url":"https://avatars.githubusercontent.com/u/144605?v=3","gravatar_id":"","url":"https://api.github.com/users/recurly","html_url":"https://github.com/recurly","followers_url":"https://api.github.com/users/recurly/followers","following_url":"https://api.github.com/users/recurly/following{/other_user}","gists_url":"https://api.github.com/users/recurly/gists{/gist_id}","starred_url":"https://api.github.com/users/recurly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/recurly/subscriptions","organizations_url":"https://api.github.com/users/recurly/orgs","repos_url":"https://api.github.com/users/recurly/repos","events_url":"https://api.github.com/users/recurly/events{/privacy}","received_events_url":"https://api.github.com/users/recurly/received_events","type":"Organization","site_admin":false},"repo":{"id":357644,"name":"recurly-client-php","full_name":"recurly/recurly-client-php","owner":{"login":"recurly","id":144605,"avatar_url":"https://avatars.githubusercontent.com/u/144605?v=3","gravatar_id":"","url":"https://api.github.com/users/recurly","html_url":"https://github.com/recurly","followers_url":"https://api.github.com/users/recurly/followers","following_url":"https://api.github.com/users/recurly/following{/other_user}","gists_url":"https://api.github.com/users/recurly/gists{/gist_id}","starred_url":"https://api.github.com/users/recurly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/recurly/subscriptions","organizations_url":"https://api.github.com/users/recurly/orgs","repos_url":"https://api.github.com/users/recurly/repos","events_url":"https://api.github.com/users/recurly/events{/privacy}","received_events_url":"https://api.github.com/users/recurly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/recurly/recurly-client-php","description":"Recurly PHP Client","fork":false,"url":"https://api.github.com/repos/recurly/recurly-client-php","forks_url":"https://api.github.com/repos/recurly/recurly-client-php/forks","keys_url":"https://api.github.com/repos/recurly/recurly-client-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/recurly/recurly-client-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/recurly/recurly-client-php/teams","hooks_url":"https://api.github.com/repos/recurly/recurly-client-php/hooks","issue_events_url":"https://api.github.com/repos/recurly/recurly-client-php/issues/events{/number}","events_url":"https://api.github.com/repos/recurly/recurly-client-php/events","assignees_url":"https://api.github.com/repos/recurly/recurly-client-php/assignees{/user}","branches_url":"https://api.github.com/repos/recurly/recurly-client-php/branches{/branch}","tags_url":"https://api.github.com/repos/recurly/recurly-client-php/tags","blobs_url":"https://api.github.com/repos/recurly/recurly-client-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/recurly/recurly-client-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/recurly/recurly-client-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/recurly/recurly-client-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/recurly/recurly-client-php/statuses/{sha}","languages_url":"https://api.github.com/repos/recurly/recurly-client-php/languages","stargazers_url":"https://api.github.com/repos/recurly/recurly-client-php/stargazers","contributors_url":"https://api.github.com/repos/recurly/recurly-client-php/contributors","subscribers_url":"https://api.github.com/repos/recurly/recurly-client-php/subscribers","subscription_url":"https://api.github.com/repos/recurly/recurly-client-php/subscription","commits_url":"https://api.github.com/repos/recurly/recurly-client-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/recurly/recurly-client-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/recurly/recurly-client-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/recurly/recurly-client-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/recurly/recurly-client-php/contents/{+path}","compare_url":"https://api.github.com/repos/recurly/recurly-client-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/recurly/recurly-client-php/merges","archive_url":"https://api.github.com/repos/recurly/recurly-client-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/recurly/recurly-client-php/downloads","issues_url":"https://api.github.com/repos/recurly/recurly-client-php/issues{/number}","pulls_url":"https://api.github.com/repos/recurly/recurly-client-php/pulls{/number}","milestones_url":"https://api.github.com/repos/recurly/recurly-client-php/milestones{/number}","notifications_url":"https://api.github.com/repos/recurly/recurly-client-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/recurly/recurly-client-php/labels{/name}","releases_url":"https://api.github.com/repos/recurly/recurly-client-php/releases{/id}","deployments_url":"https://api.github.com/repos/recurly/recurly-client-php/deployments","created_at":"2009-11-02T03:51:40Z","updated_at":"2016-08-11T04:58:51Z","pushed_at":"2016-08-12T17:43:03Z","git_url":"git://github.com/recurly/recurly-client-php.git","ssh_url":"git@github.com:recurly/recurly-client-php.git","clone_url":"https://github.com/recurly/recurly-client-php.git","svn_url":"https://github.com/recurly/recurly-client-php","homepage":"http://recurly.com","size":1709,"stargazers_count":111,"watchers_count":111,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":32,"forks":62,"open_issues":32,"watchers":111,"default_branch":"master"}},"base":{"label":"recurly:api-2.4","ref":"api-2.4","sha":"dff5f63d90d97253156b898c97b7302c5207df90","user":{"login":"recurly","id":144605,"avatar_url":"https://avatars.githubusercontent.com/u/144605?v=3","gravatar_id":"","url":"https://api.github.com/users/recurly","html_url":"https://github.com/recurly","followers_url":"https://api.github.com/users/recurly/followers","following_url":"https://api.github.com/users/recurly/following{/other_user}","gists_url":"https://api.github.com/users/recurly/gists{/gist_id}","starred_url":"https://api.github.com/users/recurly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/recurly/subscriptions","organizations_url":"https://api.github.com/users/recurly/orgs","repos_url":"https://api.github.com/users/recurly/repos","events_url":"https://api.github.com/users/recurly/events{/privacy}","received_events_url":"https://api.github.com/users/recurly/received_events","type":"Organization","site_admin":false},"repo":{"id":357644,"name":"recurly-client-php","full_name":"recurly/recurly-client-php","owner":{"login":"recurly","id":144605,"avatar_url":"https://avatars.githubusercontent.com/u/144605?v=3","gravatar_id":"","url":"https://api.github.com/users/recurly","html_url":"https://github.com/recurly","followers_url":"https://api.github.com/users/recurly/followers","following_url":"https://api.github.com/users/recurly/following{/other_user}","gists_url":"https://api.github.com/users/recurly/gists{/gist_id}","starred_url":"https://api.github.com/users/recurly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/recurly/subscriptions","organizations_url":"https://api.github.com/users/recurly/orgs","repos_url":"https://api.github.com/users/recurly/repos","events_url":"https://api.github.com/users/recurly/events{/privacy}","received_events_url":"https://api.github.com/users/recurly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/recurly/recurly-client-php","description":"Recurly PHP Client","fork":false,"url":"https://api.github.com/repos/recurly/recurly-client-php","forks_url":"https://api.github.com/repos/recurly/recurly-client-php/forks","keys_url":"https://api.github.com/repos/recurly/recurly-client-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/recurly/recurly-client-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/recurly/recurly-client-php/teams","hooks_url":"https://api.github.com/repos/recurly/recurly-client-php/hooks","issue_events_url":"https://api.github.com/repos/recurly/recurly-client-php/issues/events{/number}","events_url":"https://api.github.com/repos/recurly/recurly-client-php/events","assignees_url":"https://api.github.com/repos/recurly/recurly-client-php/assignees{/user}","branches_url":"https://api.github.com/repos/recurly/recurly-client-php/branches{/branch}","tags_url":"https://api.github.com/repos/recurly/recurly-client-php/tags","blobs_url":"https://api.github.com/repos/recurly/recurly-client-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/recurly/recurly-client-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/recurly/recurly-client-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/recurly/recurly-client-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/recurly/recurly-client-php/statuses/{sha}","languages_url":"https://api.github.com/repos/recurly/recurly-client-php/languages","stargazers_url":"https://api.github.com/repos/recurly/recurly-client-php/stargazers","contributors_url":"https://api.github.com/repos/recurly/recurly-client-php/contributors","subscribers_url":"https://api.github.com/repos/recurly/recurly-client-php/subscribers","subscription_url":"https://api.github.com/repos/recurly/recurly-client-php/subscription","commits_url":"https://api.github.com/repos/recurly/recurly-client-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/recurly/recurly-client-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/recurly/recurly-client-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/recurly/recurly-client-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/recurly/recurly-client-php/contents/{+path}","compare_url":"https://api.github.com/repos/recurly/recurly-client-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/recurly/recurly-client-php/merges","archive_url":"https://api.github.com/repos/recurly/recurly-client-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/recurly/recurly-client-php/downloads","issues_url":"https://api.github.com/repos/recurly/recurly-client-php/issues{/number}","pulls_url":"https://api.github.com/repos/recurly/recurly-client-php/pulls{/number}","milestones_url":"https://api.github.com/repos/recurly/recurly-client-php/milestones{/number}","notifications_url":"https://api.github.com/repos/recurly/recurly-client-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/recurly/recurly-client-php/labels{/name}","releases_url":"https://api.github.com/repos/recurly/recurly-client-php/releases{/id}","deployments_url":"https://api.github.com/repos/recurly/recurly-client-php/deployments","created_at":"2009-11-02T03:51:40Z","updated_at":"2016-08-11T04:58:51Z","pushed_at":"2016-08-12T17:43:03Z","git_url":"git://github.com/recurly/recurly-client-php.git","ssh_url":"git@github.com:recurly/recurly-client-php.git","clone_url":"https://github.com/recurly/recurly-client-php.git","svn_url":"https://github.com/recurly/recurly-client-php","homepage":"http://recurly.com","size":1709,"stargazers_count":111,"watchers_count":111,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":32,"forks":62,"open_issues":32,"watchers":111,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/recurly/recurly-client-php/pulls/261"},"html":{"href":"https://github.com/recurly/recurly-client-php/pull/261"},"issue":{"href":"https://api.github.com/repos/recurly/recurly-client-php/issues/261"},"comments":{"href":"https://api.github.com/repos/recurly/recurly-client-php/issues/261/comments"},"review_comments":{"href":"https://api.github.com/repos/recurly/recurly-client-php/pulls/261/comments"},"review_comment":{"href":"https://api.github.com/repos/recurly/recurly-client-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/recurly/recurly-client-php/pulls/261/commits"},"statuses":{"href":"https://api.github.com/repos/recurly/recurly-client-php/statuses/104b96a334e4b388270953ba0eca1d09776b71d1"}}}}
{"actor":{"display_login":"bhelx"}}