You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何为自定义邮箱地址生成PayPal捐赠按钮?

How to Create a PayPal Donate Button for a Custom Email Address

Alright, let's break down the step-by-step process to make a PayPal Donate button linked to your custom email—whether you're embedding it on a website, sharing a direct link, or tweaking the code for more control.

1. Start with a Verified PayPal Account

First things first: your custom email needs to be verified in your PayPal account. If it's not already linked, log into PayPal, navigate to Settings > Account Settings > Email, add the email, and follow the verification link sent to that inbox. Unverified emails can't receive donations, so don't skip this!

2. Generate the Donate Button via PayPal's Dashboard

This is the easiest method for most people—PayPal handles the hosting and security:

  • Log into your PayPal account and head to the PayPal Buttons page (look under "Tools" or search for "Create Buttons" in the menu).
  • Select the Donate button type from the options.
  • Under "Button details":
    • Enter a donation name/description (e.g., "Support My Open Source Project").
    • Choose your default currency (USD, EUR, etc.).
    • For the Receiving email field, enter your custom email address (make sure it's linked and verified in your account!).
  • Optional tweaks:
    • Check "Allow donors to enter their own amount" if you want people to choose how much to give.
    • Add a dropdown of preset amounts (e.g., $5, $10, $25) for quicker donations.
    • Enable "Recurring donations" if you want to set up monthly/annual contributions.
  • Click Create Button once you're done.

3. Get the Code to Embed or Share

After creating the button, PayPal will give you two flexible options:

This is a secure snippet that links to PayPal's hosted button. It lets you edit the button later without updating your website code:

<form action="https://www.paypal.com/donate" method="post" target="_top">
  <input type="hidden" name="business" value="your-custom-email@example.com">
  <input type="hidden" name="no_recurring" value="0">
  <input type="hidden" name="item_name" value="Support My Project">
  <input type="hidden" name="currency_code" value="USD">
  <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button">
  <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

Just replace your-custom-email@example.com with your verified custom email, and adjust the item_name/currency_code as needed.

If you don't need an embedded button—just a link to send via email, social media, etc.—craft a direct URL like this:

https://www.paypal.com/donate?business=your-custom-email@example.com&item_name=Support%20My%20Project&currency_code=USD

Swap out the email, use %20 for spaces in the item name, and update the currency code to match your needs.

4. Test the Button (Critical!)

Before making it public, do a test donation to avoid headaches later:

  • Use a separate PayPal account (or PayPal's sandbox if you're comfortable with developer tools) to send a small test donation to your custom email.
  • Verify that the funds land in the correct PayPal account linked to your custom email.
  • Check that the donation description and amount show up correctly in both the donor's and your transaction history.

Pro Tips for Advanced Control

  • Customize the Button Image: Replace the src in the HTML code with your own button image (just make sure it's hosted somewhere publicly accessible).
  • Add Redirect Fields: Include extra fields to send donors to a thank-you page or cancellation page:
    <input type="hidden" name="return" value="https://your-website.com/thank-you">
    <input type="hidden" name="cancel_return" value="https://your-website.com/donation-canceled">
    
  • Sandbox Testing for Developers: If you're building a custom integration, use PayPal's Sandbox environment to test without real money. Just replace www.paypal.com with www.sandbox.paypal.com in the URL/code, and use sandbox account emails.

Common Pitfalls to Avoid

  • Unverified Email: Don't use an email that's not linked/verified to your PayPal account—donations will fail.
  • Incorrect Currency: Double-check the currency_code to avoid donors being charged in the wrong currency.
  • Outdated Code: If you use the hosted button, PayPal will update it automatically, but if you hardcode the HTML, refresh it if you change your button settings later.

内容的提问来源于stack exchange,提问作者dsgsdfhawr

火山引擎 最新活动