gpt4 book ai didi

android - 在 webview 中从支付网关获取回调

转载 作者:可可西里 更新时间:2023-11-01 17:08:18 24 4
gpt4 key购买 nike

我正在使用 Atom在我的 Android 应用程序中用于支付的支付网关。但是这个提供商没有用于移动平台的 SDK,我也不能选择其他提供商,因为我的客户长期以来一直在他们的网站上使用 Atom PG。

因此,为了使其正常工作,我现在尝试在我的应用程序的 WebView 中调用它。一切顺利,直到最后一步,除了我无法在交易完成后得到 PG 的响应。

根据他们的文档:

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

我已经尝试将 return url 设置为我的反向域名,然后设置 intent-filter 但这似乎不起作用。

有什么方法可以让 PG“回发”到返回 url 的 response

最佳答案

这是一个想法,在返回 url 上获取发布请求后,您可以解析该响应,然后通过 javascript 将其发送到 JavascriptInterface在应用程序中链接到您的 WebView

已经讨论了拦截 POST 数据:

How to intercept POST data in an android webview

Intercept POST requests in a WebView

试试这个项目:https://github.com/KeejOow/android-post-webview

关于android - 在 webview 中从支付网关获取回调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31024951/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com