lib/Ingenico/Connect/Sdk/Webhooks/WebhooksHelper.php
private function validateBody($body, $requestHeaders)
    {
        $signature = $this->getHeaderValue($requestHeaders, 'X-GCS-Signature');
        $keyId = $this->getHeaderValue($requestHeaders, 'X-GCS-KeyId');
        $secretKey = $this->secretKeyStore->getSecretKey($keyId);

        $expectedSignature = base64_encode(hash_hmac("sha256", $body, $secretKey, true));

        $isValid = $this->areEqualSignatures($signature, $expectedSignature);
        if (!$isValid) {
            throw new SignatureValidationException("failed to validate signature '$signature'");
        }
    }
private function validateBody($body, $requestHeaders)
    {
        $signature = $this->getHeaderValue($requestHeaders, 'X-GCS-Signature');
        $keyId = $this->getHeaderValue($requestHeaders, 'X-GCS-KeyId');
        $secretKey = $this->secretKeyStore->getSecretKey($keyId);

        $expectedSignature = base64_encode(hash_hmac("sha256", $body, $secretKey, true));

        $isValid = $this->areEqualSignatures($signature, $expectedSignature);
        if (!$isValid) {
            throw new SignatureValidationException("failed to validate signature '$signature'");
        }
    }
private function validateBody ( $ body , $ requestHeaders ) { $ signature = $ this -> getHeaderValue ( $ requestHeaders , 'X-GCS-Signature' ) ; $ keyId = $ this -> getHeaderValue ( $ requestHeaders , 'X-GCS-KeyId' ) ; $ secretKey = $ this -> secretKeyStore -> getSecretKey ( $ keyId ) ; $ expectedSignature = base64_encode ( hash_hmac ( "sha256" , $ body , $ secretKey , true ) ) ; $ isValid = $ this -> areEqualSignatures ( $ signature , $ expectedSignature ) ; if ( ! $ isValid ) { throw new SignatureValidationException ( "failed to validate signature '$signature'" ) ; } }
validation utility methods
validation utility methods