I like to blog about current software design and development projects, as well as general everyday news and events. I'm passionate about what I do and you can follow my personal journey through my blog. I'm constantly on the lookout for new development techniques and technologies to keep on top of the changing market, so if I do miss anything feel free to leave me a comment.

C#: PayPal Donate Button

If you have a PayPal account and would like to add a donate button to your application you can use the following code.

private void btnDonate_Click(object sender, System.EventArgs e)
    string url = "";
    string business     = "";  // your paypal email
    string description  = "Donation";            // '%20' represents a space. remember HTML!
    string country      = "AU";                  // AU, US, etc.
    string currency     = "AUD";                 // AUD, USD, etc.
    url += "" +
        "?cmd=" + "_donations" +
        "&business=" + business +
        "&lc=" + country +
        "&item_name=" + description +
        "&currency_code=" + currency +
        "&bn=" + "PP%2dDonationsBF";

Tags: , , , ,

16 Responses to “C#: PayPal Donate Button”

  1. dethknite // September 3rd, 2009 at 6:33 am

    I attempted to use this code but am unable to get it to work. I have tried:” instead, still no luck.

    Just loads up the paypal login screen.


  2. Beno Gorancic // September 4th, 2009 at 11:19 am

    Can you show me what your url looks like? Feel free to use the contact page if you don’t want to post it here.

    I have asked another person to test it and also tested it myself just now and I can confirm that it works for me.

  3. Beno Gorancic // September 11th, 2009 at 5:07 pm

    Resolved dethknite’s issue. There was a typo in the URL.

  4. Asimplepersonality // December 17th, 2009 at 10:03 pm

    Thanks man!

    Really useful.

  5. Andyr // August 6th, 2010 at 11:25 pm

    Thanks that worked for me.

  6. profiler26 // September 23rd, 2011 at 11:57 pm

    When i add the button it wont direct me to anything, as far as i ca see i did not forget anything. is it changed maybe for the 2010 version?

  7. Beno Gorancic // September 29th, 2011 at 11:13 am

    It should work. I have just tested it out in 2010 by copy/pasting the above code.

  8. Mitja // April 29th, 2013 at 8:58 pm

    Have you been thinking how to obfuscate this code? If someone opens your app in decompiler, code can be changed (email) and donation can be sent to someone else.

  9. // August 20th, 2020 at 12:19 am

    محتوا ی این پیام از نظر کثرت از افراد
    کم ارزش و کامل نیست ولی فداکار از مطالب کارخانه ها و بلاگ ها پیرامون این مطلب
    در وب وجود دارند که می توان از آنها استفاده بهتری داشت

  10. خرید سنگ روشویی // December 4th, 2020 at 8:23 am

    من آسوده خاطری هستم که درون تمام اینترنت مطلب
    مشابه بوسیله این یادداشت حیات ندارد برای
    این که مطلب کامل و جامع ی پیرامون این
    مبحث است

  11. سنگ تراورتن کف // December 5th, 2020 at 4:26 pm

    سلام . کنیز قسم می خورم که این مطلب فصیح است و محتملاً هیچوقت نفر نتواند
    نبا مشابه به این مطلب را اندر وبلاگ ظاهر کند برای این
    که چقدر طولانی است

  12. واردات و ترخیص کالا // January 10th, 2021 at 10:43 pm

    معنای مطلب ی این یادداشت از نظر هنگفت از افراد مناسب و کامل نیست ولی فداکار از مطالب
    محل استقرار رادار ها و بلاگ ها پیرامون این مطلب
    در وب وجود دارند که می توان از
    آنها استفاده بهتری داشت

  13. raya bonus 2021 // May 15th, 2021 at 1:30 am

    It’s awesome to pay a quick visit this web site and reading the views of all mates concerning this piece of writing,
    while I am also zealous of getting experience.

  14. نرم افزار خزانه داری // July 18th, 2021 at 5:02 am

    این پیغام مشاوره و پیشنهاد مناسب برای کسانی است که می خواهند دوروبر محتویات
    متشابه بوسیله این مطلب مطالعه بیشتری داشته باشند

  15. قیمت سیمان پاکتی // September 30th, 2021 at 3:08 am

    سلام . عبد قسم می خورم که
    این مطلب فصیح است و محتملاً هیچوقت
    نفر نتواند پیغام مشابه به این مطلب را تو وبلاگ برملا کند برای این که بی
    نهایت کامل است

  16. บอล // October 20th, 2021 at 8:46 pm

    A professional wagerer knows that there can come a interval when it will
    lose a wager as a result of it’s part of the game and it
    can not move in the identical manner and the identical system will make them win a higher amount also
    at good instances. If that doesn’t persuade you, an easy strategy
    to see it’s to look at the expected worth of the $a hundred parlay versus the anticipated value of
    two $50 unfold bets, all at -a hundred and ten prices.
    Whether you wish to parlay our model picks towards the unfold,
    totals picks for this weekend, or picks from our crew of experts, it’s simpler
    to identify good bets and parlay them collectively for big
    income. BetQL will have you lined all school soccer season choosing games against the spread, but
    you need to at all times be knowledgeable as to what each bet means.
    You possibly can parlay picks together for a higher payout, however always be weary,
    because you have to win each wager in a parlay to receive the winnings.
    Each week, we can have 3-four free plays through the faculty football
    season, so you will have the prospect to construct a profitable parlay each single week of the
    2021 faculty soccer season, regardless of subscription standing.

Leave a Reply