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

非营利组织PayPal月度定期捐款按钮设置咨询(含代码需求)

Hey there! As someone who’s helped nonprofits set up PayPal recurring donation tools, let me walk you through everything you need to know here.

适合你的PayPal工具推荐

Since you’re new to this and with a nonprofit, you have two great options depending on how much customization you need:

  • New PayPal Donate Buttons (with Recurring Support): This is the easiest pick for beginners. No heavy coding required—you can configure everything directly in your PayPal dashboard, then just copy-paste the generated code into your website.
  • PayPal Subscriptions API: If you want full control over the checkout flow (like embedding the donation form directly into your site without redirecting to PayPal), this is the way to go. It’s a bit more technical, but gives you more flexibility.
Step-by-Step for Recurring Donate Button (Beginner-Friendly)
  1. Log into your PayPal nonprofit/business account, head to the PayPal Buttons section (under Tools & Settings)
  2. Select the "Donate" button type, then toggle on the Recurring donations option
  3. Set your default monthly amount (e.g., $10), and choose whether to let donors adjust the amount if they want
  4. Customize the button’s look to match your site, then generate the embed code

Example Embed Code (from PayPal Dashboard)

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&currency=USD&intent=subscription"></script>
<div id="paypal-button-container"></div>
<script>
  paypal.Buttons({
    createSubscription: function(data, actions) {
      return actions.subscription.create({
        'plan_id': 'YOUR_PLAN_ID' // Generated when setting up the recurring button in PayPal
      });
    },
    onApprove: function(data, actions) {
      alert('Subscription created successfully! ' + data.subscriptionID);
    }
  }).render('#paypal-button-container');
</script>

Note: Replace YOUR_CLIENT_ID and YOUR_PLAN_ID with the values from your PayPal dashboard.

Custom Subscriptions API Example (For More Control)

If you want to build a fully custom flow, here’s a simple frontend snippet using PayPal’s JS SDK:

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&currency=USD"></script>
<button id="subscribe-btn">Subscribe to Monthly $10 Donation</button>
<script>
  document.getElementById('subscribe-btn').addEventListener('click', function() {
    paypal.Subscriptions.create({
      plan_id: 'YOUR_MONTHLY_DONATION_PLAN_ID'
    }).then(function(subscription) {
      // Redirect donor to PayPal checkout
      window.location.href = subscription.links.find(link => link.rel === 'approve').href;
    }).catch(function(err) {
      console.error('Error creating subscription:', err);
    });
  });
</script>

You’ll need to create a subscription plan in your PayPal dashboard first (under Products > Subscriptions) to get the plan_id.

Answers to Your Flow Questions
  • Do donors need a PayPal account? Nope! Donors can complete their monthly donation using a credit/debit card without signing up for a PayPal account—PayPal’s guest checkout option supports this.
  • Where is payment information stored? All sensitive payment details (like card numbers, billing info) are securely stored by PayPal. Your nonprofit account won’t handle or store this data at all. You’ll just have access to subscription records, donor info (with their consent), and can manage subscriptions (pause, cancel) directly in your PayPal dashboard. PayPal automatically handles monthly billing, and will notify you if a payment fails.

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

火山引擎 最新活动