PHPackages                             mango/mango-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mango/mango-php

ActiveLibrary[API Development](/categories/api)

mango/mango-php
===============

Mango API client for PHP

0.1.2(10y ago)7655MITPHPPHP &gt;=5.3.0

Since Dec 4Pushed 10y ago6 watchersCompare

[ Source](https://github.com/Mango/mango-php)[ Packagist](https://packagist.org/packages/mango/mango-php)[ Docs](http://github.com/Mango/mango-php)[ RSS](/packages/mango-mango-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

Mango PHP Library
=================

[](#mango-php-library)

This is a PHP library that allows interaction with [Mango API](https://developers.getmango.com/en/api/?platform=php)

Installation
------------

[](#installation)

### Dependencies

[](#dependencies)

```
* PHP 5.3+

```

### Install with Composer

[](#install-with-composer)

If you're using [Composer](https://github.com/composer/composer), add this to your composer.json `require`:

```
{
  "require" : {
    "mango/mango-php" : "dev-master"
  }
}
```

And load it using Composer's autoloader

```
require 'vendor/autoload.php';
```

### Install from GitHub

[](#install-from-github)

To install the source code:

```
$ git clone git@github.com:mango/mango-php.git
```

Include `mango-php` in your code and autoload `requests`:

```
require_once '/path/to/mango-php/mango.php';
require_once '/path/to/rmccue/requests/Requests.php';
Requests::register_autoloader();
```

Documentation
-------------

[](#documentation)

Documentation is available at

Usage
-----

[](#usage)

### Set your secret API key:

[](#set-your-secret-api-key)

```
$mango = new Mango\Mango(array(
    "api_key" => "YOUR_SECRET_API_KEY"
));
```

### Create a customer

[](#create-a-customer)

In order to create a Customer, you must call the `create()` method with [the required arguments](https://developers.getmango.com/en/api/charges/?platform=php#arguments).

```
$customer = $mango->Customers->create(array(
    "email" => "test-php@example.org",
    "name" => "Test Customer"
));
var_dump($customer);
```

### Get single customer

[](#get-single-customer)

When you have a customer `uid`, you can get a full detail using the `get()` method:

```
$customer = $mango->Customers->get("customer_1uqh884oy1ujh9y9eatm0jo3zxu0rm2s");
var_dump($customer);
```

You can also work with all the other resources authenticated with a secret API Key:

- [Charges](https://developers.getmango.com/en/api/charges/?platform=php)
- [Refunds](https://developers.getmango.com/en/api/refunds/?platform=php)
- [Customers](https://developers.getmango.com/en/api/customers/?platform=php)
- [Cards](https://developers.getmango.com/en/api/cards/?platform=php)
- [Queue](https://developers.getmango.com/en/api/queue/?platform=php)
- [Installments](https://developers.getmango.com/en/api/installments/?platform=php)
- [Promotions](https://developers.getmango.com/en/api/promotions/?platform=php)
- [Coupons](https://developers.getmango.com/en/api/coupons/?platform=php)

Tests
-----

[](#tests)

Install the module along with the dev dependencies using composer:

```
$ git clone git://github.com/mango/mango-php.git
$ cd mango-php
$ composer install
```

To run the tests you'll need Mango API keys (mode Sandbox):

```
export MANGO_SECRET_TEST_KEY='your secret test API key'
export MANGO_PUBLIC_TEST_KEY='your public test API Key'
```

### Run the tests

[](#run-the-tests)

```
$ phpunit test
```

### Run code coverage

[](#run-code-coverage)

To run the code coverage you'll need Xdebug

```
$ phpunit --coverage-html coverage
```

License
-------

[](#license)

Licensed under the MIT license.

Copyright (c) 2014 Mango.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~110 days

Total

3

Last Release

3955d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/967a277970fffe3492700cd20f9cb625efaa39ef4672dc9af7d474549bf51ee2?d=identicon)[mango](/maintainers/mango)

---

Top Contributors

[![peregrinogris](https://avatars.githubusercontent.com/u/115484?v=4)](https://github.com/peregrinogris "peregrinogris (10 commits)")[![juanrossi](https://avatars.githubusercontent.com/u/569417?v=4)](https://github.com/juanrossi "juanrossi (6 commits)")[![fonse](https://avatars.githubusercontent.com/u/605137?v=4)](https://github.com/fonse "fonse (1 commits)")[![impronunciable](https://avatars.githubusercontent.com/u/165799?v=4)](https://github.com/impronunciable "impronunciable (1 commits)")[![pazguille](https://avatars.githubusercontent.com/u/250856?v=4)](https://github.com/pazguille "pazguille (1 commits)")

---

Tags

apimango

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mango-mango-php/health.svg)

```
[![Health](https://phpackages.com/badges/mango-mango-php/health.svg)](https://phpackages.com/packages/mango-mango-php)
```

###  Alternatives

[razorpay/razorpay

Razorpay PHP Client Library

2024.8M44](/packages/razorpay-razorpay)[culqi/culqi-php

Cliente Culqi API para PHP

41356.8k1](/packages/culqi-culqi-php)[epayco/epayco-php

Epayco API client for PHP

25187.2k3](/packages/epayco-epayco-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
