{"issue":{"pull_request":{"diff_url":"https://github.com/recurly/recurly-client-php/pull/19.diff","html_url":"https://github.com/recurly/recurly-client-php/pull/19","patch_url":"https://github.com/recurly/recurly-client-php/pull/19.patch"},"state":"closed","milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/b8483939ae69c16d14c116fc6009944a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b8483939ae69c16d14c116fc6009944a","url":"https://api.github.com/users/qqqq","login":"qqqq","id":630781},"updated_at":"2011-11-17T02:04:03Z","assignee":null,"labels":[],"comments":1,"closed_at":"2011-11-17T01:59:52Z","url":"https://api.github.com/repos/recurly/recurly-client-php/issues/19","body":"The helper class to create subscription add-ons was missing. \r\n\r\nThis patch enables creating/updating subscription with add-ons:\r\n\r\n```php\r\n$recSub = new Recurly_Subscription();\r\n$recSub->account_code = '123';\r\n$recSub->plan_code = 'myplan';\r\n$recSub->currency = 'USD';\r\n$addon = new Recurly_SubscriptionAddOn();\r\n$addon->add_on_code = 'MY_ADDON';\r\n$addon->quantity = 3;\r\n$recSub->subscription_add_ons = array($addon);\r\n$recSub->create();\r\n```\r\n\r\n\r\nSee support req #5699.","html_url":"https://github.com/recurly/recurly-client-php/issues/19","title":"Allow updating a subscription's addons","number":19,"id":2212946,"created_at":"2011-11-11T20:06:28Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/9f4bd7da7faefa82f4db08e5c522ce55?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"9f4bd7da7faefa82f4db08e5c522ce55","url":"https://api.github.com/users/isaachall","login":"isaachall","id":40443},"updated_at":"2011-11-17T02:04:03Z","url":"https://api.github.com/repos/recurly/recurly-client-php/issues/comments/2771202","body":"@qqqq: Thanks for the pull request. It's now merged in. I found one minor bug in your patch related that's fixed in the master branch now. It only manifests itself when pushing onto an array, such as:\r\n\r\n    $subscription->subscription_add_ons[] = $add_on;\r\n\r\nThe `Recurly_Resource::__get` method now has to return by reference in order to fully support arrays.","id":2771202,"created_at":"2011-11-17T02:04:03Z"}}