简体   繁体   中英

Getting callback from payment gateway in webview

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM