Skip to content

sepehrmm/seller-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mataharimall Seller SDK

PHP wrapper for Mataharimall Seller Center API.

Installation

Composer Installation

$ composer require mataharimall/php-sdk

Manual Installation

download latest release & require 'autoload.php'.

require "mataharimall-php-sdk/autoload.php";

use Mataharimall\Mataharimall;

How to

Check API Seller Apiary, for available endpoints.

Basic Usage

$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();

Proxy Enabled

$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);

Error Handling

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
}

About

Public PHP wrapper for Mataharimall Seller Center API.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%