raphahardt/mercadopago-bundle

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

安装: 32

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 5

类型:symfony-bundle

0.1.2 2015-05-24 16:06 UTC

This package is not auto-updated.

Last update: 2024-09-20 18:42:32 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/