What's the easiest way to add a Paypal Donate button? I've tried just adding the code, but it seems as though tags are being filtered. I've got the LM_Paypal module, but it's really too complex for what I want to do, not to mention I want anonymous users to be able to donate.

Comments

vm’s picture

should be able to add it to a newly created block ? Tags won't get filtered, if you switch your input format to FULL HTML before submission.

Sadmir’s picture

VeryMisunderstood is right
Thats how I got it to work on my site...

www.TechFeed.ca | Your Daily Technology Feed Source

jaarong’s picture

Thanks for the replies. So, I won't be able to put a donate button on a page?

boriso’s picture

You can add a paypal button, if you have a paypal account. You will just copy the code generated from the paypal website

You can create various buttons for merchant accounts : for example :

https://www.paypal.com/row/cgi-bin/webscr?cmd=_merchant
https://www.paypal.com/row/cgi-bin/webscr?cmd=_xclick-donations-factory
https://www.paypal.com/row/cgi-bin/webscr?cmd=_web-tools

on your drupal page (of course to access those pages, you have first to login on paypal.com).

Be sure to choose "php" as the input format for the page in which you enter your code, and if you choose encryption for your buttons, you should avoid "breaking lines automatically" (an option in the drupal input formats) -- at least that's how it worked for me.

