{"action":"created","issue":{"url":"https://api.github.com/repos/recurly/recurly-client-ruby/issues/166","labels_url":"https://api.github.com/repos/recurly/recurly-client-ruby/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/recurly/recurly-client-ruby/issues/166/comments","events_url":"https://api.github.com/repos/recurly/recurly-client-ruby/issues/166/events","html_url":"https://github.com/recurly/recurly-client-ruby/pull/166","id":52199054,"number":166,"title":"Webhook Handlers","user":{"login":"keysolutions","id":69043,"avatar_url":"https://avatars.githubusercontent.com/u/69043?v=3","gravatar_id":"","url":"https://api.github.com/users/keysolutions","html_url":"https://github.com/keysolutions","followers_url":"https://api.github.com/users/keysolutions/followers","following_url":"https://api.github.com/users/keysolutions/following{/other_user}","gists_url":"https://api.github.com/users/keysolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/keysolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keysolutions/subscriptions","organizations_url":"https://api.github.com/users/keysolutions/orgs","repos_url":"https://api.github.com/users/keysolutions/repos","events_url":"https://api.github.com/users/keysolutions/events{/privacy}","received_events_url":"https://api.github.com/users/keysolutions/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"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},"milestone":null,"comments":4,"created_at":"2014-12-17T03:59:41Z","updated_at":"2015-10-13T22:26:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/recurly/recurly-client-ruby/pulls/166","html_url":"https://github.com/recurly/recurly-client-ruby/pull/166","diff_url":"https://github.com/recurly/recurly-client-ruby/pull/166.diff","patch_url":"https://github.com/recurly/recurly-client-ruby/pull/166.patch"},"body":"Adds an API to simplify the handling of webhook requests.\r\n\r\nExample usage:\r\n\r\n```ruby\r\nnotification = Recurly::Webhook.parse(xml_body)\r\n\r\ncase notification\r\nwhen Recurly::Webhook::NewAccountNoficiation\r\n\r\n  # A new account was created\r\n  puts \"New account #{notification.account.account_code}\"\r\n\r\nwhen Recurly::Webhook::NewSubscriptionNotification\r\n\r\n  # A new subscription was added\r\n  puts \"New subscription from #{notification.account.account_code}\"\r\n  \r\n  # Notifications are not necessarily current. ! relation methods will\r\n  # fetch the latest data\r\n  puts \"Current state #{notification.subscription!.state}\"\r\n\r\nwhen Recurly::Webhook::SubscriptionNotification\r\n\r\n  # A subscription-related notification was sent\r\n  puts \"Generic subscription notification by #{notification.account!.account_code}\"\r\n\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/recurly/recurly-client-ruby/issues/comments/147871862","html_url":"https://github.com/recurly/recurly-client-ruby/pull/166#issuecomment-147871862","issue_url":"https://api.github.com/repos/recurly/recurly-client-ruby/issues/166","id":147871862,"user":{"login":"dsshap","id":1558338,"avatar_url":"https://avatars.githubusercontent.com/u/1558338?v=3","gravatar_id":"","url":"https://api.github.com/users/dsshap","html_url":"https://github.com/dsshap","followers_url":"https://api.github.com/users/dsshap/followers","following_url":"https://api.github.com/users/dsshap/following{/other_user}","gists_url":"https://api.github.com/users/dsshap/gists{/gist_id}","starred_url":"https://api.github.com/users/dsshap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsshap/subscriptions","organizations_url":"https://api.github.com/users/dsshap/orgs","repos_url":"https://api.github.com/users/dsshap/repos","events_url":"https://api.github.com/users/dsshap/events{/privacy}","received_events_url":"https://api.github.com/users/dsshap/received_events","type":"User","site_admin":false},"created_at":"2015-10-13T22:26:59Z","updated_at":"2015-10-13T22:26:59Z","body":"Any plans to merge this in and release?"}}