Paypal Encrypted Website Payments
I am trying to integrate PayPal Website Payments Standard> Cart Load payment type to cart. I integrated Google Checkout a while ago and I didn't find it too confusing how I do paypal.
I am getting information on how to encrypt it: https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_html_encryptedwebpayments#id08A3I0P017Q
Paypal says I need to create a private key and public certificate using OpenSSL. I went to OpenSSL and downloaded the latest version, which is just a folder containing various files, but I don't see an application that I can use, but not sure what to do here.
Even if I had to open OpenSSL to generate the private key and public certificate, the next step would be to download either the MS or Java command line tool to create an encrypted bucket ahead of time, etc., which sounds crazy to me as I should do it manually before each order.
Obviously I don't know the items in the cart the customer is going to buy before the giveaway, so I need to have this done on the fly on my website using PHP. But I am completely lost. There must be a way to set up dynamic cart loading in PayPal. Can anyone point me in the right direction?
a source to share
First, your problem is with OpenSSL. If you are using Linux or Mac, this 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 the binaries and not the source from this page .
You don't need to use the Java program they provide to create links. This part of the instruction table is for people building static pages, not for using PHP. PayPal is a great solution that gives you a lot of flexibility, but they do it by providing you with many different APIs and ways to process payments. The EWP (Encrypted Website Payments) in the link you provided is not what you are looking for.
It's been a couple of years now since I used PayPal in a client solution. Last time, there was a separate API to do what you ask, called PDT (Payment Data Transfer) . The API has changed a bit since I last used it and the documentation seems to have moved since the last time it was downloaded, but there is still the "Standard Payment Integration Guide for Websites" and "Integration Guide order management ". I still have the instructions you are looking for.
The short answer is that generating encrypted links to create a custom solution is very possible with PayPal, but you need to do some work for that to happen. Documents are hard to find on the site
a source to share
While Nikolai already answered how are you going to generate the private key and certificate you need and suggested using PDT to suit your needs, I also wanted to actually use encrypted payments in PHP as I'm sure some visitors will want to do this.
The server you run the server on will need to have openssl installed (it is installed on most Linux servers) and you will need to do this from php (i.e. using the exec command).
The code for this can be found here:
http://www.stellarwebsolutions.com/en/articles/paypal_button_encryption_php.php
I have used this successfully (after setting up the file variables as they were not matched correctly inside the function).
a source to share
It seems this post seems a little old.
However, I thought I could throw my 2 cents
Paypal now has the option to simply click a checkbox on the Merchant tab that says "Don't accept payments that come from an unencrypted website" ... or something similar.
In addition, there are options (also recommended by Paypal) to upload your own Certificate, generate your own (or public key) and use BOTH to verify and verify that the payment is not fraudulent.
Now I am doing it now. I created Paypal buttons on my website and clicked on the option to decline payments from unencrypted websites.
The problem is that this so-called "security measure" blocks about 50% of clients on my site and for no apparent reason.
This 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 site is equally secure with SSL encryption.
And judging by extensive research on the Internet, most people are of the same opinion as me: an encrypted button isn't worth the time and hassle, especially if it only exposes 50% of your potential customers!
a source to share
For Python users, the python-ewp package respects signature and encryption. * Assuming you have the OpenSSL headers and libraries, installation is as easy as:
pip install ewp
Once you have a string containing strings key=value
, you can pass it in ewp.sign()
to generate a signature and ewp.encrypt()
for encryption:
signature = ewp.sign('test.key', 'test.crt', data)
ciphertext = ewp.encrypt('paypal.crt', signature)
Note that there are three filenames listed:
-
test.key
- private RSA key -
test.crt
- X509 key signed certificate -
paypal.crt
- PayPal Open Certificate
You can create 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
PayPal Certificate can be obtained by following these instructions .
* Disclaimer: I am the author of the package.
a source to share