{"action":"closed","issue":{"url":"https://api.github.com/repos/killbill/killbill/issues/289","labels_url":"https://api.github.com/repos/killbill/killbill/issues/289/labels{/name}","comments_url":"https://api.github.com/repos/killbill/killbill/issues/289/comments","events_url":"https://api.github.com/repos/killbill/killbill/issues/289/events","html_url":"https://github.com/killbill/killbill/issues/289","id":60419969,"number":289,"title":"Duplicate results in payments when refund present","user":{"login":"mkching","id":60301,"avatar_url":"https://avatars.githubusercontent.com/u/60301?v=3","gravatar_id":"","url":"https://api.github.com/users/mkching","html_url":"https://github.com/mkching","followers_url":"https://api.github.com/users/mkching/followers","following_url":"https://api.github.com/users/mkching/following{/other_user}","gists_url":"https://api.github.com/users/mkching/gists{/gist_id}","starred_url":"https://api.github.com/users/mkching/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkching/subscriptions","organizations_url":"https://api.github.com/users/mkching/orgs","repos_url":"https://api.github.com/users/mkching/repos","events_url":"https://api.github.com/users/mkching/events{/privacy}","received_events_url":"https://api.github.com/users/mkching/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/killbill/killbill/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/killbill/killbill/labels/ext-candidate","name":"ext-candidate","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/killbill/killbill/milestones/14","html_url":"https://github.com/killbill/killbill/milestones/Release-0.15.4","labels_url":"https://api.github.com/repos/killbill/killbill/milestones/14/labels","id":1250535,"number":14,"title":"Release-0.15.4","description":"","creator":{"login":"pierre","id":51940,"avatar_url":"https://avatars.githubusercontent.com/u/51940?v=3","gravatar_id":"","url":"https://api.github.com/users/pierre","html_url":"https://github.com/pierre","followers_url":"https://api.github.com/users/pierre/followers","following_url":"https://api.github.com/users/pierre/following{/other_user}","gists_url":"https://api.github.com/users/pierre/gists{/gist_id}","starred_url":"https://api.github.com/users/pierre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierre/subscriptions","organizations_url":"https://api.github.com/users/pierre/orgs","repos_url":"https://api.github.com/users/pierre/repos","events_url":"https://api.github.com/users/pierre/events{/privacy}","received_events_url":"https://api.github.com/users/pierre/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":8,"state":"open","created_at":"2015-08-11T19:25:22Z","updated_at":"2015-09-09T21:36:11Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-03-09T22:17:10Z","updated_at":"2015-09-09T21:36:11Z","closed_at":"2015-09-09T21:36:11Z","body":"The /1.0/kb/invoices/.../payments call is returning the same payment information twice when a refund is present.  Each record had the same paymentId and transaction list.\r\n\r\n<pre>\r\n[\r\n    {\r\n        \"accountId\": \"179eb3e8-7b29-427c-8b33-8bfb98fce5c7\",\r\n        \"auditLogs\": null,\r\n        \"authAmount\": 0,\r\n        \"capturedAmount\": 0,\r\n        \"creditedAmount\": 0,\r\n        \"currency\": \"USD\",\r\n        \"paymentExternalKey\": \"653f164a-40c9-4a60-a9a9-7745478d5b17\",\r\n        \"paymentId\": \"68d174f7-24be-4f89-9a01-b6fd92799feb\",\r\n        \"paymentMethodId\": \"46ac78dd-6968-4d4f-9058-84958a2c998b\",\r\n        \"paymentNumber\": \"10\",\r\n        \"purchasedAmount\": 17.0,\r\n        \"refundedAmount\": 3.0,\r\n        \"targetInvoiceId\": \"ded2bce6-d560-4971-ae25-7725e814c721\",\r\n        \"transactions\": [\r\n            {\r\n                \"amount\": 17.0,\r\n                \"auditLogs\": null,\r\n                \"currency\": \"USD\",\r\n                \"effectiveDate\": \"2015-07-09T22:07:09.000Z\",\r\n                \"firstPaymentReferenceId\": null,\r\n                \"gatewayErrorCode\": null,\r\n                \"gatewayErrorMsg\": \"Transaction approved\",\r\n                \"paymentExternalKey\": \"653f164a-40c9-4a60-a9a9-7745478d5b17\",\r\n                \"paymentId\": \"68d174f7-24be-4f89-9a01-b6fd92799feb\",\r\n                \"properties\": null,\r\n                \"secondPaymentReferenceId\": null,\r\n                \"status\": \"SUCCESS\",\r\n                \"transactionExternalKey\": \"19e8072e-d0a4-4f99-8a3b-15e31265aff4\",\r\n                \"transactionId\": \"0a1f289a-b04d-4764-9fe4-a70ff629084e\",\r\n                \"transactionType\": \"PURCHASE\"\r\n            },\r\n            {\r\n                \"amount\": 2.0,\r\n                \"auditLogs\": null,\r\n                \"currency\": \"USD\",\r\n                \"effectiveDate\": \"2015-07-09T22:07:53.000Z\",\r\n                \"firstPaymentReferenceId\": null,\r\n                \"gatewayErrorCode\": null,\r\n                \"gatewayErrorMsg\": \"Transaction approved\",\r\n                \"paymentExternalKey\": \"653f164a-40c9-4a60-a9a9-7745478d5b17\",\r\n                \"paymentId\": \"68d174f7-24be-4f89-9a01-b6fd92799feb\",\r\n                \"properties\": null,\r\n                \"secondPaymentReferenceId\": null,\r\n                \"status\": \"SUCCESS\",\r\n                \"transactionExternalKey\": \"c4661f90-7afc-4b70-86b9-8571155c1763\",\r\n                \"transactionId\": \"393e19ec-0041-4888-9a13-483709ec3b44\",\r\n                \"transactionType\": \"REFUND\"\r\n            },\r\n            {\r\n                \"amount\": 1.0,\r\n                \"auditLogs\": null,\r\n                \"currency\": \"USD\",\r\n                \"effectiveDate\": \"2015-07-09T22:08:14.000Z\",\r\n                \"firstPaymentReferenceId\": null,\r\n                \"gatewayErrorCode\": null,\r\n                \"gatewayErrorMsg\": \"Transaction approved\",\r\n                \"paymentExternalKey\": \"653f164a-40c9-4a60-a9a9-7745478d5b17\",\r\n                \"paymentId\": \"68d174f7-24be-4f89-9a01-b6fd92799feb\",\r\n                \"properties\": null,\r\n                \"secondPaymentReferenceId\": null,\r\n                \"status\": \"SUCCESS\",\r\n                \"transactionExternalKey\": \"a075fd0c-6585-4e90-ba50-20456a9feea4\",\r\n                \"transactionId\": \"79c20bdf-9249-420d-9ddd-3770edd22aee\",\r\n                \"transactionType\": \"REFUND\"\r\n            }\r\n        ]\r\n    },\r\n    {\r\n        \"accountId\": \"179eb3e8-7b29-427c-8b33-8bfb98fce5c7\",\r\n        \"auditLogs\": null,\r\n        \"authAmount\": 0,\r\n        \"capturedAmount\": 0,\r\n        \"creditedAmount\": 0,\r\n        \"currency\": \"USD\",\r\n        \"paymentExternalKey\": \"653f164a-40c9-4a60-a9a9-7745478d5b17\",\r\n        \"paymentId\": \"68d174f7-24be-4f89-9a01-b6fd92799feb\",\r\n        \"paymentMethodId\": \"46ac78dd-6968-4d4f-9058-84958a2c998b\",\r\n        \"paymentNumber\": \"10\",\r\n        \"purchasedAmount\": 17.0,\r\n        \"refundedAmount\": 3.0,\r\n        \"targetInvoiceId\": \"ded2bce6-d560-4971-ae25-7725e814c721\",\r\n        \"transactions\": [\r\n            {\r\n                \"amount\": 17.0,\r\n                \"auditLogs\": null,\r\n                \"currency\": \"USD\",\r\n                \"effectiveDate\": \"2015-07-09T22:07:09.000Z\",\r\n                \"firstPaymentReferenceId\": null,\r\n                \"gatewayErrorCode\": null,\r\n                \"gatewayErrorMsg\": \"Transaction approved\",\r\n                \"paymentExternalKey\": \"653f164a-40c9-4a60-a9a9-7745478d5b17\",\r\n                \"paymentId\": \"68d174f7-24be-4f89-9a01-b6fd92799feb\",\r\n                \"properties\": null,\r\n                \"secondPaymentReferenceId\": null,\r\n                \"status\": \"SUCCESS\",\r\n                \"transactionExternalKey\": \"19e8072e-d0a4-4f99-8a3b-15e31265aff4\",\r\n                \"transactionId\": \"0a1f289a-b04d-4764-9fe4-a70ff629084e\",\r\n                \"transactionType\": \"PURCHASE\"\r\n            },\r\n            {\r\n                \"amount\": 2.0,\r\n                \"auditLogs\": null,\r\n                \"currency\": \"USD\",\r\n                \"effectiveDate\": \"2015-07-09T22:07:53.000Z\",\r\n                \"firstPaymentReferenceId\": null,\r\n                \"gatewayErrorCode\": null,\r\n                \"gatewayErrorMsg\": \"Transaction approved\",\r\n                \"paymentExternalKey\": \"653f164a-40c9-4a60-a9a9-7745478d5b17\",\r\n                \"paymentId\": \"68d174f7-24be-4f89-9a01-b6fd92799feb\",\r\n                \"properties\": null,\r\n                \"secondPaymentReferenceId\": null,\r\n                \"status\": \"SUCCESS\",\r\n                \"transactionExternalKey\": \"c4661f90-7afc-4b70-86b9-8571155c1763\",\r\n                \"transactionId\": \"393e19ec-0041-4888-9a13-483709ec3b44\",\r\n                \"transactionType\": \"REFUND\"\r\n            },\r\n            {\r\n                \"amount\": 1.0,\r\n                \"auditLogs\": null,\r\n                \"currency\": \"USD\",\r\n                \"effectiveDate\": \"2015-07-09T22:08:14.000Z\",\r\n                \"firstPaymentReferenceId\": null,\r\n                \"gatewayErrorCode\": null,\r\n                \"gatewayErrorMsg\": \"Transaction approved\",\r\n                \"paymentExternalKey\": \"653f164a-40c9-4a60-a9a9-7745478d5b17\",\r\n                \"paymentId\": \"68d174f7-24be-4f89-9a01-b6fd92799feb\",\r\n                \"properties\": null,\r\n                \"secondPaymentReferenceId\": null,\r\n                \"status\": \"SUCCESS\",\r\n                \"transactionExternalKey\": \"a075fd0c-6585-4e90-ba50-20456a9feea4\",\r\n                \"transactionId\": \"79c20bdf-9249-420d-9ddd-3770edd22aee\",\r\n                \"transactionType\": \"REFUND\"\r\n            }\r\n        ]\r\n    }\r\n]\r\n</pre>"}}