Pago Payment Gateway Integration

I would like to add a payment module in my Iphone application that I am about to build,

I want users to pay using Pago. When the web page loads, a button is displayed, when the button is clicked, a new page opens in a new window.

On this page, the user enters payment details and the payment is processed. Since we have no control over this window, so we cannot name our custom url to return to our application upon successful payment.

So how can I return to the App after successful payment?

+3


source to share


2 answers


There is no easy way to do this. Try opening the page in Web View and add when the success page URL matches the URL in Web View displaying a success message.



+1


source


I want users to pay using Pago. When the webpage loads, does the button show when clicked? the button opens a new page in a new window.

Does a new page open in a web browser in your application?



If so, you just need to get the url you receive from a successful payment (if you can) and use the following webview delegation method to catch the url:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
  NSString *urlString = [NSString stringWithFormat:@"%@", request.URL];

  // If not found, load url
  if ([urlString rangeOfString:@"http://you-url"].location == NSNotFound)
  {
    return YES;
  }
  // If found, intercept
  else
  {
    // Do what you want here
    return NO;
  }
}

      

0


source







All Articles