Solved

Create an encrytped PayPal button

Posted on 2014-04-09
5
251 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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
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…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

707 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