diff --git a/src/PathProcessor/CommercePathProcessor.php b/src/PathProcessor/CommercePathProcessor.php
index 05a5399..f2d3935 100644
--- a/src/PathProcessor/CommercePathProcessor.php
+++ b/src/PathProcessor/CommercePathProcessor.php
@@ -18,10 +18,10 @@ class CommercePathProcessor implements InboundPathProcessorInterface, OutboundPa
    */
   public function processInbound($path, Request $request) {
     if ($request instanceof Request) {
-      //Get the current requested uri.
-      $current_path = $request->getRequestUri();
+      // Get the current requested uri.
+      $current_path = $path;
       $arg = explode('/', $current_path);
-      if ($arg[1] == "checkout") {
+      if ($arg[1] == "checkout" && !is_numeric($arg[2])) {
         $path = $this->commerceUrlProcess($path, $arg, EncryptDecrypt::DECRYPT);
       }
     }
@@ -33,10 +33,10 @@ class CommercePathProcessor implements InboundPathProcessorInterface, OutboundPa
    */
   public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
     if ($request instanceof Request) {
-      //Get the current requested uri.
-      $current_path = $request->getRequestUri();
+      // Get the current requested uri.
+      $current_path = $path;
       $arg = explode('/', $current_path);
-      if ($arg[1] == "checkout") {
+      if ($arg[1] == "checkout" && is_numeric($arg[2])) {
         $path = $this->commerceUrlProcess($path, $arg, EncryptDecrypt::ENCRYPT);
       }
     }
@@ -56,7 +56,7 @@ class CommercePathProcessor implements InboundPathProcessorInterface, OutboundPa
    * @return string $path
    *   The processed path.
    */
-  protected function commerceUrlProcess($path, array $arg, string $crypt) {
+  protected function commerceUrlProcess($path, array $arg, $crypt) {
     $order_id = $arg[2];
     // If path matches with URL.
     if (preg_match('/\/checkout\/[a-zA-Z0-9]+\/([a-zA-Z_]+)/i', $path, $matches)) {
