venmo / venmo-ios-sdk

Make and accept payments in your iOS app via Venmo
MIT License
178 stars 57 forks source link

Completion Handler Not Working #117

Open akkshay opened 8 years ago

akkshay commented 8 years ago

I have the following code in my app.

Venmo.sharedInstance().sendPaymentTo("TestNumber", amount: 1, note: "Testing", completionHandler: {(transaction: VENTransaction!, success: Bool, error: NSError!) -> Void in if error != nil { print(error) } else { print("no error") } })

When I change TestNumber to a valid number, and run it, the payment goes through but "no error" is not printed to the console. I'm using the AppSwitch mode. I want to be able to make my app execute some code if the payment is successful, but I have no way of knowing whether it is if the completion handler is not working. How can I resolve this issue?

eliperkins commented 8 years ago

Are you completing the app switch? Or is this meant to be triggered by the API? Are there any warnings logged in the console that might be preventing the app switch?

akkshay commented 8 years ago

The AppSwitch is working, but once nothing is being printed to the console. I need to be able to know if the payment was successful so that I can execute some more code in my app.