Skip to content

Commit

Permalink
Fixed code example, Fixed signature validation
Browse files Browse the repository at this point in the history
  • Loading branch information
toooni committed Mar 23, 2018
1 parent d7e1364 commit e4fa9fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ invit_plivo:
## Example
```php
$this->get(PlivoApi::class)->getCalls()->play(
$this->get(PlivoApi::class)->calls->play(
'cf5fe5ff-9952-yyyy-xxxx-b75ff490ffff',
['https://s3-eu-west-1.amazonaws.com/waitsongbucket/wait.mp3'],
[
Expand Down
8 changes: 4 additions & 4 deletions src/Invit/PlivoBundle/Helper/PlivoHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Invit\PlivoBundle\Helper;

use Invit\PlivoBundle\Service\PlivoApi;
use Plivo\Util\signatureValidation;
use Symfony\Component\HttpFoundation\Request;

class PlivoHelper
Expand All @@ -17,10 +17,10 @@ public function __construct(string $authToken)

public function validateRequest(Request $request) : bool
{
return PlivoApi::validate_signature(
return signatureValidation::validateSignature(
$request->getUri(),
$request->request->all(),
$request->headers->get('X-Plivo-Signature'),
$request->headers->get('X-Plivo-Signature-V2-Nonce'),
$request->headers->get('X-Plivo-Signature-V2'),
$this->authToken
);
}
Expand Down

0 comments on commit e4fa9fa

Please sign in to comment.