Overview
Icon for Paypal

Paypal

Use PayPal as a payment provider

๐Ÿ“ PayPal Plugin for Medusa

The Alphabite PayPal Plugin integrates PayPal payment processing into your Medusa store. It handles various payment flows, including capturing payments, managing refunds, and ensuring robust error handling.

๐Ÿ“š Table of Contents

๐ŸŽฏ Core Features

  • โœ… Seamless PayPal payment integration
  • ๐Ÿ”„ Handles various PayPal error states
  • ๐Ÿ’ฐ Supports refunds directly from Medusa Admin
  • ๐Ÿ›’ Creates new order IDs for each payment attempt within the same payment intent
  • ๐Ÿ“ฆ Optional inclusion of shipping and customer data in PayPal orders

๐Ÿงฑ Compatibility

  • Backend: Medusa v2+
  • Frontend: Framework-agnostic (integrates with PayPal's SDK)
  • Admin: Refund functionality integrated into Medusa Admin

๐Ÿ›  Common Use Cases

  • Accepting PayPal payments for products and services
  • Managing payment captures and refunds efficiently
  • Ensuring robust payment processing with comprehensive error handling

๐Ÿ“– Documentation

For complete documentation, visit our PayPal Plugin Documentation.

๐Ÿ“ฆ Installation

This guide walks you through installing and configuring the Alphabite PayPal Plugin in your Medusa backend.

1. Install the Plugin

Install the package via npm:

npm install @alphabite/medusa-paypal

2. Register the Plugin

Add the plugin to your Copy to clipboardmedusa.config.ts or Copy to clipboardmedusa-config.js:

{
plugins: [
{
resolve: "@alphabite/medusa-paypal",
options: {
clientId: process.env.PAYPAL_CLIENT_ID,
clientSecret: process.env.PAYPAL_CLIENT_SECRET,
isSandbox: process.env.PAYPAL_IS_SANDBOX === "true",
webhookId: process.env.PAYPAL_WEBHOOK_ID,
includeShippingData: false,
includeCustomerData: false,
},
},
],
};

โš™๏ธ Plugin Options

The following options can be passed to the PayPal plugin in your Copy to clipboardmedusa-config.js or Copy to clipboardmedusa.config.ts file:

Option Type Default Description Copy to clipboardclientId Copy to clipboardstring Required. Your PayPal API client ID. Copy to clipboardclientSecret Copy to clipboardstring Required. Your PayPal API client secret. Copy to clipboardisSandbox Copy to clipboardboolean Copy to clipboardtrue Whether to use the PayPal Sandbox environment for testing. Copy to clipboardwebhookId Copy to clipboardstring Optional. Your PayPal webhook ID. If provided, enables confirmation of payment captures. Copy to clipboardincludeShippingData Copy to clipboardboolean Copy to clipboardfalse Optional. If Copy to clipboardtrue, shipping data from the storefront order will be added to the PayPal order. Copy to clipboardincludeCustomerData Copy to clipboardboolean Copy to clipboardfalse Optional. If Copy to clipboardtrue, customer data from the storefront order will be added to the PayPal order.

โœ… Compatibility

  • Requires Medusa v2
  • Compatible with both JS and TypeScript projects

๐Ÿš€ Next Steps

๐Ÿ‘‰ Configuration Guide ๐Ÿ‘‰ Join our Discord Community for faster support

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?