Hi, all - I'm a newbie who just spent all day today trying to add
a single PayPal button to my site (built in VWD2005X Ed). I am not using a
starter kit and literally just wanted to add an encrypted Buy Now
Button to my page. Here's what I tried, and here's what WORKED.
---------------------------------
THE QUICKEST SOLUTION:
1) PayPal link (vs. a button) - This works great and quickly if you don't mind not having encryption:
<a
href="
https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=YourPaymentEmailAtPayPal&item_name=YourItemName&item_number=YourItemNumber&amount=PriceNoDollarSign">
</a>
plus,
you can add the real PayPal button image as the hyperlink image by
referencing the PayPal button URL provided in the form code PayPal
created for your button (<IMG src="https://www.paypal.com,
etc.">. Voila - you have a button - just no encryption.
My thanks to Ahmad at PayPal Merchant Tech support (http://www.pdncommunity.com/pdn/board/message?board.id=basicpayments&message.id=2477&jump=true#M2477)
--------------------------------
THE BEST SOLUTION (if your host security settings allow it):
2)
PayPal Developer modules - I downloaded these and the Buy Now Button
worked beautifully locally. But as soon as I uploaded it to my Go Daddy-hosted
site, I got an error page: "That assembly does not allow partially
trusted callers." If you don't get that error page, go with
these; they are easy and fantastic. You will need to download
them, install them, add some code to your web.config (per instructions)
open VWD and choose Website/Add Reference and check the new PayPal
control listing, then go to Tools/Choose Toolbox Items and check the
new PayPal controls, which will then populate the bottom of your
toolbox.
My thanks to PayPal for this comprehensive solution - I wish it had worked with my host!
Download PayPal's developer kits by logging in at www.paypal.com,
then going to Merchant Services / PayPal Developer Network (near bottom
of page) / SDKs and Toolkits (left menu). The Developers’
Toolkits are enough for simple buttons, but there are Pro kits for
payment on your site.
-------------------------------
THE SIMPLEST SOLUTION.
3) For me, the perfect answer was IFRAMES. Someone
casually
referenced it in a listing here (thanks - can't find you again in the
long list of PayPal pleas!), but there was no explanation of how to
do it. So I went on a Google hunt!
For any other newbies in need of a very easy solution to your trusted PayPal button on a .NET 2.0 page, all you do is:
A) SAVE PAYPAL'S GENERATED BUTTON FORM AS AN INDEPENDENT HTML FILE IN YOUR VWD PROJECT. Name it, for example, paypalbutton.htm.
- In your PayPal Form code, add target=_top to make sure PayPal opens
in the full browser window, not inside of the IFRAME. You also could
set target=_blank if you want PayPal to open in a new window.
- Be sure to set the doc's body background color to transparent, just
for aesthetics (CSS is best, body style='background-color: transparent'
attribute works fine.)
B) REFERENCE YOUR NEW PAYPAL HTML FILE IN AN IFRAME ON YOUR ASPX PAGE.
Wherever you want the button to appear on the page, place your
IFRAME code, indicating source=paypalbutton.htm (be directory specific,
of course). You can set the height pretty small to fit the button, and
set the width however long you need to be able to align the button left
or right on your page.
- Be sure to set the IFRAME for allowtransparency=true for aesthetics
That's it! I found this through http://dotnetjunkies.com/WebLog/adambeal/archive/category/2695.aspx and fooled around with it until it was consistent in Netscape, IE and Firefox. Thanks, Adam.
Hope this saves someone else a full day of trial and error!
Does anyone know of any security issues with this approach? dma