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?
Asked
Active
Viewed 286 times
1 Answers
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
-
means..in back end I need to set return url in paypal?? And then I have to check if web view has load that url then close that web view? – vivek bhoraniya Apr 22 '14 at 13:26
-
Yes you can do it like that. – Alexis Apr 22 '14 at 13:28
-
ok gr8...I was thinking same....but doing it first time so I thought may be possible better way then this....thank you – vivek bhoraniya Apr 22 '14 at 13:42