Skip to content

Commit aaf2aa9

Browse files
author
Lorna Jane Mitchell
authored
Merge pull request #50 from Vonage/vonage-rebrand
Swapped to Vonage namespace
2 parents 14d5601 + 68a4815 commit aaf2aa9

File tree

87 files changed

+279
-279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+279
-279
lines changed

.env-example

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
NEXMO_API_KEY=
2-
NEXMO_API_SECRET=
3-
NEXMO_APPLICATION_ID=
4-
NEXMO_APPLICATION_PRIVATE_KEY_PATH=
1+
VONAGE_API_KEY=
2+
VONAGE_API_SECRET=
3+
VONAGE_APPLICATION_ID=
4+
VONAGE_APPLICATION_PRIVATE_KEY_PATH=
55
FROM=
6-
NEXMO_TO_NUMBER=
6+
VONAGE_TO_NUMBER=
77
RECIPIENT_NUMBER=
88
TO_NUMBER=
9-
NEXMO_SECRET_ID=
9+
VONAGE_SECRET_ID=
1010
INSIGHT_NUMBER=
1111
SMS_CALLBACK_URL=
1212

1313
# Numbers API examples
14-
NEXMO_NUMBER=447700900001
15-
NEXMO_NUMBER_TYPE=mobile-lvn
16-
NEXMO_NUMBER_FEATURES=VOICE,SMS
14+
VONAGE_NUMBER=447700900001
15+
VONAGE_NUMBER_TYPE=mobile-lvn
16+
VONAGE_NUMBER_FEATURES=VOICE,SMS
1717
COUNTRY_CODE=GB
1818
NUMBER_SEARCH_PATTERN=1
1919
NUMBER_SEARCH_CRITERIA=234

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Nexmo APIs Quickstart Examples for PHP
1+
# Vonage APIs Quickstart Examples for PHP
22

33
<img src="https://developer.nexmo.com/assets/images/Vonage_Nexmo.svg" height="48px" alt="Nexmo is now known as Vonage" />
44

