0

In my application I want to use chain payment , as paypal ios sdk doesn't support chain payment I am involving back end to this functionality. Now in back end side they are giving me one url which I need to load in web view . This url is of chain payment , user will login to paypal from that url and will do transaction. But then after completion of transaction I need to close that web view. How to detect that transaction is completed in web view?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
vivek bhoraniya
  • 1,526
  • 2
  • 17
  • 36

1 Answers1

1

You need to set you controller as a UIWebViewDelegate and implement this method :

- (void) webViewDidFinishLoad:(UIWebView *)webView {

    NSString *url = self.webView.request.URL.absoluteString;

    if ([url isEqualToString:@"your confirmation page URL"]) {

        // dismiss the view controller or navigate to a beautiful confirmation view
    }
}

Of course this assumes you have a webView property on your view controller that points to you UIWebView.

Alexis
  • 16,629
  • 17
  • 62
  • 107