PHPackages                             fenusa0/mercadopago-sdk-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. fenusa0/mercadopago-sdk-php

ActiveLibrary

fenusa0/mercadopago-sdk-php
===========================

Mercadopago SDK

v1.0(12y ago)031PHPPHP &gt;=5.2.4

Since Nov 28Pushed 11y ago1 watchersCompare

[ Source](https://github.com/fenusa0/mercadopago-sdk-php)[ Packagist](https://packagist.org/packages/fenusa0/mercadopago-sdk-php)[ RSS](/packages/fenusa0-mercadopago-sdk-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

MercadoPago SDK module for Payments integration
===============================================

[](#mercadopago-sdk-module-for-payments-integration)

- [Usage](#usage)
- [Using MercadoPago Checkout](#checkout)
- [Using MercadoPago Payment collection](#payments)

Usage:
------

[](#usage)

1. Copy lib/mercadopago.php to your project desired folder.
2. Copy lib/cacert.pem to the same folder (for SSL access to MercadoPago APIs).

- Get your **CLIENT\_ID** and **CLIENT\_SECRET** in the following address:
    - Argentina:
    - Brazil:
    - Mexico:
    - Venezuela:
    - Colombia:

```
require_once "mercadopago.php";

$mp = new MP ("CLIENT_ID", "CLIENT_SECRET");
```

### Get your Access Token:

[](#get-your-access-token)

```
$accessToken = $mp->get_access_token();

print_r ($accessToken);
```

Using MercadoPago Checkout
--------------------------

[](#using-mercadopago-checkout)

### Get an existent Checkout preference:

[](#get-an-existent-checkout-preference)

```
$preferenceResult = $mp->get_preference("PREFERENCE_ID");

print_r ($preferenceResult);
```

### Create a Checkout preference:

[](#create-a-checkout-preference)

```
$preference = array (
    "items" => array (
        array (
            "title" => "Test",
            "quantity" => 1,
            "currency_id" => "USD",
            "unit_price" => 10.4
        )
    )
);

$preferenceResult = $mp->create_preference($preference);

print_r ($preferenceResult);
```

[Others items to use](http://developers.mercadopago.com/documentacion/recibir-pagos#glossary)

### Update an existent Checkout preference:

[](#update-an-existent-checkout-preference)

```
$preference = array (
    "items" => array (
        array (
            "title" => "Test Modified",
            "quantity" => 1,
            "currency_id" => "USD",
            "unit_price" => 20.4
        )
    )
);

$preferenceResult = $mp->update_preference("PREFERENCE_ID", $preference);

print_r ($preferenceResult);
```

Using MercadoPago Payment
-------------------------

[](#using-mercadopago-payment)

\###Searching:

```
$filters = array (
        "id"=>null,
        "site_id"=>null,
        "external_reference"=>null
    );

$searchResult = $mp->search_payment ($filters);

print_r ($searchResult);
```

[More search examples](http://developers.mercadopago.com/documentacion/busqueda-de-pagos-recibidos)

### Receiving IPN notification:

[](#receiving-ipn-notification)

- Go to **Mercadopago IPN configuration**:
    - Argentina:
    - Brasil:
    - Mexico:
    - Venezuela:
    - Colombia:

```
require_once "mercadopago.php";

header("Content-type: text/plain");

$mp = new MP ("CLIENT_ID", "CLIENT_SECRET");
$paymentInfo = $mp->get_payment_info ($_GET["id"]);

header ("", true, $paymentInfo["status"]);

print_r ($paymentInfo);
```

### Cancel (only for pending payments):

[](#cancel-only-for-pending-payments)

```
$result = $mp->cancel_payment($_GET["ID"]);

// Show result
print_r ($result);
```

### Refund (only for accredited payments):

[](#refund-only-for-accredited-payments)

```
$result = $mp->refund_payment($_GET["ID"]);

// Show result
print_r ($result);
```

[About Cancel &amp; Refund ](http://developers.mercadopago.com/documentacion/devolucion-y-cancelacion)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.9% 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

Unknown

Total

1

Last Release

4548d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f65120b9a57fd1f265035912736228399e499f35fc76bf0223dbc485503496e?d=identicon)[fenusa0](/maintainers/fenusa0)

---

Top Contributors

[![hcasatti](https://avatars.githubusercontent.com/u/899094?v=4)](https://github.com/hcasatti "hcasatti (30 commits)")[![gmatsuoka](https://avatars.githubusercontent.com/u/1392359?v=4)](https://github.com/gmatsuoka "gmatsuoka (3 commits)")[![fpiruzi](https://avatars.githubusercontent.com/u/3010798?v=4)](https://github.com/fpiruzi "fpiruzi (2 commits)")[![ftesone](https://avatars.githubusercontent.com/u/1878208?v=4)](https://github.com/ftesone "ftesone (2 commits)")[![lucasdealmeida](https://avatars.githubusercontent.com/u/1371269?v=4)](https://github.com/lucasdealmeida "lucasdealmeida (1 commits)")[![matiascompiano](https://avatars.githubusercontent.com/u/2538343?v=4)](https://github.com/matiascompiano "matiascompiano (1 commits)")

---

Tags

mercadopago

### Embed Badge

![Health badge](/badges/fenusa0-mercadopago-sdk-php/health.svg)

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

###  Alternatives

[santigraviano/laravel-mercadopago

Mercado Pago SDK v0.5.2 for Laravel

47145.9k](/packages/santigraviano-laravel-mercadopago)[livepixel/mercado-pago

Mercado Pago API SDK for Laravel

2216.2k](/packages/livepixel-mercado-pago)[lucassmacedo/omnipay-mercadopago

MercadoPago gateway for OmniPay

154.6k](/packages/lucassmacedo-omnipay-mercadopago)

PHPackages © 2026

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