@@ -8,21 +8,21 @@ Quickstarts also available for [Java](https://github.com/nexmo/nexmo-java-code-s
88

99
## Setup
1010

11-
These code samples are meant to be used for [https://developer.nexmo.com/](https://developer.nexmo.com/), and are structured in such a way as to be used for internal testing. Developers are free to use these code snippets as a reference, but these may require changes to be worked into your specific application. We recommend checking out the [Nexmo Developer Website](https://developer.nexmo.com/), which displays these code snippets in a more copy/paste fashion.
11+
These code samples are meant to be used for [https://developer.nexmo.com/](https://developer.nexmo.com/), and are structured in such a way as to be used for internal testing. Developers are free to use these code snippets as a reference, but these may require changes to be worked into your specific application. We recommend checking out the [Vonage Developer Website](https://developer.nexmo.com/), which displays these code snippets in a more copy/paste fashion.
1212

1313
If you would like to run these examples yourself, you will need to do the following:
1414

1515
1. Run `composer install` in the root of the repository
1616
2. Copy `.env-example` to `.env`
17-
3. Edit `.env` with your Nexmo credentials
17+
3. Edit `.env` with your Vonage credentials
1818

1919
From there, you can fill out the various environment variables as detailed by the individual code snippet. Some snippets may share common environment variables.
2020

2121
Larger or more complex snippets may include their own `composer.json` file and have additional requirements. Please check any READMEs inside of the larger examples for setup instructions.
2222

23-
## Configure with Your Nexmo API Keys
23+
## Configure with Your Vonage API Keys
2424

25-
To use this sample you will first need a [Nexmo account](https://dashboard.nexmo.com/sign-up). Once you have your own API credentials, rename
25+
To use this sample you will first need a [Vonage account](https://dashboard.nexmo.com/sign-up). Once you have your own API credentials, rename
2626
the `.env-example` file to `.env` and set the values as required.
2727

2828
For some of the examples, you will need to [buy a number](https://dashboard.nexmo.com/buy-numbers).

account/account-balance.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
require_once __DIR__ . '/../config.php';
33
require_once __DIR__ . '/../vendor/autoload.php';
44

5-
$basic = new \Nexmo\Client\Credentials\Basic(NEXMO_API_KEY, NEXMO_API_SECRET);
6-
$client = new \Nexmo\Client($basic);
5+
$basic = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET);
6+
$client = new \Vonage\Client($basic);
77

88
$response = $client->account()->getBalance();
99
echo round($response->getBalance(), 2) . " EUR\n";

account/configure-account.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
require_once __DIR__ . '/../config.php';
33
require_once __DIR__ . '/../vendor/autoload.php';
44

5-
$basic = new \Nexmo\Client\Credentials\Basic(NEXMO_API_KEY, NEXMO_API_SECRET);
6-
$client = new \Nexmo\Client($basic);
5+
$basic = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET);
6+
$client = new \Vonage\Client($basic);
77

88
$response = $client->account()->updateConfig([
99
"sms_callback_url" => SMS_CALLBACK_URL

applications/create-application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
require_once __DIR__ . '/../config.php';
44
require_once __DIR__ . '/../vendor/autoload.php';
55

6-
$basic = new \Nexmo\Client\Credentials\Basic(NEXMO_API_KEY, NEXMO_API_SECRET);
7-
$client = new \Nexmo\Client(new \Nexmo\Client\Credentials\Container($basic));
6+
$basic = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET);
7+
$client = new \Vonage\Client(new \Vonage\Client\Credentials\Container($basic));
88

99
try {
1010
$application = new Nexmo\Application\Application();

applications/delete-application.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
require_once __DIR__ . '/../config.php';
44
require_once __DIR__ . '/../vendor/autoload.php';
55

6-
$basic = new \Nexmo\Client\Credentials\Basic(NEXMO_API_KEY, NEXMO_API_SECRET);
7-
$client = new \Nexmo\Client(new \Nexmo\Client\Credentials\Container($basic));
6+
$basic = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET);
7+
$client = new \Vonage\Client(new \Vonage\Client\Credentials\Container($basic));
88

99
try {
1010
$isDeleted = $client->applications()->delete(MESSAGES_APPLICATION_ID);
@@ -14,8 +14,8 @@
1414
} else {
1515
echo "Could not delete application " . MESSAGES_APPLICATION_ID . PHP_EOL;
1616
}
17-
} catch (\Nexmo\Client\Exception\Request $e) {
17+
} catch (\Vonage\Client\Exception\Request $e) {
1818
echo "There was a problem with the request: " . $e->getMessage() . PHP_EOL;
19-
} catch (\Nexmo\Client\Exception\Server $e) {
19+
} catch (\Vonage\Client\Exception\Server $e) {
2020
echo "The server encounted an error: " . $e->getMessage() . PHP_EOL;
2121
}

applications/get-application.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
require_once __DIR__ . '/../config.php';
44
require_once __DIR__ . '/../vendor/autoload.php';
55

6-
$basic = new \Nexmo\Client\Credentials\Basic(NEXMO_API_KEY, NEXMO_API_SECRET);
7-
$client = new \Nexmo\Client(new \Nexmo\Client\Credentials\Container($basic));
6+
$basic = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET);
7+
$client = new \Vonage\Client(new \Vonage\Client\Credentials\Container($basic));
88

99
try {
1010
$application = $client->applications()->get(MESSAGES_APPLICATION_ID);
1111

1212
echo $application->getId() . PHP_EOL;
1313
echo $application->getName() . PHP_EOL;
14-
} catch (\Nexmo\Client\Exception\Request $e) {
14+
} catch (\Vonage\Client\Exception\Request $e) {
1515
echo "There was a problem with the request: " . $e->getMessage() . PHP_EOL;
16-
} catch (\Nexmo\Client\Exception\Server $e) {
16+
} catch (\Vonage\Client\Exception\Server $e) {
1717
echo "The server encounted an error: " . $e->getMessage() . PHP_EOL;
1818
}

applications/list-applications.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
require_once __DIR__ . '/../config.php';
44
require_once __DIR__ . '/../vendor/autoload.php';
55

6-
$basic = new \Nexmo\Client\Credentials\Basic(NEXMO_API_KEY, NEXMO_API_SECRET);
7-
$client = new \Nexmo\Client(new \Nexmo\Client\Credentials\Container($basic));
6+
$basic = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET);
7+
$client = new \Vonage\Client(new \Vonage\Client\Credentials\Container($basic));
88

99
foreach ($client->applications() as $application) {
1010
echo sprintf("%s: %s\n", $application->getId(), $application->getName());

applications/update-application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
require_once __DIR__ . '/../config.php';
44
require_once __DIR__ . '/../vendor/autoload.php';
55

6-
$basic = new \Nexmo\Client\Credentials\Basic(NEXMO_API_KEY, NEXMO_API_SECRET);
7-
$client = new \Nexmo\Client(new \Nexmo\Client\Credentials\Container($basic));
6+
$basic = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET);
7+
$client = new \Vonage\Client(new \Vonage\Client\Credentials\Container($basic));
88

99
try {
1010
$application = $client->applications()->get(MESSAGES_APPLICATION_ID);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"nexmo/client": "^2.0",
3+
"vonage/client": "^2.3",
44
"vlucas/phpdotenv": "^2.5"
55
}
66
}

0 commit comments

Comments
 (0)