-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added tf verification module * example added * example added * rest client fix * rest client fix * rest client fix * rest client fix * fix for tfverify * example fixed * fix * fix UTC * fix UTC * updated param names * fix utcs * fix utcs * fix utcs * added comments in getList * bump version --------- Co-authored-by: ajay <[email protected]> Co-authored-by: kalyan-plivo <[email protected]>
- Loading branch information
1 parent
feab8d3
commit 0061ba5
Showing
15 changed files
with
611 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
|
||
|
||
require 'vendor/autoload.php'; | ||
|
||
use Plivo\RestClient; | ||
use Plivo\Exceptions\PlivoRestException; | ||
|
||
|
||
|
||
$AUTH_ID = "authid"; | ||
$AUTH_TOKEN = "authtoken"; | ||
|
||
$client = new RestClient($AUTH_ID, $AUTH_TOKEN); | ||
$client->client->setTimeout(40); | ||
|
||
|
||
// Get TollfreeVerification by uuid | ||
echo "########## Get TollfreeVerification ###################\n"; | ||
try { | ||
$response = $client->tollfreeVerification->get( | ||
"03420d77-4fa8-45e1-6aad-f37d41a2ee4a" | ||
); | ||
|
||
print_r($response->properties); | ||
} | ||
catch (PlivoRestException $ex) { | ||
print_r($ex); | ||
} | ||
|
||
|
||
// List TollfreeVerification | ||
echo "########## List TollfreeVerification ###################\n"; | ||
try { | ||
$response = $client->tollfreeVerification->getList(); | ||
|
||
print_r($response); | ||
} | ||
catch (PlivoRestException $ex) { | ||
print_r($ex); | ||
} | ||
|
||
// // Create TollfreeVerification | ||
// echo "########## Create TollfreeVerification ###################\n"; | ||
// try { | ||
// $response = $client->tollfreeVerification->create( | ||
// "18554950186", | ||
// "2FA", | ||
// "42f92135-6ec2-4110-8da4-71171f6aad44", | ||
// "VERBAL", | ||
// "100", | ||
// "hbv", | ||
// "message_sample", | ||
// "http://google.com", | ||
// "https://plivobin-prod-usw1.plivops.com/1pcfjrt1", | ||
// "POST", | ||
// "this is additional_information", | ||
// "this is extra_data" | ||
// ); | ||
// | ||
// print_r($response); | ||
// } | ||
// catch (PlivoRestException $ex) { | ||
// print_r($ex); | ||
// } | ||
// | ||
// | ||
// // // Update TollfreeVerification by TollfreeVerification | ||
// // echo "########## Update TollfreeVerification ###################\n"; | ||
// // try { | ||
// // $response = $client->tollfreeVerification->update( | ||
// // "81fc8b2d-1ab8-47c9-7245-e454227b7b7b", | ||
// // ["3FA"] | ||
// // ); | ||
// // | ||
// // print_r($response); | ||
// // } | ||
// // catch (PlivoRestException $ex) { | ||
// // print_r($ex); | ||
// // } | ||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/Plivo/Resources/TollfreeVerification/TollfreeVerification.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace Plivo\Resources\TollfreeVerification; | ||
|
||
|
||
use Plivo\BaseClient; | ||
use Plivo\Resources\Resource; | ||
|
||
/** | ||
* Class EndUser | ||
* @package Plivo\Resources\TollfreeVerification | ||
* @property string $api_id | ||
* @property string $callback_method | ||
* @property string $callback_url | ||
* @property string $created_at | ||
* @property string $extra_data | ||
* @property string $additional_information | ||
* @property string $message_sample | ||
* @property string $number | ||
* @property string $optin_image_url | ||
* @property string $optin_type | ||
* @property string $profile_uuid | ||
* @property string $rejection_reason | ||
* @property string $status | ||
* @property string $updated_at | ||
* @property string $usecase | ||
* @property string $usecase_summary | ||
* @property string $uuid | ||
* @property string $volume | ||
*/ | ||
class TollfreeVerification extends Resource | ||
{ | ||
function __construct(BaseClient $client, array $response, $authId) | ||
{ | ||
parent::__construct($client); | ||
|
||
$this->properties = [ | ||
'created' => $response['created'], | ||
'number' => $response['number'], | ||
'lastModified' => $response['last_modified'], | ||
'callbackMethod' => $response['callback_method'], | ||
'callbackUrl' => $response['callback_url'], | ||
'extraData' => $response['extra_data'], | ||
'additionalInformation' => $response['additional_information'], | ||
'messageSample' => $response['message_sample'], | ||
'optinImageUrl' => $response['optin_image_url'], | ||
'optinType' => $response['optin_type'], | ||
'profileUuid' => $response['profile_uuid'], | ||
'errorMessage' => $response['error_message'], | ||
'status' => $response['status'], | ||
'usecase' => $response['usecase'], | ||
'usecaseSummary' => $response['usecase_summary'], | ||
'uuid' => $response['uuid'], | ||
'volume' => $response['volume'], | ||
]; | ||
|
||
$this->pathParams = [ | ||
'authId' => $authId, | ||
'uuid' => $response['uuid'] | ||
]; | ||
|
||
$this->id = $response['uuid']; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Plivo/Resources/TollfreeVerification/TollfreeVerificationCreateResponse.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Plivo\Resources\TollfreeVerification; | ||
|
||
|
||
use Plivo\Resources\ResponseUpdate; | ||
|
||
/** | ||
* Class TollfreeVerificationCreateResponse | ||
* @package Plivo\Resources\TollfreeVerification | ||
*/ | ||
class TollfreeVerificationCreateResponse extends ResponseUpdate | ||
{ | ||
/** | ||
* @var string The uuid of the Tollfree Verification | ||
*/ | ||
public $uuid; | ||
|
||
|
||
/** | ||
* TollfreeVerificationCreateResponse constructor. | ||
* @param string $uuid | ||
* @param string $apiID | ||
* @param string $message | ||
*/ | ||
|
||
public function __construct($uuid, $message, $apiID, $statusCode) | ||
{ | ||
parent::__construct($apiID, $message, $statusCode); | ||
|
||
$this->uuid = $uuid; | ||
} | ||
} |
Oops, something went wrong.