Skip to content

Latest commit

 

History

History
51 lines (43 loc) · 1.75 KB

Purchase.md

File metadata and controls

51 lines (43 loc) · 1.75 KB

GetVoxnumberRegions

use Yproximite\IovoxBundle\Api\Numbering\Purchase\GetVoxnumberRegionsInterface;

public function example(GetVoxnumberRegionsInterface $getVoxnumberRegions)
{
    $voxnumberRegions = $getVoxnumberRegions->executeQuery($options); 
}

see GetVoxnumberRegions for available options

PurchaseVoxnumbers

use Yproximite\IovoxBundle\Api\Numbering\Purchase\Payload\PurchaseVoxNumberAdditionalInformationPayload;
use Yproximite\IovoxBundle\Api\Numbering\Purchase\Payload\PurchaseVoxnumberPayload;
use Yproximite\IovoxBundle\Api\Numbering\Purchase\Payload\PurchaseVoxnumbersPayload;
use Yproximite\IovoxBundle\Api\Numbering\Purchase\PurchaseVoxnumbersInterface;

public function example(PurchaseVoxnumbersInterface $purchaseVoxnumbers)
{
    $payload = new PurchaseVoxnumbersPayload([
        new PurchaseVoxnumberPayload(33, 9, 'NATIONAL', 1),
        new PurchaseVoxnumberPayload(
            33,// country_code
            4,// area_code
            'GEOGRAPHIC',//'NATIONAL', 'GEOGRAPHIC', 'TOLLFREE'
            2,// quantity
            new PurchaseVoxNumberAdditionalInformationPayload(
                'firstname', 
                'lastname',
                'company',
                'street',
                20,// building_number
                'city',
                'zipcode'
            )
        ),
        'callback_url',
        'cc_list',// A list of emails separated by commas
        'dynamic_quantity',// TRUE|FALSE
    ]);
    
    // if ok else BadResponseReturnException
    $response = $purchaseVoxnumbers->executeQuery($payload); 
}

see PurchaseVoxnumbersPayload for available payload arguments