Overview
Icon for Paypal

Paypal

Enable secure, trusted checkout with PayPal

PayPal

Receive payments on your Medusa commerce application using PayPal.

PayPal Plugin Documentation | Medusa Website | Medusa Repository

Features

  • Authorize payments on orders from any sales channel.
  • Capture payments from the admin dashboard.
  • View payment analytics through PayPal's dashboard.
  • Ready-integration with Medusa's Next.js starter storefront.
  • Support for Webhooks.

Prerequisites

How to Install

1. Run the following command in the directory of the Medusa backend:

npm install medusa-payment-paypal

2. Set the following environment variables in Copy to clipboard.env:

PAYPAL_SANDBOX=true
PAYPAL_CLIENT_ID=<CLIENT_ID>
PAYPAL_CLIENT_SECRET=<CLIENT_SECRET>
PAYPAL_AUTH_WEBHOOK_ID=<WEBHOOK_ID>

3. In Copy to clipboardmedusa-config.js add the following at the end of the Copy to clipboardplugins array:

const plugins = [
// ...
{
resolve: `medusa-payment-paypal`,
options: {
sandbox: process.env.PAYPAL_SANDBOX,
client_id: process.env.PAYPAL_CLIENT_ID,
client_secret: process.env.PAYPAL_CLIENT_SECRET,
auth_webhook_id: process.env.PAYPAL_AUTH_WEBHOOK_ID,
},
},
]

Test the Plugin

1. Run the following command in the directory of the Medusa backend to run the backend:

npm run start

2. Enable PayPal in a region in the admin. You can refer to this User Guide to learn how to do that. Alternatively, you can use the Admin APIs.

3. Place an order using a storefront or the Store APIs. You should be able to use Stripe as a payment method.

Additional Resources

You may also like

Browse all integrations

Build your own

Develop your own custom integraiton

Build your own integration with our API to speed up your processes. Make your integration available via npm for it to be shared in our Library with the broader Medusa community.

gift card interface

Ready to build your custom commerce setup?