From e4fa9fa20aadf2cdf5363f8f636c9e0db0921163 Mon Sep 17 00:00:00 2001 From: Toni Rudolf Date: Fri, 23 Mar 2018 18:24:05 +0100 Subject: [PATCH] Fixed code example, Fixed signature validation --- README.md | 2 +- src/Invit/PlivoBundle/Helper/PlivoHelper.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f09199b..c0b16d3 100644 --- a/README.md +++ b/README.md @@ -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'], [ diff --git a/src/Invit/PlivoBundle/Helper/PlivoHelper.php b/src/Invit/PlivoBundle/Helper/PlivoHelper.php index 73a994d..0eb8f0e 100644 --- a/src/Invit/PlivoBundle/Helper/PlivoHelper.php +++ b/src/Invit/PlivoBundle/Helper/PlivoHelper.php @@ -3,7 +3,7 @@ namespace Invit\PlivoBundle\Helper; -use Invit\PlivoBundle\Service\PlivoApi; +use Plivo\Util\signatureValidation; use Symfony\Component\HttpFoundation\Request; class PlivoHelper @@ -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 ); }