Is it possible to specify the PayPal fixed donation amount in the querystring parameters? - html

Let's suppose we have an <input> element where the user can enter a number (e.g. 500).
When clicking some button or so, I want the user to be redirected to the PayPal donation page where they can specify the ammount but to have the default value set to the number set in the input (500 in this case).
Does the PayPal url allows such an option (maybe via querystring parameters)?

Yes it is possible. You will need to create an open source Donation Button in order to have your donors add the donation amount from the form you create rather than on the PayPal Hosted page.
You need to add this to your donation button code
<input type="text" name="amount" size=10><br /><br />
Below is the complete Donation Button Sample code.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_donations">
<!-- Update to Your PayPal Email or Merchant ID -->
<input type="hidden" name="business" value="youremail#email.com">
<input type="hidden" name="lc" value="US">
<!-- Update the Value to the Donation Name -->
<input type="hidden" name="item_name" value="Test Donations"><p>Please Enter an Amount</p>
<!-- The below will allow your customers to enter an amount and this gets passed to PayPal -->
<input type="text" name="amount" size=10><br /><br />
<!-- The rest is the normal PayPal Donation button Info -->
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the seller:">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Creating Donation Buttons

Related

How do I add shipping values per item?

I am using Joomla for my website which has some items for sale. I have hard coded the paypal buttons and costs for this and it works well:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal">
<input alt="Add this item to your order" name="submit" src="/add-to-order.gif" type="image" />
<input name="add" type="hidden" value="1" />
<input name="cmd" type="hidden" value="_cart" />
<input name="business" type="hidden" value="name#name.co.uk" />
<input name="item_name" type="hidden" value="Item name" />
<input name="amount" type="hidden" value="500.00" />
<input name="no_shipping" type="hidden" value="2" />
<input name="currency_code" type="hidden" value="GBP" />
<input name="bn" type="hidden" value="PP-ShopCartBF" />
</form>
However, I wanted to add shipping values per item. These will be different depending on region of delivery and item. Is this all handled in the back end paypal set up? Or do I need to pass in these values? Any advice would be great thanks as im unsure of how to proceed.
For that PayPal integration, which is very old (about 20 years), the variables available for shipping and everything else are all documented here. The cart upload command specifically is explained here.
A current PayPal Checkout is much different.

PayPal HTML form Basics with unencrypted values

is it still possible to use the PayPal HTML form Basics with unencrypted values in hidden fields? I know that people can change easily the value in the form, but can I use it or there is a problem with PayPal? Can PayPal block or limit my account if in my site I use this kind of form to pass the payment value? Thanks
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="seller#site.com">
<input type="hidden" name="item_name" value="hat">
<input type="hidden" name="item_number" value="123">
<input type="hidden" name="amount" value="15.00">
<input type="hidden" name="first_name" value="John">
<input type="hidden" name="last_name" value="Doe">
<input type="hidden" name="address1" value="9 Elm Street">
<input type="hidden" name="address2" value="Apt 5">
<input type="hidden" name="city" value="Berwyn">
<input type="hidden" name="state" value="PA">
<input type="hidden" name="zip" value="19312">
<input type="hidden" name="night_phone_a" value="610">
<input type="hidden" name="night_phone_b" value="555">
<input type="hidden" name="night_phone_c" value="1234">
<input type="hidden" name="email" value="jdoe#test.com">
<input type="image" name="submit"
src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif"
alt="PayPal - The safer, easier way to pay online">
</form>
For backwards compatibility with old websites, legacy HTML forms like this will still work. They redirect to the PayPal site, and the PayPal site securely collects the payment information.
However, there is absolutely no reason to use an HTML form. The current HTML/JS Checkout integration supports all the same features of the above and more. It presents a modern, in-context experience and does not redirect away from your site.

I need to remove a donate image which works like button and lands a user to official paypal payment website

Paypal has an option to generate donate button if u go to this link generate donation button by entering data asked by paypal
the image used by paypal is ugly and becomes blur when zoomed so I decided to change the the image but when I tried changing the image to actual button using tags the link did not work. I also tried changing type=image to type=button still my problem was not resolved. this is how it looks enter image description here
the html code is
<div class="donate">
<form action="https://www.paypal.com/donate" method="post" target="_top">
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="business" value="prabcrist#gmail.com" />
<input type="hidden" name="item_name" value="Server cost and keeping site live" />
<input type="hidden" name="currency_code" value="USD" />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" name="submit" title="safer way to apy online" alt="Donate with PayPal button" />
</form>
</div>
the html I used
<div class="donate">
<form action="https://www.paypal.com/donate" method="post" target="_top">
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="business" value="prabcrist#gmail.com" />
<input type="hidden" name="item_name" value="Server cost and keeping site live" />
<input type="hidden" name="currency_code" value="USD" />
<input type="button" value="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" name="submit" title="safer way to apy online" alt="Donate with PayPal button" />
</form>
</div>
</li>
Remove the image 'src' attribute if you want it to be a regular, non-image button. However, it won't look very good unless your page has CSS styling.
Maybe find a different image you like better.

Is there a way to not have a from tag create a tab?

I am making a simple website with a shopping cart and I am using the Paypal "add to cart" button code:
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr"
method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="kin#kinskards.com">
<!-- Specify a PayPal Shopping Cart Add to Cart button. -->
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="Birthday - Cake and Candle">
<input type="hidden" name="amount" value="3.95">
<input type="hidden" name="currency_code" value="USD">
<!-- Display the payment button. -->
<input type="image" name="submit"
src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_addtocart_120x26.png"
alt="Add to Cart">
<img alt="" width="1" height="1"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
</form>
I also have a shopping cart logo on the upper right corner and I only want the cart to be accessible through clicking the logo. Is there any way to have the form send the data to the paypal shopping cart but not open the shopping cart tab/window?
Change target=paypal to target="_self" : https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/html_example_cart/#open-shopping-cart-in-the-merchant-window

How can I prevent users from modifying PayPal code?

I have a "Pay Now" button from Paypal on my website. However, anyone can easily modify the amount they have to pay.
Here's the code that PayPal generated:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="xxx">
<input type="hidden" name="lc" value="CA">
<input type="hidden" name="amount" value="**1000.00**">
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Anyone can change the "1000.00" to "100.00". Is there a way to prevent this or a better way to accept payments?
take a look at Securing Your Website Payments Standard Buttons it outlines some of things you can do to protect yourself from this. One of the things is to create buttons with their online tool, and save them. When a purchase is made, they compare it with the saved button and check to make sure they are the same.