grunch / 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: 2022-02-05 03:19:27 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 .