Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct Integration - How to receive message when "Safari View Controller" is closed without successful payment #1

Open
Quentie opened this issue Oct 17, 2017 · 0 comments

Comments

@Quentie
Copy link

Quentie commented Oct 17, 2017

Thanks for your nice sample.
I'm currently a bit confused on how I can get a notification if someone hits the "Done" button in the "Safari View Controller" without actually finishing the payment process? I currently only get a message if it worked, but no clue how to find out if not :(

Could you give me a hint?
screen shot 2017-10-17 at 14 43 42

// Direct integration
let url = URL(string: "...")
let request:URLRequest = URLRequest(url : url!);
paypalCheckout.handleIfPPCheckout(request);
// Confusion I only get notified when checkout worked. How do I get notified, when it did not work or someone hit the Done button?
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {

    let instance:PYPLCheckout = PYPLCheckout.sharedInstance() as! PYPLCheckout;
    let wasHandled:Bool = instance.openURL(application, open: url as URL, sourceApplication: sourceApplication as String!, annotation: annotation);

    if (wasHandled) {
        print("worked")
    }

    return wasHandled
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant