This package is abandoned and no longer maintained. No replacement package was suggested.

MangoPay PHP SDK

v0.3.0 2014-03-25 10:03 UTC

This package is not auto-updated.

Last update: 2016-06-19 08:35:50 UTC


PHP SDK to use MangoPay API. mangopay-sdk integrate Guzzle for all the cURL requests. We only creates a plugin names LeetchiPlugin which will sign all your requests to the MangoPay API.


The recommended way to install mangopay-sdk is through Composer

composer require "betacie/mangopay-sdk": "dev-master"
composer update betacie/mangopay-sdk


To request the API, you need to instantiate a Guzzle Client and add him the dedicated plugin.


use Betacie\MangoPay\LeetchiPlugin;
use Guzzle\Http\Client;

$client = new Client('{partnerId}/', array(
    'partnerId'                 => 'your_partner_id',
    'ssl.certificate_authority' => false,
    'request.options'           => array(
        'headers' => array('Content-Type' => 'application/json'),

$plugin = new LeetchiPlugin('private_key_path', 'private_key_passphrase');

Now you can use the API.


Now all you need, is to create a message. For exemple if you need to create an user you only have to write the following code.


use Betacie\MangoPay\Message\UserRequest;

//You already have created your client with the plugin.

$message = new UserRequest($client);
$response = $message->create(array(
    'Email' => 'j.doe@email.tld',
    'FirstName' => 'John',
    'LastName' => 'Doe',
    'IP' => '',

$data = $response->json();

All message methods return a GuzzleResponse.