Solved

Create an encrytped PayPal button

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

679 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