PHP code example of grunch / mercadopago-bundle
1. Go to this page and download the library: Download grunch/mercadopago-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
grunch / mercadopago-bundle example snippets
php
$bundles = array(
// ...
new Grunch\MercadopagoBundle\GrunchMercadopagoBundle(),
);
php
// src/Acme/DemoBundle/Controller/DemoController.php
namespace Acme\DemoBundle\Controller;
// ...
class DemoController extends Controller
{
public function indexAction()
{
// Crea el objeto MP
$mp = $this->get('grunch_mercadopago')->getMp();
// Crea un token
$token = $mp->get_access_token();
}
}