dnetix/mercadopago
最新稳定版本:v0.8.2
Composer 安装命令:
composer require dnetix/mercadopago
包简介
An easy to use library for MercadoPago API communication
关键字:
README 文档
README
Installation
With Composer
From command line
composer require dnetix/mercadopago
As a dependency in your project's composer.json
{
"require": {
"dnetix/mercadopago": "0.8.*"
}
}
Basic checkout
- Create your application in https://applications.mercadopago.com
- Set the values for the configuration array (Structure in examples/config.php)
- Instanciate a MercadoPago object to create a preference. It can be binded to an IoC and create the preference
$mercadopago = Dnetix\MercadoPago\MercadoPago::load($config); $preference = $mercadoPago->addItem([ 'id' => 'PRODUCT_ID', 'title' => 'PRODUCT_TITLE', 'description' => 'PRODUCT_DESCRIPTION', 'quantity' => 1, 'unit_price' => 10000, 'picture_url' => 'OPTIONAL_URL_IMAGE_OF_PRODUCT', ]) ->addExternalReference('OPTIONAL_EXTERNAL_REFERENCE') ->createPreference();
- In your html
<a href="<?= $preference->initPoint() ?>" name="MP-Checkout" class="">Payment Link</a>
- And that's all. This process is explained in detail on examples/payment-creation/payment-simple.php
Examples
The examples for the different usage methods such as marketplace charges, payment search, notification handling and others are explained in the examples folder.
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-05