Solved

Create an encrytped PayPal button

Posted on 2014-04-09
5
241 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
  • 3
  • 2
5 Comments
 
LVL 82

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 82

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 82

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now