jpblancodb/mercadopago

MercadoPago SDK for Laravel

v1.0.2 2016-06-15 15:02 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:53:12 UTC


README

  1. 安装

a) composer require jpblancodb/mercadopago b) 在 config/app 的 providers 数组中添加

'providers' => [

  JPBlancoDB\MercadoPago\MercadoPagoProvider::class

c) 在 config/app 的 aliases 数组中添加

'aliases' => [

  'MercadoPago' => JPBlancoDB\MercadoPago\MercadoPago::class

d) 执行 "php artisan vendor:publish"

e) 在 .env 文件中添加

MP_CLIENT=
MP_SECRET=
  1. 使用示例

使用 "MercadoPago" 门面

    $preference_data = array(
        "items" => array(
            array(
                "title" => "Title of what you are paying for",
                "currency_id" => "ARS",
                "category_id" => "Category",
                "quantity" => 1,
                "unit_price" => 10.2
            )
        )
    );
    
    $preference = MercadoPago::create_preference($preference_data);