otidh/mercadopago-dx-php-laravel
Composer 安装命令:
composer require otidh/mercadopago-dx-php-laravel
包简介
README 文档
README
No more doctrine/common and doctrine/annotations issues when using Laravel Framework.
Why made a fork?
Refer this issues/pull requests:
https://github.com/mercadopago/dx-php/issues/78
https://github.com/mercadopago/dx-php/issues/106
Mercado Pago SDK for PHP
This library provides developers with a simple set of bindings to the Mercado Pago API.
PHP Versions Supported:
The SDK supports PHP 5.6 or major
Installation
Using Composer
- Download Composer if not already installed
- Go to your project directory and run
composer require mercadopago/dx-phpon the command line. - This how your directory structure would look like.
- Thats all, you have Mercado Pago SDK installed.
Quick Start
- You have to require the library from your Composer vendor folder.
require __DIR__ . '/vendor/autoload.php';
- Setup your credentials or major 10 11
You have two types of credentials:
- For API or custom checkout:
MercadoPago\SDK::setAccessToken("YOUR_ACCESS_TOKEN"); // On Production MercadoPago\SDK::setAccessToken("YOUR_TEST_ACCESS_TOKEN"); // On Sandbox
- For Web-checkout:
MercadoPago\SDK::setClientId("YOUR_CLIENT_ID"); MercadoPago\SDK::setClientSecret("YOUR_CLIENT_SECRET");
- Using resource objects.
You can interact with all the resources available in the public API, to this each resource is represented by classes according to the following diagram:
Sample
<?php require_once 'vendor/autoload.php'; MercadoPago\SDK::setAccessToken("YOUR_ACCESS_TOKEN"); $payment = new MercadoPago\Payment(); $payment->transaction_amount = 141; $payment->token = "YOUR_CARD_TOKEN"; $payment->description = "Ergonomic Silk Shirt"; $payment->installments = 1; $payment->payment_method_id = "visa"; $payment->payer = array( "email" => "larue.nienow@hotmail.com" ); $payment->save(); echo $payment->status; ?>
Support
Write us at developers.mercadopago.com
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-05

