/* Inventory Flow: /* Operations used: List Countries List Country List Restrictions List State List Credit Package List DID List DID Group List Feature List Trunk List Zone */ Unirest::auth(Configuration::$BasicAuthUserName, Configuration::$BasicAuthPassword); $controller = new InventoryController(); try { //List Countries $listCountries = $controller->getCountries(0, 1, NULL, 'GEOGRAPHIC'); echo "<br/><br/><br/>"; echo "<b>List Countries Request content</b><br/>"; echo "<br/>"; echo "countryCodeA3: " . $listCountries->countries[0]->countryCodeA3 . "<br/>"; echo "countryName: " . $listCountries->countries[0]->countryName . "<br/>"; echo "phoneCode: " . $listCountries->countries[0]->phoneCode . "<br/>"; echo "hasStates: " . $listCountries->countries[0]->hasStates . "<br/>"; echo "hasRegulationRequirement: " . $listCountries->countries[0]->hasRegulationRequirement . "<br/>"; $countryCodeA3 = 'DNK'; //List Country $listCountry = $controller->getCountry($countryCodeA3); echo "<br/><br/><br/>";
-> linkAddress -> Unlink Address -> listRegulationAddress-> Delete Address /* Operations used: listZipCodes createRegulationAddress uploadProofOfAddress requestAddressVerification linkAddress Is Address Valid Unlink Address listRegulationAddress x2 Delete Address */ Unirest::auth(Configuration::$BasicAuthUserName, Configuration::$BasicAuthPassword); $controller = new RegulationController(); $inventoryController = new InventoryController(); try { //Get Zip Code DEU $zipCodes = $controller->getZipcode('DEU', 0, 1, NULL); echo "<br/><br/><br/>"; echo "<b>ZipCodes Response</b><br/>"; echo "cityZipCodes: " . $zipCodes->cityZipCodes[0]->cityName . "<br/>"; echo "zipCode: " . $zipCodes->cityZipCodes[0]->zipCode . "<br/>"; $zipCode = $zipCodes->cityZipCodes[0]->zipCode; $zipCode = NULL; //Create Regulation Address echo "<br/><br/>"; echo '<b>Create Regulation Address</b><br/>'; $customerReference = 'address #123'; $didType = 'GEOGRAPHIC'; $extraFields = array("Municipality Code" => "1235", "Street Code" => "1234");
/* Operations used: Account balance Create cart x2 Delete Cart Add to cart Get cart Remove from cart Checkout cart ListDids (inventory) Cancel dids List orders List Carts */ Unirest::auth(Configuration::$BasicAuthUserName, Configuration::$BasicAuthPassword); $controller = new OrderingController(); $inventoryController = new InventoryController(); try { $accountBal = $controller->getAccountBalance(); echo "<br/><br/><br/>"; echo "<b>accountBal Response</b><br/>"; $balance = $accountBal->accountBalance->balance; echo "balance: " . $accountBal->accountBalance->balance . "<br/>"; echo "threshold: " . $accountBal->accountBalance->threshold . "<br/>"; echo "currency: " . $accountBal->accountBalance->currency . "<br/>"; echo "active: " . $accountBal->accountBalance->active . "<br/>"; //If account balance high enough -> create cart if ($balance > 100) { //Create Cart $customerReference = "Cart #1"; $description = "Full Cart Checkout"; $body = new CartCreateModel($customerReference, $description);