liveecommerce / dx-php
Fork from mercadopago/dx-php changing the dependencies versions.
3.0.4
2021-11-04 14:23 UTC
Requires
- php: >=7.0.0
Requires (Dev)
- phpmd/phpmd: @stable
- phpunit/phpunit: ^5
- sebastian/phpcpd: *
- squizlabs/php_codesniffer: 2.3.*
- symfony/yaml: ~2.5
- vlucas/phpdotenv: ^2.5
- dev-master
- v5.6.x-dev
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 2.0.3.x-dev
- 2.0.1
- 2.0.0
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.7
- 1.2.6
- 1.2.6-beta
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1
- 1.0
- dev-release/2.0.2
- dev-releases/2.0.2
- dev-release/2.0.1
- dev-release/2.0.0
- dev-release/1.8.0
- dev-release/1.6.0
- dev-feature/trackingHeader
- dev-feature/OAuth
- dev-develop
This package is auto-updated.
Last update: 2025-03-13 17:05:29 UTC
README
This library provides developers with a simple set of bindings to the Mercado Pago API.
PHP Versions Supported:
The SDK supports PHP 7.1 or major
Installation
Using Composer
- Download Composer if not already installed
- Go to your project directory and run
composer require "liveecommerce/dx-php:1.9.0"
on 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
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 __DIR__ . '/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" ); echo $payment->status; ?>
Support
Write us at developers.mercadopago.com