grunch/mercadopago-bundle

该包已被弃用,不再维护。未建议替代包。

这是一个帮助您使用 mercadopago API 的 Symfony2 Bundle。

0.1.2 2015-05-24 16:06 UTC

This package is not auto-updated.

Last update: 2022-02-05 03:19:27 UTC


README

此 Bundle 允许您快速将 Mercadopago API 集成到您的 Symfony 项目中。

Latest Stable Version Total Downloads Latest Unstable Version

许可证

License

使用 composer 安装

1 在 composer.json 的 require 键中添加

    "require" : {
        "grunch/mercadopago-bundle": "0.1.*",
    }
$ composer update

2 将您的 mercadopago 凭据添加到项目中

配置您的凭据

# app/config/config.yml

grunch_mercadopago:
    client_id: xxxxxx
    client_secret: xxxxxxx
    sandbox: true

3app/AppKernel.php 中注册此 Bundle

    $bundles = array(
        // ...
        new Grunch\MercadopagoBundle\GrunchMercadopagoBundle(),
    );

开始

  • 创建 mercadopago 对象
<?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();
	}
}
  • 使用控制台创建实体
$ php app/console doctrine:schema:update --force

贡献

  1. 分支项目
  2. 克隆仓库
  3. 获取编码规范修复器: wget http://cs.sensiolabs.org/get/php-cs-fixer.phar
  4. 在 PullRequest 之前,您应该运行编码规范修复器: php php-cs-fixer.phar fix -v .

有关 API 的更多信息

https://developers.mercadopago.com/