diff --git a/composer.json b/composer.json index 54b97320..e2995543 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ "ext-fileinfo": "*", "monolog/monolog": "^2.2", "guzzlehttp/guzzle": "^7.0", - "composer/ca-bundle": "^1.3" + "composer/ca-bundle": "^1.3", + "ramsey/uuid": "^4.7" }, "require-dev": { "squizlabs/php_codesniffer": "3.*", diff --git a/src/Handlers/HMAC/Generator.php b/src/Handlers/HMAC/Generator.php index 15dea58e..e2c1fc91 100644 --- a/src/Handlers/HMAC/Generator.php +++ b/src/Handlers/HMAC/Generator.php @@ -21,6 +21,7 @@ namespace Buckaroo\Handlers\HMAC; use Buckaroo\Config\Config; +use Ramsey\Uuid\Uuid; class Generator extends Hmac { @@ -67,7 +68,7 @@ public function __construct(Config $config, $data, $uri, $method = 'POST') $this->base64Data($data); $this->uri($uri); - $this->nonce('nonce_' . rand(0000000, 9999999)); + $this->nonce(Uuid::uuid4()); $this->time(time()); }