Skip to content

Commit

Permalink
Incorrect key when updating the voice number callback (#315)
Browse files Browse the repository at this point in the history
* Incorrect key when updating the voice number callback

* Fix all references and responses regarding the voiceCallback key value

* Updating the company logo, we've not been Nexmo for a while now
  • Loading branch information
SecondeJK authored Apr 29, 2022
1 parent 4ac4a0c commit 3d0c1f3
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Client Library for PHP
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![codecov](https://codecov.io/gh/Vonage/vonage-php-sdk-core/branch/master/graph/badge.svg)](https://codecov.io/gh/vonage/vonage-php-sdk-core)

<img src="https://developer.nexmo.com/assets/images/Vonage_Nexmo.svg" height="48px" alt="Nexmo is now known as Vonage" />
![The Vonage logo](./vonage_logo.png)

*This library requires a minimum PHP version of 7.4*

Expand Down
2 changes: 1 addition & 1 deletion src/Numbers/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Number implements EntityInterface, JsonSerializableInterface, JsonUnserial
public const FEATURE_ALL = 'SMS,MMS,VOICE';

public const WEBHOOK_MESSAGE = 'moHttpUrl';
public const WEBHOOK_VOICE_STATUS = 'voiceStatusCallbackUrl';
public const WEBHOOK_VOICE_STATUS = 'voiceStatusCallback';

public const ENDPOINT_SIP = 'sip';
public const ENDPOINT_TEL = 'tel';
Expand Down
4 changes: 2 additions & 2 deletions test/Numbers/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function testUpdateNumber($payload, $id, $expectedId, $lookup): void
$this->assertRequestFormBodyContains('moHttpUrl', 'https://example.com/new_message', $request);
$this->assertRequestFormBodyContains('voiceCallbackType', 'vxml', $request);
$this->assertRequestFormBodyContains('voiceCallbackValue', 'https://example.com/new_voice', $request);
$this->assertRequestFormBodyContains('voiceStatusCallbackUrl', 'https://example.com/new_status', $request);
$this->assertRequestFormBodyContains('voiceStatusCallback', 'https://example.com/new_status', $request);

return true;
}))->willReturn($first, $second, $third);
Expand All @@ -125,7 +125,7 @@ public function updateNumber(): array
'moHttpUrl' => 'https://example.com/new_message',
'voiceCallbackType' => 'vxml',
'voiceCallbackValue' => 'https://example.com/new_voice',
'voiceStatusCallbackUrl' => 'https://example.com/new_status'
'voiceStatusCallback' => 'https://example.com/new_status'
];

$rawId['country'] = 'US';
Expand Down
2 changes: 1 addition & 1 deletion test/Numbers/NumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function testStatusWebhook(): void
{
$this->assertSame($this->number, $this->number->setWebhook(Number::WEBHOOK_VOICE_STATUS, 'http://example.com'));
$this->assertEquals('http://example.com', $this->number->getWebhook(Number::WEBHOOK_VOICE_STATUS));
$this->assertArrayHas('voiceStatusCallbackUrl', 'http://example.com', $this->number->getRequestData());
$this->assertArrayHas('voiceStatusCallback', 'http://example.com', $this->number->getRequestData());
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/Numbers/responses/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"voiceCallbackType": "vxml",
"voiceCallbackValue": "https://example.com/voice",
"voiceStatusCallbackUrl": "https://example.com/status"
"voiceStatusCallback": "https://example.com/status"
},
{
"country": "US",
Expand All @@ -24,7 +24,7 @@
],
"voiceCallbackType": "vxml",
"voiceCallbackValue": "https://example.com/second_voice",
"voiceStatusCallbackUrl": "https://example.com/second_status"
"voiceStatusCallback": "https://example.com/second_status"
}
]
}
2 changes: 1 addition & 1 deletion test/Numbers/responses/single-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"voiceCallbackType": "vxml",
"voiceCallbackValue": "http://example.com/voice",
"voiceStatusCallbackUrl": "http://example.com/status"
"voiceStatusCallback": "http://example.com/status"
}
]
}
2 changes: 1 addition & 1 deletion test/Numbers/responses/single.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"voiceCallbackType": "vxml",
"voiceCallbackValue": "http://example.com/voice",
"voiceStatusCallbackUrl": "http://example.com/status"
"voiceStatusCallback": "http://example.com/status"
}
]
}
Binary file added vonage_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3d0c1f3

Please sign in to comment.