为什么PayPal在WinRT WebView控件中不起作用 [英] Why is PayPal not working inside a WinRT WebView control

查看:82
本文介绍了为什么PayPal在WinRT WebView控件中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Windows 8应用程序,用户可以在其中进行应用程序内购买.我们的客户为我们提供了REST API.基本上,我是从REST API获取产品信息的,如果用户选择购买产品,我会告诉REST API开始交易.

I am writing a Windows 8 app where the user is able to do in-app purchases. Our Client provides us with a REST API. Basically I get product information from this REST API and if the user chooses to buy a product I tell the REST API to start a transaction.

结果是,我收到付款交易的PayPal URL.我正在使用WinRT中内置的WebView控件导航到该URL.不幸的是,贝宝​​网站在WebView控件中的行为不正常.当我登录PayPal时,会加载我可以为产品付款的购买概述页面,但是一两秒钟后,WebView重新加载,我再次进入登录页面.

As a result I am receiving a PayPal URL for the payment transaction. I am navigating to that URL using the WebView control that is built into the WinRT. Unfortunately the PayPal website does not behave properly in the WebView control. When I am signing into PayPal, the purchase overview page where I am able to pay for the product is loaded, but after one or two seconds the WebView reloads and I am on the sign-in page again.

起初,我认为我的应用存在一个特定的问题,所以我启动了一个新的香草项目,该项目仅托管一个WebView控件,该控件导航到PayPal URL(没有任何其他交互作用或任何东西).但是我仍然得到了相同的结果.

At first I thought there was a problem that is specific to my app, so I started a new vanilla project, which just hosts a WebView control that navigates to the PayPal URL (there is no other interaction or anything). But still I got the same result.

如果我在其他浏览器(例如Firefox,Chrome,Internet Explorer 10或Metro Style Internet Explorer)中尝试使用贝宝(PayPal)URL,则一切正常,并且无法重现该错误.所以我想WebView控件有问题.

If I try the PayPal URL in other browsers (e.g. Firefox, Chrome, Internet Explorer 10 or Metro Style Internet Explorer) everything works fine and I could not reproduce the error. So I guess there is something wrong with the WebView control.

现在我想知道是否还有其他人遇到相同的问题,以及您能否给我一些有关如何解决此问题的指示?

Now I am wondering if anyone else had the same problem and if you could give me some pointers on how to solve this problem?

推荐答案

我联系了贝宝(PayPal)宣传人员,我们发现问题可能是WebView正在发送其自己的用户代理字符串. PayPal拒绝使用WebView,因为程序员可能会向其中注入JavaScript(例如,用于调用支付"按钮或窃听客户数据).所以我猜@stark是正确的.正如我已经告诉@Adam Tuliper一样,我们从受支持的付款提供商列表中删除了PayPal.

I contacted a PayPal evangelist and we figured out that the problem might be that the WebView is sending it's own user agent string. PayPal refuses to work with the WebView because the programmer might inject JavaScript into it (e.g. for invoking the pay button or eavesdrop on customer data). So I guess @stark was right. As I have already told @Adam Tuliper, we removed PayPal from our list of supported payment providers.

这篇关于为什么PayPal在WinRT WebView控件中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