PayPal
Take one-off and recurring payments through PayPal.
HostCore charges your clients through your own PayPal Business account. You create a REST API app in PayPal and add its credentials to your store, and payments go straight to your PayPal balance. HostCore never holds your money, and clients sign in and approve payments on PayPal's own checkout, so their PayPal login and card details never reach HostCore.
Once connected, HostCore uses your credentials to:
- Send clients to PayPal Checkout to pay invoices.
- Save each client's PayPal account, so renewals can be charged without them signing in again.
- Charge saved PayPal accounts automatically when renewals are due.
- Issue refunds you make from your store.
- Create and maintain the webhook PayPal uses to tell your store a payment succeeded.
Before you begin
You need:
- A PayPal Business account. Personal accounts can't create live REST API apps.
- PayPal's approval to save payment methods, so renewals can charge automatically. PayPal reviews every account before it can save clients' PayPal accounts, and the feature is only available in supported countries.
To apply for approval, sign in at paypal.com, go to Account Settings › Payment Preferences › Save PayPal and Venmo payment methods, and click Get Started.
PayPal's review can take a few days. You can set everything else up and test in the sandbox while you wait, because sandbox apps don't need approval.
Create a REST API app
Open the Developer Dashboard
Sign in to the PayPal Developer Dashboard with your PayPal Business account, and use the Sandbox | Live toggle at the top of the page to switch to Live.
Create the app
Go to Apps & Credentials and click Create App. Give it a name you'll recognise later, such as
HostCore, and click Create App.Turn on the features HostCore needs
On the app's page, turn on Save payment methods and Customer disputes.
If you can't select Save payment methods, PayPal hasn't approved your account for it yet. See Before you begin.
Copy your credentials
Copy the app's Client ID and Secret. You'll add both to your store.
Connect PayPal to your store
Open the PayPal gateway
In your store's admin dashboard, go to Store Settings › Payment Gateways › PayPal.
Add your credentials
Paste your Client ID and Secret and save. HostCore checks your credentials and creates a webhook in your PayPal app that points at your store.
Turn on payments
When you're ready to take payments, turn on Accept Payments.
You can see the webhook HostCore created on your app's page in the PayPal Developer Dashboard, under Webhooks.
Don't edit or delete the webhook HostCore creates. It's how PayPal tells your store a payment succeeded. Without it, clients can pay and their invoices stay unpaid. If the webhook is deleted or wasn't created, click Verify at the top of the PayPal gateway page to recreate it.
Test with the sandbox
Before you take real payments, connect sandbox credentials and run a purchase from start to finish.
- In the Developer Dashboard, switch the Sandbox | Live toggle to Sandbox.
- Create an app the same way as above and copy its sandbox Client ID and Secret.
- Connect them to your store the same way.
- Go to Testing Tools › Sandbox Accounts and open the Personal sandbox account PayPal created for you to see its email address and password.
- Place an order on your storefront, choose PayPal at checkout, and sign in with the sandbox Personal account.
- Check that the invoice is marked paid in your store and that the payment appears in your sandbox Business account at sandbox.paypal.com.
When everything works, replace the sandbox credentials with your live ones.
Clients and saved PayPal accounts created in the sandbox don't exist in live mode. Don't let real clients pay while your store is connected to sandbox credentials, or their saved PayPal accounts won't work once you switch to your live credentials.
Migrating from another billing platform
Connect the same PayPal Business account your other billing platform uses. Saved PayPal accounts come across as PayPal payment methods, and those only work in the account that created them. If you connect a different account, every migrated PayPal payment method fails at renewal. See Migrating payment methods.
Rotate your secret
To replace your secret, for example because it was exposed or someone who had it has left:
- In the Developer Dashboard, open your app and generate a new secret.
- Paste the new secret into Store Settings › Payment Gateways › PayPal and save.
- Back in PayPal, delete the old secret.
Your Client ID doesn't change, and your clients, saved PayPal accounts and renewals carry on as normal.
Troubleshooting
HostCore rejects my credentials when I save them. Check that you copied the whole Client ID and Secret, and that both come from the same app. Sandbox and live credentials are separate, so make sure you haven't mixed a sandbox Client ID with a live Secret.
Clients pay in PayPal but invoices stay unpaid. The webhook is missing. Check the Webhooks section of your app in the Developer Dashboard, then click Verify on the PayPal gateway page to recreate it. PayPal allows up to 10 webhooks per app, so if your app already has 10, delete one you don't use first.
Clients can pay, but renewals don't charge automatically. HostCore can't save PayPal accounts. Check that Save payment methods is turned on for your live app and that PayPal has approved your account for it.
Renewals fail for clients who paid successfully before. The connected credentials belong to a different PayPal account or mode from the one the client's PayPal account was saved in. This usually means sandbox credentials were swapped for live ones, or a migration was connected to a different PayPal Business account.
Still stuck?
Open a support ticket from your HostCore account and we'll help you get connected.