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
- ๐งฑ Compatibility
- ๐ Common Use Cases
- ๐ฆ Installation
- โ๏ธ Plugin Options
- ๐ Documentation
๐ฏ 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:
1npm install @alphabite/medusa-paypal
2. Register the Plugin
Add the plugin to your Copy to clipboardmedusa.config.ts
or Copy to clipboardmedusa-config.js
:
123456789101112131415{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