1. Go to this page and download the library: Download rusdyahmad/php-easyparcel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rusdyahmad / php-easyparcel example snippets
use PhpEasyParcel\EasyParcel;
// Initialize with API key and country code
$easyparcel = new EasyParcel('your-api-key', 'my'); // 'my' for Malaysia, 'sg' for Singapore, etc.
use PhpEasyParcel\Config;
use PhpEasyParcel\EasyParcel;
// Load environment variables
Config::loadEnv();
// Initialize using environment variables
$easyparcel = new EasyParcel();
// Production environment (default)
$productionClient = new EasyParcel('your-api-key', 'my');
// Sandbox environment
$sandboxOptions = [
'base_uri' => "https://demo.connect.easyparcel.my/"
];
$sandboxClient = new EasyParcel('your-api-key', 'my', $sandboxOptions);
// Create a client (defaults to production)
$client = new EasyParcel('your-api-key', 'my');
// Switch to sandbox
$client->useSandbox();
// Switch back to production
$client->useProduction();
// Check current environment
echo $client->getBaseUrl();
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.