Solved

Create an encrytped PayPal button

Posted on 2014-04-09
5
250 Views
Last Modified: 2016-03-24
I must be brain dead. I found this paypal code for sending the items of a shopping cart to paypal.  Works great, but one problem.  See where it says you should be using an encrypted button?  I tried making a new button at paypal, but it always asks me to enter a price.


Important: The example button code shown below is unencrypted for illustrative purposes only. In reality, you must always use encrypted or hosted buttons in your web pages to prevent malicious users from tampering with the code. See Securing Your PayPal Payments Standard Buttons for instructions.

HTML for Passing Individual Item Detail to PayPal

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="seller@dezignerfotos.com">
<input type="hidden" name="item_name_1" value="Item Name 1">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="shipping_1" value="1.75">
<input type="hidden" name="item_name_2" value="Item Name 2">
<input type="hidden" name="amount_2" value="2.00">
<input type="hidden" name="shipping_2" value="2.50">
<input type="submit" value="PayPal">
</form>

Open in new window

0
Comment
Question by:rrhandle8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39990837
That's right, one Button for each item with a specific price.  To use a different price and description each time, you would have to use Paypal Express Checkout which is a pretty complicated procedure involving multiple pages.
0
 

Author Comment

by:rrhandle8
ID: 39992328
I have a shopping cart script.  I can read the contents, and put together form like the one above.  Click the button, and I end up at PayPal with all the individual items listed there.  Exactly what I want.  My concern is the "Important" selection in my first post.  It says you should be using an encrypted button.  Do you see the problem?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39992618
The only problem is that you are not using Paypal's recommended methods.  They really don't want you putting things in a shopping cart that way (unencrypted) because other people can view and steal your code.  The Express Checkout obscures all the details so they can't be seen but it's a lot more work.
0
 

Author Comment

by:rrhandle8
ID: 39992706
OK.  It looks like you are saying I have to use the Express Checkout to do this the way I want.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39992719
No, you have to use Express Checkout to do it the way that Paypal wants.  What you are doing is a whole lot easier than Express Checkout.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
video playback resume on webpages 2 88
Paypal Simple Interface 4 78
site launch date and last modified date 3 109
Adding a hidden div to each row in a table 6 113
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question