I struggled for a long time with the various paypal modules for drupal, because I was hoping to avoid sending my customers on the paypal website (because paypal doesn't care about multilingualism and my customers do). But as far as I understand (someone correct me if I am wrong), these drupal modules mainly help you keep track of the transactions on your paypal account right within your drupal website (so perhaps you could add a block with recent donations, etc).

my buttons look like this :

http://www.esperanto.qc.ca/en/paiement

/boris

trantt’s picture

My paypal block is much bigger than the paypal donate button, is there a way to reduce the size of paypal donate block?

I copied and pasted the below html syntax to my block body:
<* form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post" *>
<* input type="hidden" name="cmd" value="_xclick"*>
<* input type="hidden" name="business" value="test@mysite.org"*>
<* input type="hidden" name="item_name" value="Donate to the poor children of the world"*>
<* @input type="hidden" name="currency_code" value="USD"*>
<* input type="hidden" name="amount" value=""*>
<* input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"*>

Thanks

vm’s picture

you sould view the source of the page, after it is rendered in your browser and try to determine where the excess lines are coming from. Are the <p> tags, if so, you need to disable the line break fliter in the FULL HTML filter and resubmit the block so that the <p> are removed.

trantt’s picture

VeryMisunderstood,

I noticed you got a paypal block on your website, can you show me how you did it?
2ndly, I don't think my method is working for the following reasons:

1. block is bigger than the paypal button (ugly): i looked at the source file and there wasn't any but however, I saw an extra <* /p> with out any

2. once I save it, I couldn't able to modify any other blocks (including the paypal block). In another word, when the block's save block button was clicked, it took me directly to the paypal donation page. I think this was because of the <@form name="_xclick" syntax

Creating a donation button is much harder than I thought. Please help

vm’s picture

I do not have a paypal donation button on my site.

What I need to know is where you got the HTML to add to the block ? from the readme of one of the modules ? you state you have them all installed. which one of them are involved with the block ?

have you read the readme.txt files and install.txt files of the modules ? do the project pages, offer any clues ? or links to documentation or demo sites ?

trantt’s picture

My bad, I thought you owned http://www.techfeed.ca/ . Anyway, I looked at this website and I think they are having the same problem as well (block is few line larger than the actual donate button). Please go to the techfeed.ca website and view the source. My syntax and this website syntax are almost the same.

have I read the readme.txt and install.txt files? Yes I've. I'm doing this on all the new modules that I'm installing.

Just like I said previously, I wonder why adding a donation paypal block is so difficult...

Thanks

vm’s picture

take a look at the source.

looking at that sites source I see

  <div class="content"><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"><br />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
<input type="hidden" name="cmd" value="_xclick"><br />
<input type="hidden" name="business" value="techfeed.ca@gmail.com"><br />
<input type="hidden" name="item_name" value="Please specify on your right how much you would like to donate to TechFeed.ca..."><br />
<input type="hidden" name="no_shipping" value="0"><br />
<input type="hidden" name="no_note" value="1"><br />
<input type="hidden" name="currency_code" value="USD"><br />
<input type="hidden" name="tax" value="0"><br />
<input type="hidden" name="lc" value="CA"><br />
<input type="hidden" name="bn" value="PP-DonationsBF"><br />
</form>
</div>

SEE THE LINE BREAKS!!!! <br /> after every line. THATS what's causing the extra white space seen after the paypal button. One would need to goto administer-> input formats and reconfigure the FULL HTML input format to NOT use line breaks. the go back to administer blocks resubmit the code. This will stop the <br /> from being added. Thus eliminating the extra space.

When you view the rendered page source of your page in the browser, is it doing the same thing ?

trantt’s picture

"after every line. THATS what's causing the extra white space seen after the paypal button. One would need to goto administer-> input formats and reconfigure the FULL HTML input format to NOT use line breaks."

2 reasons why I don't want to go with this route:

1. reconfigure the full html input format is not an option because it will affect the entire website
2. I was able to remove all the line breaks by having all html syntax in one long line but however, the problem is still existed (yes, the block is little bit smaller but it is still big). http://www.techfeed.ca/ put the paypal block on the bottom for a reason.

vm’s picture

if you were to remove the line breaks for this specific submit, it would not affect the entire website, as you can switch it back AFTER you add the donate block ?

and your line breaks are not removed.

<div id="block-block-8" class="clear-block block block-block">

  <h2>Make a donation</h2>

  <div class="content"><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"><br />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
<input type="hidden" name="cmd" value="_xclick"><br />
<input type="hidden" name="business" value="techfeed.ca@gmail.com"><br />
<input type="hidden" name="item_name" value="Please specify on your right how much you would like to donate to TechFeed.ca..."><br />
<input type="hidden" name="no_shipping" value="0"><br />
<input type="hidden" name="no_note" value="1"><br />
<input type="hidden" name="currency_code" value="USD"><br />
<input type="hidden" name="tax" value="0"><br />
<input type="hidden" name="lc" value="CA"><br />
<input type="hidden" name="bn" value="PP-DonationsBF"><br />
</form>
</div>

you could also go the route of adding an input format, specifically for this task with the line breaks OFF!.

trantt’s picture

"I was able to remove all the line breaks by having all html syntax in one long line"

First of all VeryMisunderstood, thank you for spending time to us on many issues... 2ndly, as I mentioned on my previous post, removing the < br /> won't do the work neither. The block is little bit smaller but is is still much larger than the actual paypal button. You can try it yourself and see the result that I was talking about...

trantt

fenimore’s picture

I've created a block containing the PayPal button and it shows up if I apply the block to particular nodes using 'configure'. But I need to add the button to certain areas of the content region on different pages. Is it possible to add a block (in my case a PayPal button) anywhere in a node while publishing in 'Full HTML'?

For instance:

Title

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat. (PayPal button block)
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat. (PayPal button block)

Squalls_Dreams’s picture

if say you were selling somethin and you put a pay now button or what ever for the item your selling, do you need a visa card or what ever so that the payment can go through or do you just need your bank account on paypal so the payments can go through? lets say someone bought the item I was sellin and they used a credit card or just paypal. Would it go through to my bank account through paypal or would I need a credit card also when using paypal so there payments can go through?

`~Squalls_Dreams~`

francewhoa’s picture

Here is the code from Paypal.com:

It's easy to add a Donation button to your website using PayPal. You can create the button code yourself or use a tool on the PayPal website where you can generate custom Donation button code.

To create a Donation button on the PayPal website:

1. Log in to your Business or Premier account.
2. Click the Merchant Services tab.
3. Under PayPal Website Payments Standard, Key Features, click Donations Buttons.

Important: To protect against malicious users tampering with the button code and submitting an incorrect charge, see Securing Your Website Payment Standard Buttons. If you turned on the Security Settings in the Donations page, your button is already secured. Merchants with significant payment volume are required by the PayPal user agreement to take precautions on securing Website Payment Standard Buttons.

Here is sample code for a Donation button. If you want the customer to fill in the donation amount, just remove the line with the amount variable.

<form action="https://www.paypal.com/cgi-bin/webscr"
   method="post">
   <input type="hidden" name="cmd" value="_donations">
   <input type="hidden" name="business"
      value="sample@sample.com">
   <input type="hidden" name="item_name"
      value="Example Donation">
   <input type="hidden" name="item_number"
      value="2006">
   <input type="hidden" name="amount" value="50.00">
   <input type="hidden" name="no_shipping" value="2">
   <input type="hidden" name="no_note" value="1">
   <input type="hidden" name="currency_code" value="USD">
   <input type="hidden" name="tax" value="0">
   <input type="hidden" name="bn" value="IC_Sample">
   <input type="image" src="https://www.sandbox.paypal.com/
      en_US/i/btn/x-click-but21.gif" 
      border="0" name="submit" alt="Make payments with PayPal - 
      it's fast, free and secure!">
   <img alt="" border="0"
      src="https://www.paypal.com/en_US/i/scr/pixel.gif
      width="1" height="1">
   </form>

Source: https://www.paypal.com/IntegrationCenter/ic_standard_home.html#DonationB...

Loving back your Drupal community result in multiple benefits for you  
amanzi’s picture

I had to solve this problem to get a button working on my own site, which is powered by Drupal.

  1. Generate the button code on the Paypal site.
  2. Copy the code and paste it into notepad or another text editor.
  3. Make the entire code one line long - Notepad automatically wraps text at a certain length, just make sure no extra spaces exist in the code. Be sure "word wrap" is disabled, too.
  4. Copy this code and paste it into your WYSIWYG editor. The problem should be solved.
itserich’s picture

Thanks, still works.

Why can't Paypal just eliminate the spaces when it displays the code, would save a lot of trouble.

carrierawks’s picture

Then that would just be too easy! LOL

I forgot about paypal forms and wysywyg editors on Drupal. Thanks for the reminder about one long line of code.

dwchris’s picture

I would like to be able to add a PayPal button that once the user has paid for the file they requested that they would be redirected back the file that they requested. The trick is that the file will be different each time and it is linked to the user account page. This is what I want to happen.
1. User logs in and request a file.
2. The admin uploads the file to the users account page but the file should not be viewable until the user pays.
3. Once the user pays they are redirected back to their user account page but now the file is viewable.

Does anyone have any suggestions on how I can achieve this.