Skip to main content

Welcome to Mangopay PHP SDK

The Mangopay PHP SDK provides a complete PHP client library for integrating with the Mangopay REST API v2.01+. Build powerful payment solutions with support for user management, wallets, transfers, card payments, bank accounts, and comprehensive compliance features.

Quickstart

Get up and running with the SDK in minutes

Installation

Install via Composer or manual download

Configuration

Configure your API credentials and settings

API Reference

Complete API documentation for all SDK features

Key Features

The SDK provides comprehensive coverage of the Mangopay platform:

User Management

Create and manage natural and legal users with full KYC support

Payment Processing

Process PayIns, PayOuts, card payments, and bank transfers

Wallets & Transfers

Manage user wallets and handle fund transfers

Compliance & KYC

Handle document verification and regulatory compliance

Dispute Management

Manage chargebacks and dispute resolution

Webhooks & Events

Real-time notifications for payment events

Quick Example

Get started with a simple example:
<?php
require_once 'vendor/autoload.php';

$api = new MangoPay\MangoPayApi();

// Configure credentials
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-client-password';
$api->Config->TemporaryFolder = '/tmp/';

// Create a user
$user = new MangoPay\UserNatural();
$user->FirstName = 'John';
$user->LastName = 'Doe';
$user->Email = '[email protected]';
$user->Birthday = 1463496101;
$user->Nationality = 'FR';
$user->CountryOfResidence = 'FR';

try {
    $createdUser = $api->Users->Create($user);
    echo "User created with ID: " . $createdUser->Id;
} catch(MangoPay\Libraries\ResponseException $e) {
    echo "Error: " . $e->GetMessage();
}

Creating Users

Learn how to create and manage natural and legal users

Processing PayIns

Accept payments from various sources

Card Payments

Implement card payment flows with 3DS authentication

Bank Accounts

Manage user bank accounts for payouts

Requirements

  • PHP 5.6 or newer
  • cURL extension (enabled by default)
  • OpenSSL extension (enabled by default)
  • PSR/Log library (v1.0, v2.0, or v3.0)
  • Composer (recommended for dependency management)

Support

GitHub Repository

View source code and report issues

Changelog

See what’s new in the latest releases

Troubleshooting

Common issues and solutions

Contributing

Learn how to contribute to the SDK

Build docs developers (and LLMs) love