PHP wrapper for Mataharimall Seller Center API.
$ composer require mataharimall/php-sdk
download latest release & require 'autoload.php'.
require "mataharimall-php-sdk/autoload.php";
use Mataharimall\Mataharimall;
Check API Seller Apiary, for available endpoints.
$mataharimall = new Mataharimall(API_TOKEN, ENV);
$mataharimall->post($url , $parameter);
//get headers
$headers = $mataharimall->getResponseHeaders();
//get response Http Code
$httpCode = $mataharimall->getResponseCode();
//get body
$body = $mataharimall->getResponseBody();
$request = new MMRequest();
$request->setProxy([
'CURLOPT_PROXY' => PROXY_HOST,
'CURLOPT_PROXYUSERPWD' => PROXY_USERPWD,
'CURLOPT_PROXYPORT' => PROXY_PORT,
]);
$mataharimall = new Mataharimall(API_TOKEN, ENV, $request);
$results = $mataharimall->post($url , $parameter);
try {
$mataharimall = new Mataharimall(API_TOKEN, ENV);
$mataharimall->post($url, $parameter);
} catch (MMException $e) {
// print exception.
}
$result = $mataharimall->getResponseBody();
if ($mataharimall->getResponseCode() == 200 && !empty($result)) {
// success
} else {
// error
}