Switch to Paddle Billing
How to change the default payment processor to Paddle Billing.
Paddle Billing is a merchant of record for selling digital products and subscriptions. It takes care of payments, global tax compliance, fraud prevention, localization, and subscriptions. Here’s how to switch the default payment processor from Stripe to Paddle Billing.
This guide is for Paddle Billing, which is the latest version of Paddle. It doesn’t include Paddle Classic.
1. Swap out the required dependencies
First, uninstall the existing dependencies from the Payments package…
… and install the new dependencies…
2. Update the Payment keys
Update the required Payment keys in the packages/payments/keys.ts
file:
3. Update the environment variables
Next, update the environment variables across the project, replacing the existing Stripe keys with the new Paddle keys:
4. Update the payments client
Initialize the payments client in the packages/payments/index.ts
file with the new API key.
5. Update the payments webhook handler
Remove the Stripe webhook handler from the API package…
… and create a new webhook handler for Paddle:
There’s quite a lot you can do with Paddle, so check out the following resources for more information:
Webhooks Overview
Learn how to handle webhooks from Paddle Billing
Signature Verification
Learn how to verify webhooks from Paddle Billing
Simulate Webhooks
Learn how to send test webhooks from Paddle Billing
6. Create a Checkout hook
Create a new file for checkout
and install paddle-js
:
Then, create a new hook to initialize Paddle in the packages/payments/checkout.tsx
file:
7. Use the Checkout hook
Finally, open a checkout on your pricing page: