{"action":"created","issue":{"url":"https://api.github.com/repos/Adyen/magento/issues/368","labels_url":"https://api.github.com/repos/Adyen/magento/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/Adyen/magento/issues/368/comments","events_url":"https://api.github.com/repos/Adyen/magento/issues/368/events","html_url":"https://github.com/Adyen/magento/issues/368","id":95854516,"number":368,"title":"The invoice shouldn't be created until the capture notification is sent","user":{"login":"marcop83","id":7983279,"avatar_url":"https://avatars.githubusercontent.com/u/7983279?v=3","gravatar_id":"","url":"https://api.github.com/users/marcop83","html_url":"https://github.com/marcop83","followers_url":"https://api.github.com/users/marcop83/followers","following_url":"https://api.github.com/users/marcop83/following{/other_user}","gists_url":"https://api.github.com/users/marcop83/gists{/gist_id}","starred_url":"https://api.github.com/users/marcop83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcop83/subscriptions","organizations_url":"https://api.github.com/users/marcop83/orgs","repos_url":"https://api.github.com/users/marcop83/repos","events_url":"https://api.github.com/users/marcop83/events{/privacy}","received_events_url":"https://api.github.com/users/marcop83/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-18T19:49:08Z","updated_at":"2015-07-20T07:01:13Z","closed_at":null,"body":"Hey guys, in my opinion there's an issue with the payment flow you have implemented when the Capture Mode is set to \"Manual\". Here's my case: after the payment has been authorized and the order is placed, I've created the invoice to capture the payment and the invoice was created immediately after and it was set to PAID. The problem was that the CAPTURE notification received after few minutes had success:false and reason:Insufficient balance on payment. The result is that I have a paid invoice without having received the money and that's not right.  \r\nI think you can't be sure that the payment is successful until Magento receives the capture NOTIFICATION with the success field set to true. Thus, the correct flow would be creating the invoice only after the success capture notification is received form Magento. What do you think?"},"comment":{"url":"https://api.github.com/repos/Adyen/magento/issues/comments/122782307","html_url":"https://github.com/Adyen/magento/issues/368#issuecomment-122782307","issue_url":"https://api.github.com/repos/Adyen/magento/issues/368","id":122782307,"user":{"login":"rikterbeek","id":5948499,"avatar_url":"https://avatars.githubusercontent.com/u/5948499?v=3","gravatar_id":"","url":"https://api.github.com/users/rikterbeek","html_url":"https://github.com/rikterbeek","followers_url":"https://api.github.com/users/rikterbeek/followers","following_url":"https://api.github.com/users/rikterbeek/following{/other_user}","gists_url":"https://api.github.com/users/rikterbeek/gists{/gist_id}","starred_url":"https://api.github.com/users/rikterbeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rikterbeek/subscriptions","organizations_url":"https://api.github.com/users/rikterbeek/orgs","repos_url":"https://api.github.com/users/rikterbeek/repos","events_url":"https://api.github.com/users/rikterbeek/events{/privacy}","received_events_url":"https://api.github.com/users/rikterbeek/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T07:01:13Z","updated_at":"2015-07-20T07:01:13Z","body":"Hi Marco,\r\n\r\nThat is true, problem here is that Magento is build that the api gives a direct response if the capture is received or failed. We cannot provide this information because it takes some time to know if the Payment can be captured. So we respond with [capture-received] and Magento will create an invoice. Normally this is fine because the capture goes through but in your case because you did not have sufficient balance on your account it failed. I don't see an option how to solve this in Magento because we have only access of doing an api call.\r\n\r\nRegards,\r\nRik\r\nAdyen"}}