raphahardt / mercadopago-bundle
这是一个帮助您使用mercadopago API的Symfony2 Bundle
0.1.2
2015-05-24 16:06 UTC
Requires
- php: >=5.3.2
- mercadopago/sdk: 0.3.*
- symfony/framework-bundle: ~2.6
Requires (Dev)
- symfony/config: ~2.1
- symfony/dependency-injection: ~2.1
- symfony/http-kernel: ~2.1
- symfony/yaml: ~2.1
This package is not auto-updated.
Last update: 2024-09-20 18:42:32 UTC
README
此Bundle允许您快速将Mercadopago API适配到您的Symfony项目。
许可证
使用composer安装
1 在composer.json的require键中添加
"require" : { "grunch/mercadopago-bundle": "0.1.*", }
$ composer update
2 将您的mercadopago凭证添加到项目中
配置凭证
- 在以下地址获取您的CLIENT_ID和CLIENT_SECRET
- 委内瑞拉: https://www.mercadopago.com/mlv/herramientas/aplicaciones
- 巴西: https://www.mercadopago.com/mlb/ferramentas/aplicacoes
- 墨西哥: https://www.mercadopago.com/mlm/herramientas/aplicaciones
- 哥伦比亚: https://www.mercadopago.com/mco/herramientas/aplicaciones
- 阿根廷: https://www.mercadopago.com/mla/herramientas/aplicaciones
# app/config/config.yml grunch_mercadopago: client_id: xxxxxx client_secret: xxxxxxx sandbox: true
3 在app/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
贡献
- 分支项目
- 克隆仓库
- 获取编码规范修复器:
wget http://cs.sensiolabs.org/get/php-cs-fixer.phar - 在PullRequest之前,您应该使用
php php-cs-fixer.phar fix -v .运行编码规范修复器