Installation Methods
The Mangopay PHP SDK can be installed using Composer (recommended) or manually. Choose the method that best fits your project setup.Installation with Composer (Recommended)
Composer is the recommended installation method as it automatically handles dependencies, including the required PSR Log library.Install Composer
If you don’t have Composer installed, follow the official installation instructions.
Add the Mangopay SDK Dependency
Run the following command in your project directory:This command adds the Mangopay SDK to your
composer.json file and downloads the package.The SDK is available on Packagist as
mangopay4/php-sdk.Verifying Composer Installation
After installation, verify that the SDK is available:Manual Installation
If you’re not using Composer, you can install the SDK manually. However, you’ll need to manage dependencies yourself.Option 1: Using PSR-4 Autoloader
The SDK complies with PSR-4 autoloading standards with namespace prefixMangoPay\ and base directory at your project root.
Download the SDK
Download the SDK from the GitHub repository.
Place in Your Project
Extract the SDK to your project directory, ensuring the
MangoPay folder is accessible.Option 2: Complete Package with Dependencies
For a simpler manual installation that includes all dependencies:Download the Complete Package
Go to the Releases page and download the
mangopay2-php-sdk-[RELEASE_NAME].zip file.Comparing Installation Methods
| Feature | Composer | Manual (PSR-4) | Manual (Complete) |
|---|---|---|---|
| Dependency Management | Automatic | Manual | Included |
| Updates | Easy via composer update | Manual download | Manual download |
| Setup Complexity | Low | Medium | Low |
| Recommended | ✅ Yes | Only if needed | Alternative |
Post-Installation Steps
After installation, you’re ready to configure the SDK:Configuration
Set up your API credentials and environment settings
Quick Start
Create your first user and make your first API call