{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/comments/58517852","id":58517852,"diff_hunk":"@@ -286,6 +297,41 @@ private Response responseForPaymentWithLinks(UriInfo uriInfo, Response connector\n         return errorResponse.apply(connectorResponse.readEntity(JsonNode.class));\n     }\n \n+    private Response responseForPaymentsWithSelfLinks(UriInfo uriInfo, Response connectorResponse, int okStatus,\n+                                                      Function<Object, ResponseBuilder> okResponse,\n+                                                      Supplier<Response> errorResponse) {\n+\n+        if (connectorResponse.getStatus() == okStatus) {\n+            try {\n+                JsonNode responseJson = connectorResponse.readEntity(JsonNode.class);\n+\n+                TypeReference<HashMap<String, List<PaymentConnectorResponse>>> typeRef","path":"src/main/java/uk/gov/pay/api/resources/PaymentsResource.java","position":100,"original_position":100,"commit_id":"e26453493e78b89330e17aff137dd2fe206f5530","original_commit_id":"e26453493e78b89330e17aff137dd2fe206f5530","user":{"login":"PauloPortugal","id":102318,"avatar_url":"https://avatars.githubusercontent.com/u/102318?v=3","gravatar_id":"","url":"https://api.github.com/users/PauloPortugal","html_url":"https://github.com/PauloPortugal","followers_url":"https://api.github.com/users/PauloPortugal/followers","following_url":"https://api.github.com/users/PauloPortugal/following{/other_user}","gists_url":"https://api.github.com/users/PauloPortugal/gists{/gist_id}","starred_url":"https://api.github.com/users/PauloPortugal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PauloPortugal/subscriptions","organizations_url":"https://api.github.com/users/PauloPortugal/orgs","repos_url":"https://api.github.com/users/PauloPortugal/repos","events_url":"https://api.github.com/users/PauloPortugal/events{/privacy}","received_events_url":"https://api.github.com/users/PauloPortugal/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2016-04-05T10:47:49Z","updated_at":"2016-04-05T10:47:49Z","html_url":"https://github.com/alphagov/pay-publicapi/pull/77#discussion_r58517852","pull_request_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/77","_links":{"self":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/comments/58517852"},"html":{"href":"https://github.com/alphagov/pay-publicapi/pull/77#discussion_r58517852"},"pull_request":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/77"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/77","id":65156954,"html_url":"https://github.com/alphagov/pay-publicapi/pull/77","diff_url":"https://github.com/alphagov/pay-publicapi/pull/77.diff","patch_url":"https://github.com/alphagov/pay-publicapi/pull/77.patch","issue_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/77","number":77,"state":"open","locked":false,"title":"PP-539 Allowing self links in payment search","user":{"login":"imranbohoran","id":2048844,"avatar_url":"https://avatars.githubusercontent.com/u/2048844?v=3","gravatar_id":"","url":"https://api.github.com/users/imranbohoran","html_url":"https://github.com/imranbohoran","followers_url":"https://api.github.com/users/imranbohoran/followers","following_url":"https://api.github.com/users/imranbohoran/following{/other_user}","gists_url":"https://api.github.com/users/imranbohoran/gists{/gist_id}","starred_url":"https://api.github.com/users/imranbohoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imranbohoran/subscriptions","organizations_url":"https://api.github.com/users/imranbohoran/orgs","repos_url":"https://api.github.com/users/imranbohoran/repos","events_url":"https://api.github.com/users/imranbohoran/events{/privacy}","received_events_url":"https://api.github.com/users/imranbohoran/received_events","type":"User","site_admin":false},"body":"PP-539 Allowing self link for payments from search    \r\n     * Including self link in payment search response. Only self link is\r\n       available in the '_links' object of the payment search response.\r\n     * Introducing separate objects to represent search results, links that\r\n       only have safe links and links that have both safe links and next_url\r\n       links.\r\n     * Every response other than payment search and cancel will have the\r\n       next_url in the links object\r\n     * Adding tests to assert we are returning everything we need to return\r\n     * Fixing typo in documentation\r\n","created_at":"2016-04-04T14:45:35Z","updated_at":"2016-04-05T10:47:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0e285e331c1a85b9068417450b9302574ee6701","assignee":{"login":"PauloPortugal","id":102318,"avatar_url":"https://avatars.githubusercontent.com/u/102318?v=3","gravatar_id":"","url":"https://api.github.com/users/PauloPortugal","html_url":"https://github.com/PauloPortugal","followers_url":"https://api.github.com/users/PauloPortugal/followers","following_url":"https://api.github.com/users/PauloPortugal/following{/other_user}","gists_url":"https://api.github.com/users/PauloPortugal/gists{/gist_id}","starred_url":"https://api.github.com/users/PauloPortugal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PauloPortugal/subscriptions","organizations_url":"https://api.github.com/users/PauloPortugal/orgs","repos_url":"https://api.github.com/users/PauloPortugal/repos","events_url":"https://api.github.com/users/PauloPortugal/events{/privacy}","received_events_url":"https://api.github.com/users/PauloPortugal/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/77/commits","review_comments_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/77/comments","review_comment_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/77/comments","statuses_url":"https://api.github.com/repos/alphagov/pay-publicapi/statuses/e26453493e78b89330e17aff137dd2fe206f5530","head":{"label":"alphagov:PP-539_Allowing_self_links_in_payment_search","ref":"PP-539_Allowing_self_links_in_payment_search","sha":"e26453493e78b89330e17aff137dd2fe206f5530","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":39890205,"name":"pay-publicapi","full_name":"alphagov/pay-publicapi","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/pay-publicapi","description":"The Payments Public API in Java (Dropwizard)","fork":false,"url":"https://api.github.com/repos/alphagov/pay-publicapi","forks_url":"https://api.github.com/repos/alphagov/pay-publicapi/forks","keys_url":"https://api.github.com/repos/alphagov/pay-publicapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/pay-publicapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/pay-publicapi/teams","hooks_url":"https://api.github.com/repos/alphagov/pay-publicapi/hooks","issue_events_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/pay-publicapi/events","assignees_url":"https://api.github.com/repos/alphagov/pay-publicapi/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/pay-publicapi/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/pay-publicapi/tags","blobs_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/pay-publicapi/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/pay-publicapi/languages","stargazers_url":"https://api.github.com/repos/alphagov/pay-publicapi/stargazers","contributors_url":"https://api.github.com/repos/alphagov/pay-publicapi/contributors","subscribers_url":"https://api.github.com/repos/alphagov/pay-publicapi/subscribers","subscription_url":"https://api.github.com/repos/alphagov/pay-publicapi/subscription","commits_url":"https://api.github.com/repos/alphagov/pay-publicapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/pay-publicapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/pay-publicapi/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/pay-publicapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/pay-publicapi/merges","archive_url":"https://api.github.com/repos/alphagov/pay-publicapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/pay-publicapi/downloads","issues_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/pay-publicapi/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/pay-publicapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/pay-publicapi/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/pay-publicapi/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/pay-publicapi/deployments","created_at":"2015-07-29T11:37:37Z","updated_at":"2016-03-31T08:49:56Z","pushed_at":"2016-04-04T18:27:42Z","git_url":"git://github.com/alphagov/pay-publicapi.git","ssh_url":"git@github.com:alphagov/pay-publicapi.git","clone_url":"https://github.com/alphagov/pay-publicapi.git","svn_url":"https://github.com/alphagov/pay-publicapi","homepage":null,"size":7934,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"9b7c4b0ef625d0a1c8c057e202d85ad3fbdfc862","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":39890205,"name":"pay-publicapi","full_name":"alphagov/pay-publicapi","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/pay-publicapi","description":"The Payments Public API in Java (Dropwizard)","fork":false,"url":"https://api.github.com/repos/alphagov/pay-publicapi","forks_url":"https://api.github.com/repos/alphagov/pay-publicapi/forks","keys_url":"https://api.github.com/repos/alphagov/pay-publicapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/pay-publicapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/pay-publicapi/teams","hooks_url":"https://api.github.com/repos/alphagov/pay-publicapi/hooks","issue_events_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/pay-publicapi/events","assignees_url":"https://api.github.com/repos/alphagov/pay-publicapi/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/pay-publicapi/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/pay-publicapi/tags","blobs_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/pay-publicapi/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/pay-publicapi/languages","stargazers_url":"https://api.github.com/repos/alphagov/pay-publicapi/stargazers","contributors_url":"https://api.github.com/repos/alphagov/pay-publicapi/contributors","subscribers_url":"https://api.github.com/repos/alphagov/pay-publicapi/subscribers","subscription_url":"https://api.github.com/repos/alphagov/pay-publicapi/subscription","commits_url":"https://api.github.com/repos/alphagov/pay-publicapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/pay-publicapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/pay-publicapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/pay-publicapi/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/pay-publicapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/pay-publicapi/merges","archive_url":"https://api.github.com/repos/alphagov/pay-publicapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/pay-publicapi/downloads","issues_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/pay-publicapi/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/pay-publicapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/pay-publicapi/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/pay-publicapi/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/pay-publicapi/deployments","created_at":"2015-07-29T11:37:37Z","updated_at":"2016-03-31T08:49:56Z","pushed_at":"2016-04-04T18:27:42Z","git_url":"git://github.com/alphagov/pay-publicapi.git","ssh_url":"git@github.com:alphagov/pay-publicapi.git","clone_url":"https://github.com/alphagov/pay-publicapi.git","svn_url":"https://github.com/alphagov/pay-publicapi","homepage":null,"size":7934,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/77"},"html":{"href":"https://github.com/alphagov/pay-publicapi/pull/77"},"issue":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/issues/77"},"comments":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/issues/77/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/77/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/77/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/statuses/e26453493e78b89330e17aff137dd2fe206f5530"}}}}