2

I am using Atom Payment Gateway for payments in my Android app. But this provider doesn't have an SDK for mobile platforms, also I cannot choose another provider because my client has been using Atom PG for their website for a long time.

So to make it work, I am now trying to call it in a webview in my app. All goes well until the last step except that I am not able to get the response from the PG upon completion of transaction.

As per their documentation:

After the completion of the transaction, the response will be posted back to the url provided by the merchant.

I already tried setting the return url to my reverse domain name and then setting an intent-filter but that doesn't seem to work.

Is there any method by which I can get the response that the PG "posts back" to the return url?

halfer
  • 19,824
  • 17
  • 99
  • 186
ShahiM
  • 3,179
  • 1
  • 33
  • 58
  • I am having the exact same issue, can you tell me how you fixed this? – Syn3sthete Jun 29 '17 at 19:06
  • We ended up using a different provider. Their model was not suitable for mobile applications. It may be solved by using @chiragjn's suggestion, but it would not be pretty. – ShahiM Jul 01 '17 at 20:27

1 Answers1

2

Here is an idea, On getting the post request on your return url, you can parse that response and then via javascript send that to the JavascriptInterface linked to your WebView in the app

Intercepting POST data has been discussed:

How to intercept POST data in an android webview

Intercept POST requests in a WebView

Try this project : https://github.com/KeejOow/android-post-webview

Community
  • 1
  • 1
chiragjn
  • 764
  • 11
  • 31
  • Yeah that would require a server right? is there any way to catch that POST data in the webview itself? now it just redirects to the return url. – ShahiM Jun 25 '15 at 05:57
  • Is there any workaround to get the Post data (Form data received as request parameter) in the callback URL opened in the browser itself ? – Muthuraja Nov 08 '21 at 06:57