简体   繁体   English

在Windows Phone 8.1中使用什么来支付Paypal付款

[英]What to use to make a Paypal Payment in Windows Phone 8.1

I need to make a simple paypal payment from my Windows Phone app. 我需要从我的Windows Phone应用程序中进行简单的PayPal付款。 I used to use PayPal's Windows 8 SDK, but it has been discontinued so I can't even get the old SDK from the official github page ( http://paypal.github.io/Windows8SDK/ ). 我曾经使用PayPal的Windows 8 SDK,但它已经停产,所以我甚至无法从官方的github页面( http://paypal.github.io/Windows8SDK/ )获得旧的SDK。

The other options seems to require an integration on a web page. 其他选项似乎需要在网页上进行集成。 I've tried looking at similar questions on SO but they're either outdated, or where before / while there still was the Windows 8 SDK, so they're not valid anymore. 我已经尝试在SO上查看类似的问题,但它们要么已经过时,要么在之前/之前还有Windows 8 SDK,所以它们已经无效了。

Upon further inspection, it would seem the SOAP API don't work because importing them won't generate PayPalAPIAASoapBinding (same behaviour as a Console application, which I fixed importing an old Web Reference, which is not possible on WP) and REST APIs rely on Paypal nuGet package which can't be used in Windows Phone ( https://developer.paypal.com/docs/api/ ). 经过进一步检查,似乎SOAP API不起作用,因为导入它们不会生成PayPalAPIAASoapBinding (与控制台应用程序相同的行为,我修复了导入旧的Web引用,这在WP上是不可能的)并且REST API依赖在Paypal nuGet包中,不能在Windows Phone中使用( https://developer.paypal.com/docs/api/ )。

I am currently at a loss for options (Except to set up an external website to do the job). 我目前无法选择(除了设置一个外部网站来完成这项工作)。

Having faced all the aforementioned problems (I still don't know why Paypal pulled the plug for Windows Phone support), I found a workaround. 面对所有上述问题(我仍然不知道为什么Paypal拔掉了Windows Phone支持的插件),我找到了解决方法。

  • I generated a Paypal Buy Now button ( https://www.paypal.com/uk/webapps/mpp/get-started-payment-buttons ), the unencrypted & non account saved version. 我生成了Paypal立即购买按钮( https://www.paypal.com/uk/webapps/mpp/get-started-payment-buttons ),未加密和非帐户保存的版本。
  • I copied the code in an html file within my app and used some markers on the hidden fields that interested me (description of the product, amount, shipping costs, etc.). 我在我的应用程序中的html文件中复制了代码,并在我感兴趣的隐藏字段上使用了一些标记(产品说明,金额,运费等)。
  • From my previous page the user will select the product details he wants to purchase, such details will be passed to another page in which I have among other things a WebBrowser control. 在我的上一页中,用户将选择他想要购买的产品详细信息,这些详细信息将被传递到另一个页面,其中我有一个WebBrowser控件。
  • I will replace the markers with the details passed from the previous page and load the html in the WebBrowser . 我将使用从上一页传递的详细信息替换标记,并在WebBrowser加载html。
  • The user can then proceed with the purchase. 然后,用户可以继续购买。

I am considering about making this into an open source plugin / library to make things easier for the fellow developers hit by my same issue, will update this with the link if I find the time to do so. 我正在考虑将其变成一个开源插件/库,以便让遇到同样问题的开发人员更轻松,如果我找到时间,可以用链接更新这个。

Unfortunately with PayPal discontinuing the WIN8 SDK, the only available solution as of now is to setup a website integration, and embedding the page with your webbrowser kit in your WIN8 APP. 不幸的是,随着PayPal停止使用WIN8 SDK,目前唯一可用的解决方案是设置网站集成,并在您的WIN8 APP中使用您的webbrowser工具包嵌入页面。

Just so you know the existing WIN SDK API integration is still being supported, you may refer here for a backup git of the WIN8 SDK library. 您知道现有的WIN SDK API集成仍然受支持,您可以在这里参考WIN8 SDK库的备份git。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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