Why is PayPal not working inside a WinRT WebView control

杀马特。学长 韩版系。学妹 提交于 2019-12-07 19:14:05

问题


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.

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.

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.

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?


回答1:


There's this open source project meant for integrating with PayPal for WinRT http://paypal.github.io/Windows8SDK/




回答2:


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.



来源:https://stackoverflow.com/questions/16244427/why-is-paypal-not-working-inside-a-winrt-webview-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!