MercadoLibre 的 PHP SDK
From the first week of April 2021 we will stop maintaining our SDKs.
This project is not functional, the dependencies will not be updated to latest ones.
We recommend you read our documentation.
MercadoLibre's PHP SDK
This is the official PHP SDK for MercadoLibre's Platform.
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/mercadolibre/php-sdk.git"
}
],
"require": {
"mercadolibre/php-sdk": "*@dev"
}
}
Then run composer install
Download the files
Run composer install
Include autoload.php in your code:
require_once('/path-to-integration-folder/vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
…
This will give you the url to redirect the user. You need to specify a callback url which will be the one that the user will redirected after a successfull authrization process.
Once the user is redirected to your callback url, you'll receive in the query string, a parameter named code. You'll need this for the second part of the process
getToken($grant_type, $client_id, $client_secret, $redirect_uri, $code, $refresh_token);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OAuth20Api->getToken: ', $e->getMessage(), PHP_EOL;
}
?>
resourcePost($resource, $access_token, $body);
} catch (Exception $e) {
echo 'Exception when calling RestClientApi->resourcePost: ', $e->getMessage(), PHP_EOL;
}
?>
暂无开放 Issues,或尚未同步最近议题。