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?
source to share
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;
}
}
source to share