{"action":"created","issue":{"url":"https://api.github.com/repos/stripe/stripe-ios/issues/166","labels_url":"https://api.github.com/repos/stripe/stripe-ios/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/stripe/stripe-ios/issues/166/comments","events_url":"https://api.github.com/repos/stripe/stripe-ios/issues/166/events","html_url":"https://github.com/stripe/stripe-ios/issues/166","id":85164540,"number":166,"title":"Swift simple example fails when it should succeed and vise-versa","user":{"login":"robseward","id":228954,"avatar_url":"https://avatars.githubusercontent.com/u/228954?v=3","gravatar_id":"","url":"https://api.github.com/users/robseward","html_url":"https://github.com/robseward","followers_url":"https://api.github.com/users/robseward/followers","following_url":"https://api.github.com/users/robseward/following{/other_user}","gists_url":"https://api.github.com/users/robseward/gists{/gist_id}","starred_url":"https://api.github.com/users/robseward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robseward/subscriptions","organizations_url":"https://api.github.com/users/robseward/orgs","repos_url":"https://api.github.com/users/robseward/repos","events_url":"https://api.github.com/users/robseward/events{/privacy}","received_events_url":"https://api.github.com/users/robseward/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-04T16:09:57Z","updated_at":"2015-06-04T17:26:00Z","closed_at":null,"body":"I'm new to this, so sorry if I'm misunderstanding something, but I think a conditional in the Apple Pay flow in the iOS example is incorrect.\r\n\r\nHere's the line: https://github.com/stripe/stripe-ios/blob/master/Example/Stripe%20iOS%20Example%20(Simple)/ViewController.swift#L80\r\n\r\nMy understanding is it should be like this:\r\n\r\n```swift \r\napiClient.createTokenWithPayment(payment, completion: { (token, error) -> Void in\r\n            if error == nil {\r\n                  //create backend charge with token\r\n                  //on success call completion with success status\r\n                  return\r\n            }\r\n            //completion with failure status\r\n}\r\n```\r\n\r\nWhile instead the conditional in the current code reads `if error != nil` instead of `if error == nil`.\r\n"},"comment":{"url":"https://api.github.com/repos/stripe/stripe-ios/issues/comments/108982330","html_url":"https://github.com/stripe/stripe-ios/issues/166#issuecomment-108982330","issue_url":"https://api.github.com/repos/stripe/stripe-ios/issues/166","id":108982330,"user":{"login":"jflinter","id":740583,"avatar_url":"https://avatars.githubusercontent.com/u/740583?v=3","gravatar_id":"","url":"https://api.github.com/users/jflinter","html_url":"https://github.com/jflinter","followers_url":"https://api.github.com/users/jflinter/followers","following_url":"https://api.github.com/users/jflinter/following{/other_user}","gists_url":"https://api.github.com/users/jflinter/gists{/gist_id}","starred_url":"https://api.github.com/users/jflinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jflinter/subscriptions","organizations_url":"https://api.github.com/users/jflinter/orgs","repos_url":"https://api.github.com/users/jflinter/repos","events_url":"https://api.github.com/users/jflinter/events{/privacy}","received_events_url":"https://api.github.com/users/jflinter/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T17:26:00Z","updated_at":"2015-06-04T17:26:00Z","body":"Yep, that is indeed a huge typo on our end, thanks for pointing that out!\r\n\r\nYou mentioned you're new to things - would you be interested in submitting a pull request that fixes this? Happy to help you do it if you're interested. If not, I'll fix things up myself."}}