{"action":"created","issue":{"url":"https://api.github.com/repos/pagarme/pagarme-js/issues/78","repository_url":"https://api.github.com/repos/pagarme/pagarme-js","labels_url":"https://api.github.com/repos/pagarme/pagarme-js/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/pagarme/pagarme-js/issues/78/comments","events_url":"https://api.github.com/repos/pagarme/pagarme-js/issues/78/events","html_url":"https://github.com/pagarme/pagarme-js/issues/78","id":250120416,"number":78,"title":"Wrong card number validations","user":{"login":"luccasmaso","id":1427231,"avatar_url":"https://avatars1.githubusercontent.com/u/1427231?v=4","gravatar_id":"","url":"https://api.github.com/users/luccasmaso","html_url":"https://github.com/luccasmaso","followers_url":"https://api.github.com/users/luccasmaso/followers","following_url":"https://api.github.com/users/luccasmaso/following{/other_user}","gists_url":"https://api.github.com/users/luccasmaso/gists{/gist_id}","starred_url":"https://api.github.com/users/luccasmaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luccasmaso/subscriptions","organizations_url":"https://api.github.com/users/luccasmaso/orgs","repos_url":"https://api.github.com/users/luccasmaso/repos","events_url":"https://api.github.com/users/luccasmaso/events{/privacy}","received_events_url":"https://api.github.com/users/luccasmaso/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"MarcoWorms","id":7863230,"avatar_url":"https://avatars2.githubusercontent.com/u/7863230?v=4","gravatar_id":"","url":"https://api.github.com/users/MarcoWorms","html_url":"https://github.com/MarcoWorms","followers_url":"https://api.github.com/users/MarcoWorms/followers","following_url":"https://api.github.com/users/MarcoWorms/following{/other_user}","gists_url":"https://api.github.com/users/MarcoWorms/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoWorms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoWorms/subscriptions","organizations_url":"https://api.github.com/users/MarcoWorms/orgs","repos_url":"https://api.github.com/users/MarcoWorms/repos","events_url":"https://api.github.com/users/MarcoWorms/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoWorms/received_events","type":"User","site_admin":false},"assignees":[{"login":"MarcoWorms","id":7863230,"avatar_url":"https://avatars2.githubusercontent.com/u/7863230?v=4","gravatar_id":"","url":"https://api.github.com/users/MarcoWorms","html_url":"https://github.com/MarcoWorms","followers_url":"https://api.github.com/users/MarcoWorms/followers","following_url":"https://api.github.com/users/MarcoWorms/following{/other_user}","gists_url":"https://api.github.com/users/MarcoWorms/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoWorms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoWorms/subscriptions","organizations_url":"https://api.github.com/users/MarcoWorms/orgs","repos_url":"https://api.github.com/users/MarcoWorms/repos","events_url":"https://api.github.com/users/MarcoWorms/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoWorms/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2017-08-14T18:52:59Z","updated_at":"2017-08-16T01:13:25Z","closed_at":null,"body":"The first case is when passing an empty string, the resulting object asserts `true`. It was supposed to return false, right?\r\n```\r\nimport pagarme from 'pagarme'\r\n...\r\nconsole.log(pagarme.validate({card: {card_number: \"\"}})))\r\n```\r\n\r\n<img width=\"353\" alt=\"screenshot 2017-08-14 15 45 07\" src=\"https://user-images.githubusercontent.com/1427231/29286203-98257722-8107-11e7-97f2-9a2f953b0a25.png\">\r\n\r\nAnother cases are bad errors handling for miscellaneous inputs:\r\n\r\nThis works and returns true, as it should be:\r\n`console.log(pagarme.validate({ card: { card_number: \"4242424242424242\" } }))` \r\n\r\nBut sending the same input as integer:\r\n`console.log(pagarme.validate({ card: { card_number: 4242424242424242 } }))`\r\n<img width=\"367\" alt=\"screenshot 2017-08-14 15 48 28\" src=\"https://user-images.githubusercontent.com/1427231/29286421-6224a3d6-8108-11e7-8a76-dcc6e34730db.png\">\r\n\r\nAlso, this returns true either:\r\n`console.log(pagarme.validate({ card: { card_number: \"424242424242____\" } }))` \r\n\r\nIt took me a while to actually realize what wrong with my code, as the documentation here says nothing about this `validate` method, and the documentation at `https://docs.pagar.me/docs/obtendo-os-dados-do-cartao` is too simple.\r\n"},"comment":{"url":"https://api.github.com/repos/pagarme/pagarme-js/issues/comments/322633354","html_url":"https://github.com/pagarme/pagarme-js/issues/78#issuecomment-322633354","issue_url":"https://api.github.com/repos/pagarme/pagarme-js/issues/78","id":322633354,"user":{"login":"MarcoWorms","id":7863230,"avatar_url":"https://avatars2.githubusercontent.com/u/7863230?v=4","gravatar_id":"","url":"https://api.github.com/users/MarcoWorms","html_url":"https://github.com/MarcoWorms","followers_url":"https://api.github.com/users/MarcoWorms/followers","following_url":"https://api.github.com/users/MarcoWorms/following{/other_user}","gists_url":"https://api.github.com/users/MarcoWorms/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoWorms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoWorms/subscriptions","organizations_url":"https://api.github.com/users/MarcoWorms/orgs","repos_url":"https://api.github.com/users/MarcoWorms/repos","events_url":"https://api.github.com/users/MarcoWorms/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoWorms/received_events","type":"User","site_admin":false},"created_at":"2017-08-16T01:13:25Z","updated_at":"2017-08-16T01:13:25Z","body":"@murilohns ta tranquilo o inglês! :smile: o @piiih estava de olho nessa issue hoje, vou marcar ele aqui pra ele ver esse comportamento\r\n\r\nthanks!"}}
{"actor":{"display_login":"MarcoWorms"}}