{"action":"opened","issue":{"url":"https://api.github.com/repos/Payum/Payum/issues/585","repository_url":"https://api.github.com/repos/Payum/Payum","labels_url":"https://api.github.com/repos/Payum/Payum/issues/585/labels{/name}","comments_url":"https://api.github.com/repos/Payum/Payum/issues/585/comments","events_url":"https://api.github.com/repos/Payum/Payum/issues/585/events","html_url":"https://github.com/Payum/Payum/issues/585","id":177555089,"number":585,"title":"There isn't a status for PayPal pending payments","user":{"login":"cundejo","id":10601715,"avatar_url":"https://avatars.githubusercontent.com/u/10601715?v=3","gravatar_id":"","url":"https://api.github.com/users/cundejo","html_url":"https://github.com/cundejo","followers_url":"https://api.github.com/users/cundejo/followers","following_url":"https://api.github.com/users/cundejo/following{/other_user}","gists_url":"https://api.github.com/users/cundejo/gists{/gist_id}","starred_url":"https://api.github.com/users/cundejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cundejo/subscriptions","organizations_url":"https://api.github.com/users/cundejo/orgs","repos_url":"https://api.github.com/users/cundejo/repos","events_url":"https://api.github.com/users/cundejo/events{/privacy}","received_events_url":"https://api.github.com/users/cundejo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-17T04:30:50Z","updated_at":"2016-09-17T04:30:50Z","closed_at":null,"body":"In PayPal Express Checkout (and I supose this is valid for others gateways) a payment could remain in a \"pending\" state because the buyer doesn't have funds in his PayPal account. In fact we can read this in PayPal: \"...When you sell an item and the buyer pays through PayPal, the funds may be pending in your PayPal account for a period of time before becoming available. Funds may be pending for as few as three days after the buyer receives the item, but may be pending for up to 21 days...\"\r\n\r\nSo, the payment was OK, but I don't have the money in my account yet for some reason (bank accounts checking process, multicurrency problems, etc.) \r\n\r\nIn this scenario, Payum put the payment status in \"captured\". But, if we dig in the payment details we can found this (chunked for clarity):\r\n\r\n```\r\ndetails(\r\n    ...\r\n    \"ACK\" => \"Success\",\r\n    ...\r\n    \"CHECKOUTSTATUS\" => \"PaymentActionCompleted\"\r\n    ...\r\n    \"PAYMENTINFO_0_PAYMENTSTATUS\" => \"Pending\",\r\n    \"PAYMENTINFO_0_PENDINGREASON\" => \"paymentreview\",\r\n    ...\r\n)\r\n```\r\n\r\nI can't (or I should not) handle this special case like a success payment, because it isn't. Could happen that Paypal put the payment in \"pending\" status to check a bank account, but if this bank account is empty, the payment will be cancelled three days later for example.\r\n\r\nSo in the done script this is not valid:\r\n\r\n```\r\n//...\r\n\r\nif ($status->isCaptured() || $status->isAuthorized()) {\r\n  // the payment is in \"captured\" status for Payum, but not for PayPal.\r\n}\r\n\r\n//...\r\n```\r\n\r\nPayum has a \"pending\" status, but is not for this scenario, it's used when we waiting for a push notification from PayPal.\r\n\r\nI think is needed another status in Payum for this scenario. \r\n\r\nAlthough, a bunch of questions related: \r\nWhat happens when a Paypal Pending payment like described earlier is Cancelled or is Completed? Paypal send a notification to my payment notify URL? Is the model updated automatically? How can I intercept this? \r\n\r\nI read almost all of the documentation but nothing about it, and no examples found in the Payum Bundle Sandbox."}}
{"actor":{"display_login":"cundejo"}}