First start off by doing all of these changes in a test environment. Both PayPal and Stripe have test modes. In PayPal it's called "Sandbox mode". This is to ensure everything works before you go live. I also suggest changing settings via their API so you can use commands in a terminal to edit them. This makes it easy to setup a replica of the test environment in production when you decide to go live. Otherwise you just need to remember which settings you clicked etc.
You need to create a PayPal and Stripe account. If you don't have a registered business (LLC) yet, you can start off with a sole proprietor account. Make sure to use your real life information while doing it, because they will check it with your bank and government before you can start requesting donations/payments or withdrawing funds.
And before you do anything else, I highly recommend you put your website behind a WAF. Cloudflare is great for that. You want to restrict access to your website from regions your users are in. You probably do not need to allow Russia, Israel, Iran, North Korea, Singapore, Africa, TOR and Antarctica to access it. Preferably only allow the specific countries your users are from. This is to reduce the risk of getting fraudulent payments (stolen credit cards, for example). The main thing that will impact your accounts are chargebacks and fraud reports. That's the only things you really need to worry about.
So once you have a PayPal account, you need to create a "PayPal App":
Developer Dashboard (https://developer.paypal.com/dashboard)
And again, make sure you first do this via their test environment ("Sandbox Mode") as you can see under the PayPal logo.
Enter these details:
- Name: (name of your OT server for example)
- Type: Merchant
Next you may want to get the Sandbox API credentials.
Now configure your PayPal App with these settings (leave everything else unchecked):
- Expanded Checkout
- Advanced Credit and Debit Card Payments
- Apple Pay
- Google Pay
- Transaction search
- JavaScript SDK v6
- Payment links and button
Then go to the Sandbox Dashboard:
PayPal sandbox testing guide (https://developer.paypal.com/tools/sandbox/)
And sign in using the Sandbox API email and password it gave you before.
Then navigate to "Payments -> Donations" or whatever it says in the left sidebar.
And create a donation link.
Give the donation page a "project name" (e.g. your OT server name) and optionally a description like "Donation to OT Server".
Add the default currency, e.g. Euro.
And choose an "optional amount" or like 10€ by default. It's up to you.
Click next and only select to redirect users back to your homepage after donating. You don't need to check anything else (like collect their address, or leave a messge, etc). But it's up to you. And enter a link to your site that they will be redirected to after making a payment.
Then click on "Publish" and write down the ID number it shows.
And then go make a test donation:
www.sandbox.paypal.com
Just replace "XXX" with the ID you copied.
And create a test donation with this card:
- Number: 4032038791003845
- Expiry: any (e.g. 01/30)
- CVC code: any (e.g. 123)
After a payment has been done, it should appear in your Sandbox Dashboard after a few minutes.
But it can take up to 3 hours before payments appear in the API (if you connect for example a Node.js, .NET or PHP app to the API).
If everything works fine, do exactly the same as before but in the production environment. Just change from "Sandbox" to the live mode under the PayPal logo. The steps are exactly the same.
And on your website, you just add the donation link later. E.g.
Donate (https://www.paypal.com/donate/?hosted_button_id=xxx)
Also connect PayPal to your bank account and verify your account fully before you start accepting any donations/payments.
For Stripe it's totally different and they have more settings. Then create a Stripe account with your real name/ID, connect it to a bank account and there is like a pop-up that guides you through it. Remember to first do all of this in their "Test Environment" (Developer mode). Basically you want to create a "Payment Link" and customize the checkout page. Make sure the payment button says "Donate" instead of "Pay". Add your minimum/maximum donation amount, and currency. Add product details etc. And after the Payment Link is made, configure the "Payment Methods". If you want everything, just enable everything that you see in the menu.
I suggest using their premade Stripe Checkout page, then you don't need to do anything, and simply get a link that redirects to Stripe's website where the user can make a payment. You can specify to redirect back to your site when a payment is made.
On Stripe you can test creating a fake payment/donation with these card details:
- Number: 4242 4242 4242 4242
- Expiry: any future date (e.g. 01/30)
- CVC code: any (e.g. 123)
If it works fine, do exactly the same steps in production mode. Make sure your account is verified and that's it.
I also recommend you check both Stripe & PayPal's sites and read their terms of service. You can't sell any type of product, some stuff is banned. But an OT server is fine.
And remember real life laws as well: you can't get infinite amounts in donations. After a while you must register as a non-profit business and get a business license, or register a LLC, and pay taxes.
In both platforms you can choose to send receipts and invoices if that's what you need. But first you must setup everything up as I mentioned above. And then generate invoice or receipt for it. Read their documentation. It's been a while since I read it, but probably 95% of what I mentioned is still accurate.