{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/comments/218078276","pull_request_review_id":155935918,"id":218078276,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODA3ODI3Ng==","diff_hunk":"@@ -0,0 +1,52 @@\n+package uk.gov.pay.api.exception.mapper;\n+\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import uk.gov.pay.api.exception.CaptureChargeException;\n+import uk.gov.pay.api.model.PaymentError;\n+\n+import javax.ws.rs.core.Response;\n+import javax.ws.rs.ext.ExceptionMapper;\n+\n+import static javax.ws.rs.core.Response.Status.BAD_REQUEST;\n+import static javax.ws.rs.core.Response.Status.CONFLICT;\n+import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;\n+import static javax.ws.rs.core.Response.Status.NOT_FOUND;\n+import static uk.gov.pay.api.model.PaymentError.Code.CAPTURE_PAYMENT_CONNECTOR_BAD_REQUEST_ERROR;\n+import static uk.gov.pay.api.model.PaymentError.Code.CAPTURE_PAYMENT_CONNECTOR_CONFLICT_ERROR;\n+import static uk.gov.pay.api.model.PaymentError.Code.CAPTURE_PAYMENT_CONNECTOR_ERROR;\n+import static uk.gov.pay.api.model.PaymentError.Code.CAPTURE_PAYMENT_NOT_FOUND_ERROR;\n+import static uk.gov.pay.api.model.PaymentError.aPaymentError;\n+\n+public class CaptureChargeExceptionMapper implements ExceptionMapper<CaptureChargeException> {\n+\n+    private static final Logger LOGGER = LoggerFactory.getLogger(CaptureChargeExceptionMapper.class);\n+\n+    @Override\n+    public Response toResponse(CaptureChargeException exception) {\n+        int errorStatus = exception.getErrorStatus();\n+        PaymentError paymentError;\n+        Response.Status status;\n+\n+        if (errorStatus == NOT_FOUND.getStatusCode()) {","path":"src/main/java/uk/gov/pay/api/exception/mapper/CaptureChargeExceptionMapper.java","position":31,"original_position":31,"commit_id":"29a068336571368a115f9eeda28ee0a682a239c2","original_commit_id":"4735001a97d5a44ac8ef66fc5e99b2476cf94a59","user":{"login":"SandorArpa","id":21037762,"node_id":"MDQ6VXNlcjIxMDM3NzYy","avatar_url":"https://avatars0.githubusercontent.com/u/21037762?v=4","gravatar_id":"","url":"https://api.github.com/users/SandorArpa","html_url":"https://github.com/SandorArpa","followers_url":"https://api.github.com/users/SandorArpa/followers","following_url":"https://api.github.com/users/SandorArpa/following{/other_user}","gists_url":"https://api.github.com/users/SandorArpa/gists{/gist_id}","starred_url":"https://api.github.com/users/SandorArpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SandorArpa/subscriptions","organizations_url":"https://api.github.com/users/SandorArpa/orgs","repos_url":"https://api.github.com/users/SandorArpa/repos","events_url":"https://api.github.com/users/SandorArpa/events{/privacy}","received_events_url":"https://api.github.com/users/SandorArpa/received_events","type":"User","site_admin":false},"body":"Add it to the `fix connector epic` perhaps?","created_at":"2018-09-17T13:56:47Z","updated_at":"2018-09-17T13:56:47Z","html_url":"https://github.com/alphagov/pay-publicapi/pull/264#discussion_r218078276","pull_request_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/264","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/comments/218078276"},"html":{"href":"https://github.com/alphagov/pay-publicapi/pull/264#discussion_r218078276"},"pull_request":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/264"}},"in_reply_to_id":218010267},"pull_request":{"url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/264","id":215302884,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1MzAyODg0","html_url":"https://github.com/alphagov/pay-publicapi/pull/264","diff_url":"https://github.com/alphagov/pay-publicapi/pull/264.diff","patch_url":"https://github.com/alphagov/pay-publicapi/pull/264.patch","issue_url":"https://api.github.com/repos/alphagov/pay-publicapi/issues/264","number":264,"state":"open","locked":false,"title":"PP-4110 Add a new capture endpoint","user":{"login":"DanailMinchev","id":7883702,"node_id":"MDQ6VXNlcjc4ODM3MDI=","avatar_url":"https://avatars1.githubusercontent.com/u/7883702?v=4","gravatar_id":"","url":"https://api.github.com/users/DanailMinchev","html_url":"https://github.com/DanailMinchev","followers_url":"https://api.github.com/users/DanailMinchev/followers","following_url":"https://api.github.com/users/DanailMinchev/following{/other_user}","gists_url":"https://api.github.com/users/DanailMinchev/gists{/gist_id}","starred_url":"https://api.github.com/users/DanailMinchev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanailMinchev/subscriptions","organizations_url":"https://api.github.com/users/DanailMinchev/orgs","repos_url":"https://api.github.com/users/DanailMinchev/repos","events_url":"https://api.github.com/users/DanailMinchev/events{/privacy}","received_events_url":"https://api.github.com/users/DanailMinchev/received_events","type":"User","site_admin":false},"body":"## WHAT\r\n\r\nThis PR adds a new `POST /v1/payments/{paymentId}/capture` endpoint.\r\n\r\nSee commits for more information.\r\n\r\nwith @SandorArpa ","created_at":"2018-09-13T14:29:20Z","updated_at":"2018-09-17T13:56:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30d00e8122ef4345a4be4b04da19370074d606a7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/264/commits","review_comments_url":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/264/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/264/comments","statuses_url":"https://api.github.com/repos/alphagov/pay-publicapi/statuses/29a068336571368a115f9eeda28ee0a682a239c2","head":{"label":"alphagov:PP-4110-add_new_capture_endpoint","ref":"PP-4110-add_new_capture_endpoint","sha":"29a068336571368a115f9eeda28ee0a682a239c2","user":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkzOTg5MDIwNQ==","name":"pay-publicapi","full_name":"alphagov/pay-publicapi","private":false,"owner":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","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},"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":"2018-09-17T09:57:36Z","pushed_at":"2018-09-17T12:51:53Z","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":9037,"stargazers_count":27,"watchers_count":27,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":4,"watchers":27,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"f8446cbbd3ed598572f89250bae38e7296fc85d5","user":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkzOTg5MDIwNQ==","name":"pay-publicapi","full_name":"alphagov/pay-publicapi","private":false,"owner":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","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},"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":"2018-09-17T09:57:36Z","pushed_at":"2018-09-17T12:51:53Z","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":9037,"stargazers_count":27,"watchers_count":27,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":4,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/264"},"html":{"href":"https://github.com/alphagov/pay-publicapi/pull/264"},"issue":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/issues/264"},"comments":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/issues/264/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/pulls/264/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/264/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/pay-publicapi/statuses/29a068336571368a115f9eeda28ee0a682a239c2"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"SandorArpa"}}