Why is PayPal not working inside a WinRT WebView c

2019-05-28 22:09发布

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?

2条回答
Summer. ? 凉城
2楼-- · 2019-05-28 22:30

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

查看更多
贼婆χ
3楼-- · 2019-05-28 22:36

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.

查看更多
登录 后发表回答