Paypal Multi currencies button buy - html

I created several buttons buy on Paypal with different currency.
Do you think, is it possible to create one by compiling the codes?
However, I'm a beginner in coding so...I'm a bit lost.
Button buy on paypal code is :
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XXXXCURRENCY">
<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>
I would like to configure a currency selection. I meant, if the buyer wants to buy in $ for example, he will select the currency and press the button buy for going to the paypal product in $
If the buyer wants to buy in € for example, he will select the currency and press the button buy for going to the paypal product in €
Currency:
<select name="currency_code">
<option value="EUR">EUR €</option>
<option value="USD" selected>USD $</option>
</select>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<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">
Where I need to put this 2 lines?
<input type="hidden" name="hosted_button_id" value="xxxxUS">
<input type="hidden" name="hosted_button_id" value="xxxxEUR">
Thank you so much for your help

For this, create an unhosted button.
Go to https://www.paypal.com/buttons , Buy Now button, set your options, and in Step 2 uncheck the option to 'Save your button at PayPal.
When your code is generated, click the option above to remove code protection.
Now all you need is a single <select> input to change the currency_code. There will be no hosted_button_id

Related

How to add more information to PayPal button?

I created a paypal subscription button, but I do not know how to add id number for every product.
The code
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="PULBECSY5HQ2W">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_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>
Any help with this is much appreciated.
This is a hosted button. You will not be able to add additional fields directly to the HTML for a hosted button. Instead, you'll need to make a non-hosted button by unchecking the box for Save at PayPal during the button creation procedure.
This will allow you to add as many standard variables as you want, but would not be as secure as a hosted button.
If you want full flexibility plus security you'll need to switch to using the APIs.

Setting "Note" field in PayPal Donation Form via PayPal Button

I'm trying to set the "write a note" field (which appears in the PayPal donation form) programmatically via a PayPal button. The field can be seen here.
According to the current documentation, it looks like I need to just assign a value to the item_name variable. I have the following HTML, but it doesn't seem to do the trick:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="xxx#xxxxx.com">
<input type="hidden" name="amount" value="10">
<input type="hidden" name="item_name" value="hellooo!!!">
<input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" type="image" />
<img src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" alt="" width="1" height="1" border="0" />
</form>
Note: this code previous worked on the older version of the Donation form. Could this be a breaking change?
With the newer version of the Website Payments Standard checkout flow the "note to seller" is no longer a supported feature.
A workaround for this would be to use an "option variable" to create a textbox in your checkout flow. An example of an option variable would be "os0" and "on0".
Here is an example on our website on how you would implement this: https://www.paypal.com/us/cgi-bin/webscr?cmd=_pdn_xclick_options_help_outside
Here is another link to HTML variable guide:
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
Please let me know if you have any more questions!

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.

PayPal Button As Text Link

Can anyone please tell me how to change a PayPal buy button to a text link? Thanks. Here is the code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XXX">
<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>
Did you try this?
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XXX
You need to replace XXX of course.
The HTML-Code would look like this:
Your Text
For example one with working button id:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7865
Paypal has a builder for doing this. Login to your paypal account. Click on 'Merchant Services'. Choose the button type you want (payment, subscription, etc). Run through the rest of the options. It will generate the button as a form but there is a tab at the top to have it generated as a link. The tab is titled "Email".
After you have created a button, there will be an email link. You can use this as an href="https://www.paypal.com/examplecode/ExampleButtonID".
Check out this Paypal Link Generator.
http://www.blogbyben.com/2009/04/paypal-link-generator-build-your-own-1.html
It does appear that PayPal basically forces you to use an image as the link because it allows them to encrypt some of the data that is sent. Check out "Protecting HTML Code for Payment Buttons" on page 90 of https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_websitepaymentsstandard_integrationguide.pdf
The code you need is:
Text goes here
Replace XXX with whatever your button code is and replace Text goes here with whatever text you wish to show.
The XXX is the hosted button ID, which is usually a 13 character value such as H6C28LJRV72J2.
One solution that has not been posted is for the donate link. Hopefully someone finds this helpful. In addition to what #1' OR 1 -- provided, you can use the below for a text link for donations:
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=INFO#EMAIL.COM&lc=US&item_name=Donation+to+YOUR+BUSINESS+NAME&no_note=0&cn=&curency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted
You'll want to replace INFO#EMAIL.com and Donation+to+YOUR+BUSINESS+NAME with your own information, as well as possibly change currency code.
What about this:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XXX">
<input type="submit" value="submit" 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>
This will give you a button with text.

How to make a .swf object link to paypal the same way as paypal buttons do?

Paypal buttons use forms, ie:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="xxxxxxxx">
<input type="image" src="img.jpg" border="0" name="submit" >
</form>
I'd like buyers to click on a .swf file (instead of an image) which brings them to paypal's checkout, what's the best way to accomplish this?
Thanks
check this tutorial, might help:
http://active.tutsplus.com/tutorials/tools-tips/quick-guide-creating-paypal-buttons-with-actionscript-30/