PHP code example of mhndev / asmari

1. Go to this page and download the library: Download mhndev/asmari 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/ */

    

mhndev / asmari example snippets



ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

 = new \mhndev\asmari\AsmariSoapClient($wsdl, $session_id);


#### 1) method get_zone_by_country

for($i=1; $i<=113; $i++) {
    $res = $asmari_client->getZoneByCountry($i);
    $returned_zones[] = $res;
    $zone_countries[$res][] = $i;
}


#### 2) method get_price

$get_price_data_object = (new \mhndev\asmari\GetPriceDataObject())
    ->setBirthDate(DateTime::createFromFormat('Y-m-d', '2011-05-01'))
    ->setZoneId(1)
    ->setDurationId(2);

$res = $asmari_client->getPrice($get_price_data_object);


var_dump($res);
die();




#### 3) method issue

$issue_data_object = (new \mhndev\asmari\IssueDataObject())
    ->setBirthDate(DateTime::createFromFormat('Y-m-d', '2011-05-01'))
    ->setZoneId(1)
    ->setDurationId(2)
    ->setFirstName('Majid')
    ->setLastName('Abdolhosseini')
    ->setPassportNumber('J97634522')
    ->setNationalCode('0014297884');
$res = $asmari_client->issue($issue_data_object);

var_dump($res);
die();