{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/membership-frontend/pulls/comments/38663743","id":38663743,"diff_hunk":"@@ -32,12 +33,16 @@ class ZuoraRestService(config: ZuoraApiConfig) extends LazyLogging {\n     }\n   }\n \n+  val productCatalogSupplier = new FutureSupplier[ProductCatalog](productCatalog)","path":"frontend/app/services/zuora/ZuoraRestService.scala","position":25,"original_position":25,"commit_id":"2eafb93276b788a704441d476087484d6c8ce0b6","original_commit_id":"4d17de48ea62dc198a9842758d05f7392e850e2d","user":{"login":"tudorraul","id":1492162,"avatar_url":"https://avatars.githubusercontent.com/u/1492162?v=3","gravatar_id":"","url":"https://api.github.com/users/tudorraul","html_url":"https://github.com/tudorraul","followers_url":"https://api.github.com/users/tudorraul/followers","following_url":"https://api.github.com/users/tudorraul/following{/other_user}","gists_url":"https://api.github.com/users/tudorraul/gists{/gist_id}","starred_url":"https://api.github.com/users/tudorraul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tudorraul/subscriptions","organizations_url":"https://api.github.com/users/tudorraul/orgs","repos_url":"https://api.github.com/users/tudorraul/repos","events_url":"https://api.github.com/users/tudorraul/events{/privacy}","received_events_url":"https://api.github.com/users/tudorraul/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2015-09-03T16:08:04Z","updated_at":"2015-09-03T16:08:04Z","html_url":"https://github.com/guardian/membership-frontend/pull/697#discussion_r38663743","pull_request_url":"https://api.github.com/repos/guardian/membership-frontend/pulls/697","_links":{"self":{"href":"https://api.github.com/repos/guardian/membership-frontend/pulls/comments/38663743"},"html":{"href":"https://github.com/guardian/membership-frontend/pull/697#discussion_r38663743"},"pull_request":{"href":"https://api.github.com/repos/guardian/membership-frontend/pulls/697"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/membership-frontend/pulls/697","id":43182292,"html_url":"https://github.com/guardian/membership-frontend/pull/697","diff_url":"https://github.com/guardian/membership-frontend/pull/697.diff","patch_url":"https://github.com/guardian/membership-frontend/pull/697.patch","issue_url":"https://api.github.com/repos/guardian/membership-frontend/issues/697","number":697,"state":"open","locked":false,"title":"Disambiguating Zuora subscription data from Membership vs Subscriptions","user":{"login":"afiore","id":63361,"avatar_url":"https://avatars.githubusercontent.com/u/63361?v=3","gravatar_id":"","url":"https://api.github.com/users/afiore","html_url":"https://github.com/afiore","followers_url":"https://api.github.com/users/afiore/followers","following_url":"https://api.github.com/users/afiore/following{/other_user}","gists_url":"https://api.github.com/users/afiore/gists{/gist_id}","starred_url":"https://api.github.com/users/afiore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afiore/subscriptions","organizations_url":"https://api.github.com/users/afiore/orgs","repos_url":"https://api.github.com/users/afiore/repos","events_url":"https://api.github.com/users/afiore/events{/privacy}","received_events_url":"https://api.github.com/users/afiore/received_events","type":"User","site_admin":false},"body":"_PR description by @rtyley :_\r\n\r\nThese are some fairly intense changes to the `SubscriptionService` to ensure that it correctly disambiguates between Zuora data for Membership and for Subscriptions (now the Digital Pack 2.0 is soon to launch).\r\n\r\nThe key thing to know about Zuora data:\r\n\r\n* **Zuora accounts** do **not** directly relate to Membership vs Subscriptions (you can not say 'this Zuora Account is a Membership Account'). A Zuora account only has to exist to provide a default payment method - so if a user is only paying with credit card, they should only have one account, but if they have both direct debit AND credit card, they will need _two_ Zuora accounts. PayPal, etc, would require a third.\r\n* **Zuora Subscriptions** are only _loosely_ associated with Membership or Subscriptions. You could have a Zuora Subscription which had both membership.theguardian.com & subscribe.theguardian.com products on it - we don't currently create those, but there is no guarantee that they won't occur in future.\r\n* **Zuora Products** _are_ associated with either Membership or Subscriptions. A Product might be 'Supporter' membership, or 'Digital Pack' for subscribe.theguardian.com.\r\n\r\nSo when it comes to working out which _Zuora Subscription_ you want to work with, you have to see which Products it has. If it has Membership Products, then it's a Membership subscription. The Zuora account that the subscription falls under could then be considered a 'Membership' account for some purposes - but might also include Zuora Subscriptions for subscribe.theguardian.com.\r\n\r\nWe are taking advantage of the Guardian custom field `ProductType` which already exists on Zuora Products. For Partner, Patron, Supporter, Staff Membership, this is correctly set to 'Membership'. For 'Digital Pack' the `ProductType` is 'Digital Pack' which I think may not be a good value for it - it should probably be 'Subscriptions'.\r\n\r\ncc @tudorraul @vivekkr \r\n\r\nhttps://trello.com/c/ltEhCsjV/37-filter-non-membership-zoura-subscriptions-to-avoid-clash-with-subscribe-theguardian-com\r\n\r\n\r\n\r\n","created_at":"2015-08-24T14:43:20Z","updated_at":"2015-09-03T16:08:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2eb4433f89227d95213e13e252499659f10e90a0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/guardian/membership-frontend/pulls/697/commits","review_comments_url":"https://api.github.com/repos/guardian/membership-frontend/pulls/697/comments","review_comment_url":"https://api.github.com/repos/guardian/membership-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/membership-frontend/issues/697/comments","statuses_url":"https://api.github.com/repos/guardian/membership-frontend/statuses/2eafb93276b788a704441d476087484d6c8ce0b6","head":{"label":"guardian:filter-subscriptions-by-rateplan","ref":"filter-subscriptions-by-rateplan","sha":"2eafb93276b788a704441d476087484d6c8ce0b6","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":28401521,"name":"membership-frontend","full_name":"guardian/membership-frontend","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/membership-frontend","description":"Bringing the Guardian to life through live events and meet-ups","fork":false,"url":"https://api.github.com/repos/guardian/membership-frontend","forks_url":"https://api.github.com/repos/guardian/membership-frontend/forks","keys_url":"https://api.github.com/repos/guardian/membership-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/membership-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/membership-frontend/teams","hooks_url":"https://api.github.com/repos/guardian/membership-frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/membership-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/membership-frontend/events","assignees_url":"https://api.github.com/repos/guardian/membership-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/membership-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/membership-frontend/tags","blobs_url":"https://api.github.com/repos/guardian/membership-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/membership-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/membership-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/membership-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/membership-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/membership-frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/membership-frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/membership-frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/membership-frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/membership-frontend/subscription","commits_url":"https://api.github.com/repos/guardian/membership-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/membership-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/membership-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/membership-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/membership-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/membership-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/membership-frontend/merges","archive_url":"https://api.github.com/repos/guardian/membership-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/membership-frontend/downloads","issues_url":"https://api.github.com/repos/guardian/membership-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/membership-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/membership-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/membership-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/membership-frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/membership-frontend/releases{/id}","created_at":"2014-12-23T14:14:38Z","updated_at":"2015-08-22T03:37:08Z","pushed_at":"2015-09-03T16:07:46Z","git_url":"git://github.com/guardian/membership-frontend.git","ssh_url":"git@github.com:guardian/membership-frontend.git","clone_url":"https://github.com/guardian/membership-frontend.git","svn_url":"https://github.com/guardian/membership-frontend","homepage":"https://membership.theguardian.com/","size":43712,"stargazers_count":14,"watchers_count":14,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":5,"forks":6,"open_issues":5,"watchers":14,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"6ea3cefcdc0f84e47a386e6366a7330c50ced5f9","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":28401521,"name":"membership-frontend","full_name":"guardian/membership-frontend","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/membership-frontend","description":"Bringing the Guardian to life through live events and meet-ups","fork":false,"url":"https://api.github.com/repos/guardian/membership-frontend","forks_url":"https://api.github.com/repos/guardian/membership-frontend/forks","keys_url":"https://api.github.com/repos/guardian/membership-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/membership-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/membership-frontend/teams","hooks_url":"https://api.github.com/repos/guardian/membership-frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/membership-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/membership-frontend/events","assignees_url":"https://api.github.com/repos/guardian/membership-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/membership-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/membership-frontend/tags","blobs_url":"https://api.github.com/repos/guardian/membership-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/membership-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/membership-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/membership-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/membership-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/membership-frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/membership-frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/membership-frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/membership-frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/membership-frontend/subscription","commits_url":"https://api.github.com/repos/guardian/membership-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/membership-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/membership-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/membership-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/membership-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/membership-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/membership-frontend/merges","archive_url":"https://api.github.com/repos/guardian/membership-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/membership-frontend/downloads","issues_url":"https://api.github.com/repos/guardian/membership-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/membership-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/membership-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/membership-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/membership-frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/membership-frontend/releases{/id}","created_at":"2014-12-23T14:14:38Z","updated_at":"2015-08-22T03:37:08Z","pushed_at":"2015-09-03T16:07:46Z","git_url":"git://github.com/guardian/membership-frontend.git","ssh_url":"git@github.com:guardian/membership-frontend.git","clone_url":"https://github.com/guardian/membership-frontend.git","svn_url":"https://github.com/guardian/membership-frontend","homepage":"https://membership.theguardian.com/","size":43712,"stargazers_count":14,"watchers_count":14,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":5,"forks":6,"open_issues":5,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/membership-frontend/pulls/697"},"html":{"href":"https://github.com/guardian/membership-frontend/pull/697"},"issue":{"href":"https://api.github.com/repos/guardian/membership-frontend/issues/697"},"comments":{"href":"https://api.github.com/repos/guardian/membership-frontend/issues/697/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/membership-frontend/pulls/697/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/membership-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/membership-frontend/pulls/697/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/membership-frontend/statuses/2eafb93276b788a704441d476087484d6c8ce0b6"}}}}