diff --git a/src/Plivo/Resources/Pricing/Pricing.php b/src/Plivo/Resources/Pricing/Pricing.php index e4e46ffc..a4fad6d0 100644 --- a/src/Plivo/Resources/Pricing/Pricing.php +++ b/src/Plivo/Resources/Pricing/Pricing.php @@ -46,9 +46,12 @@ function __construct(BaseClient $client, $response) $outboundNetworksList ); + $toll_free = isset($response['phone_numbers']['tollfree']['rate']) ? $response['phone_numbers']['tollfree']['rate']: null; + $local = isset($response['phone_numbers']['local']['rate']) ? $response['phone_numbers']['local']['rate']: null; + $this->properties['phoneNumbers'] = new PhoneNumbers( - new Local($response['phone_numbers']['local']['rate']), - new Tollfree($response['phone_numbers']['tollfree']['rate']) + new Local($local), + new Tollfree($toll_free) ); $this->properties['voice'] = new Voice(