Paypal 加密网站付款

发布于 2024-08-28 17:09:03 字数 755 浏览 3 评论 0原文

我正在尝试集成 PayPal 网站付款标准 >购物车 将付款类型上传到我的购物车。我不久前集成了 Google Checkout,但我并没有发现它像 Paypal 那样过于混乱。

我从这里获取有关如何加密它的信息: https://cms .paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_html_encryptedweb payments#id08A3I0P017Q

Paypal 说我需要使用 OpenSSL 生成私钥和公共证书。我转到 OpenSSL 并下载了最新版本,它只是一个包含各种文件的文件夹,但我没有看到可以使用的应用程序,不知道在这里要做什么。

即使我要让 OpenSSL 生成私钥和公共证书,下一步也是下载 MS 或 Java 命令行工具,以提前创建包含购物车总额、税费等的加密购物车。对我来说听起来很疯狂,就像我应该在每个订单之前手动执行此操作?

显然,我事先并不知道客户要购买的购物车中的商品,因此我需要使用 PHP 在我的网站上即时完成此操作。但我完全迷失了。必须有一种方法来设置动态安全购物车上传到贝宝。有人可以指出我正确的方向吗?

I am trying to integrate a PayPal Website Payments Standard > Cart Upload payment type into my shopping cart. I integrated Google Checkout a while back and I did not find it overly confusing as I do paypal.

I am getting info on how to encrypt it from here:
https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_html_encryptedwebpayments#id08A3I0P017Q

Paypal says I need to generate a private key and a public certificate using OpenSSL. I went to OpenSSL and downloaded the latest release, which is just a folder containing various files but I see no application I can use, not sure what to do here.

Even if I were to get OpenSSL to generate me a private key and public cert, the next step is to download either an MS or Java command line tool to create the encrypted cart ahead of time with the cart-total, tax, etc. which sounds crazy to me, like I am supposed to manually do this prior to every order??

Obviously I do not know the items in the cart the customer is going to buy before hand so I need this to be done on the fly on my website using PHP. But I am completely lost. There has to be a way to setup dynamic secure cart uploads to paypal. Can someone please point me in the right direction?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

南风起 2024-09-04 17:09:03

首先,你的 OpenSSL 问题。如果您使用 Linux 或 Mac,这很容易(一如既往)。像往常一样安装软件包并使用 paypal 说明页面上的命令。在 Windows 上,请确保您下载的是二进制文件,而不是从此 页面

您不需要使用他们提供的 Java 程序来生成链接。说明书的这一部分是为制作静态页面而不是使用 PHP 的人准备的。 PayPal 是一个大型解决方案,可为您提供巨大的灵活性,但他们通过为您提供许多不同的 API 和处理付款的方式来实现这一点。您发布的链接中的 EWP(加密网站付款)不是您要查找的内容。

自从我在客户解决方案中使用 PayPal 以来,已经有几年了。上次,有一个单独的 API 可以完成您所要求的操作 PDT(付款数据传输)。自从我上次使用它以来,API 发生了一些变化,并且自从我上次下载它以来,文档似乎也发生了变化,但仍然有“网站支付标准集成指南”和“订单管理集成指南”。我认为那些仍然有您正在寻找的说明。

简而言之,使用 PayPal 可以自行生成加密链接来构建自定义解决方案,但您必须做一些工作才能实现这一点。这些文档在网站上很难找到

Firstly, your problem with OpenSSL. If you use linux or Mac it is easy (as always). Install the package as usual and use the command on the paypal instructions page. On Windows, make sure you are downloading binaries not source from this page.

You do not need to use the Java programme they provide to generate the links. That part of the instruction sheet is for people making static pages, not using PHP. PayPal is a big solution that gives you a huge amount of flexibility, but they do that by providing you with lots of different APIs and ways of handling payments. EWPs (encrypted website payments), in the link you posted, are not what you are looking for.

It has been a couple of years now since I used PayPal in a solution for a customer. Last time, there was a separate API to do what you are asking called PDT (Payment data transfer). The API has changed a bit since I last used it, and the documentation seems to have moved around since I last downloaded it, but there is still the 'website payments standard integration guide' and 'order management integration guide'. Those still have the instructions you are looking for I think.

The short answer is that generating the encrypted links yourself to build a custom solution is very possible with PayPal, but you do have to do some work to make it happen. The docs are hard to find on the site

夏花。依旧 2024-09-04 17:09:03

虽然 Nicholas 已经回答了如何生成所需的私钥和证书,并建议使用 PDT 来满足您的需求,但我还想了解如何在 PHP 中实际使用加密支付,因为我确信有些访问者会想要这样做这。

您运行的服务器需要安装 openssl(它安装在大多数 Linux 服务器上),并且您需要能够从 php 执行此操作(即通过 exec 命令)。

此处提供了执行此操作的代码:

http://www.stellarwebsolutions.com/en/articles /paypal_button_encryption_php.php

我成功地使用了这个(在调整文件变量之后,因为它们没有在函数中正确拾取)。

While Nicholas has already answered how you go about generating the private key and certificate you need and suggested using PDT to fufill your needs, I also wanted to pick up on actually using encrypted payments in PHP as I'm sure some visistors will want to do this.

The server you run will need openssl installed on it (it is installed on most Linux servers) and you will need to be able to execute this from php (i.e. via the exec command).

Code to do this is available here:

http://www.stellarwebsolutions.com/en/articles/paypal_button_encryption_php.php

I used this successfully (after tweaking the file variables as they were not being correctly picked up within the function).

安穩 2024-09-04 17:09:03

我想这篇文章似乎有点老了。

尽管如此,我想我可能会投入我的 2 美分

Paypal,现在只需单击“卖家”选项卡上的复选框即可,该选项卡上写着:“不接受来自未加密网站的付款”……或者其他什么相似的。

此外,还有一些选项(Paypal 也推荐)下载自己的证书,生成您自己的证书(或公钥),并使用两者来验证和检查付款是否存在欺诈。

我目前正在做这件事。我在我的网站上创建了 paypal 按钮,并单击了拒绝来自未加密网站的付款的选项。

问题是:这种所谓的“安全措施”阻止了我网站上大约 50% 的客户,而且没有明显的原因。

这就是为什么我正在认真考虑从我的贝宝按钮中删除这个所谓的安全功能!真是麻烦啊。无论如何,所有 PayPal 付款都是安全的,因为它们通过 SSL。我的网站同样受到 SSL 加密的保护。

而且,从网上广泛的研究来看,大多数人的观点与我相同:“加密”按钮不值得花时间和麻烦,特别是如果它只会惹恼 50% 的潜在客户!

This post seems tad bit old, I guess.

Still, I thought I might throw in my 2 cents

Paypal now was the option to simply click a checkbox your "Seller" tab, which states : "Do not accept payments which originate from an unencrypted website"......or something similar.

In addition, there are the options (also recommended by Paypal), to download their own Certificate, generate your own (or a public key), and use BOTH to verify and check that a payment is not fraudulent.

I am currently in the process of doing this right now. I created paypal buttons on my website, and clicked the option to reject payments from unencrypted websites.

The problem is : this so-called "security measure" is blocking about 50% of customers on my website, and for no apparent reason.

Which is why I am seriously considering REMOVING this so-called security-feature from my paypal button! It's a hassle. All paypal payments are secure anyway, as they go through SSL. My website is equally protected with SSL encryption.

And, judging from extensive research online, most people are of the same opinion as I am : the "encrypted" button is not worth the time and trouble, especially if it only pisses off 50% of your potential customers!

心凉 2024-09-04 17:09:03

对于 Python 用户,python-ewp 包负责签名和加密。 * 假设您有可用的 OpenSSL 标头和库,安装就非常简单:

pip install ewp

一旦您拥有包含 key=value 行的字符串,您就可以将其传递给 ewp.sign() 用于生成签名,ewp.encrypt() 用于加密:

signature = ewp.sign('test.key', 'test.crt', data)
ciphertext = ewp.encrypt('paypal.crt', signature)

请注意,提供了三个文件名:

  • test.key - 私有RSA 密钥
  • test.crt - 由密钥签名的 X509 证书
  • paypal.crt - PayPal 的公共证书

您可以使用以下方式生成 RSA 密钥:

openssl genrsa -out test.key 2048

...并创建一个自签名证书签名证书有效期为一年:

openssl req -new -key test.key -x509 -days 3650 -out test.crt

PayPal 证书可以通过以下方式获取:这些说明


* 免责声明:我是该包的作者。

For Python users, the python-ewp package takes care of the signature and encryption. * Assuming you have the OpenSSL headers and libraries available, installation is as simple as:

pip install ewp

Once you have a string containing the key=value lines, you can pass it to ewp.sign() to generate the signature and ewp.encrypt() for encryption:

signature = ewp.sign('test.key', 'test.crt', data)
ciphertext = ewp.encrypt('paypal.crt', signature)

Note that three filenames are provided:

  • test.key - a private RSA key
  • test.crt - an X509 certificate signed by the key
  • paypal.crt - PayPal's public certificate

You can generate an RSA key with:

openssl genrsa -out test.key 2048

...and create a self-signed certificate valid for one year with:

openssl req -new -key test.key -x509 -days 3650 -out test.crt

The PayPal certificate can be obtained by following these instructions.


* Disclaimer: I am the author of the package.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文