diff --git a/README.md b/README.md
index 565bbd7..8ebedf2 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,63 @@
-CONTENTS OF THIS FILE---------------------  * Introduction* Requirements* Installation* Configuration* MaintainersINTRODUCTION------------A custom module for Drupal 9/10 Commerce Stripe Checkout that extends the functionality of Drupal Commerce and integrates it with the Stripe Checkout payment gateway. It allows you to handle transactions securely using the Stripe payment platform which will redirect users to a pre-built Stripe form for the payment. This module integrates stripe-php v10 .This project integrates Stripe into the Drupal Commerce payment and checkout systems. * To submit bug reports and feature suggestions, or to track changes:   https://www.drupal.org/project/issues/commerce_stripe_checkoutREQUIREMENTS------------This module requires the following modules and libraries:* Drupal Commerce - https://www.drupal.org/project/commerce* Stripe PHP - https://github.com/stripe/stripe-phpINSTALLATION------------  * for further information. Commerce stripe checkout, like all Commerce modules, must be installed via Composer.   `composer require "drupal/commerce_stripe_checkout"` * Or install as you would normally install a contributed Drupal module. See:   https://www.drupal.org/docs/8/extending-drupal-8/installing-modules and install the Stripe PHP library via Composer. Run the following command:   `composer require stripe/stripe-php ^10.0`CONFIGURATION-------------    1. Navigate to Administration > Extend and enable the module.    2. Navigate to Administration > Commerce > Configuration > Payment Gateways.    3. Add new payment gateway:        * Select Stripe checkout Plugin.        * Fill in the Live Test Secret key and Test Secret key provided with your Stripe registration.MAINTAINERS----------- * Sujan Shrestha (sujan-shrestha) - https://www.drupal.org/u/sujan-shrestha
\ No newline at end of file
+CONTENTS OF THIS FILE
+---------------------
+  
+* Introduction
+* Requirements
+* Installation
+* Configuration
+* Maintainers
+
+
+INTRODUCTION
+------------
+A custom module for Drupal 9/10 Commerce Stripe Checkout that extends the
+functionality of Drupal Commerce and integrates it with the Stripe Checkout
+payment gateway. It allows you to handle transactions securely using the
+Stripe payment platform which will redirect users to a pre-built Stripe form
+for the payment. This module integrates stripe-php v10 .
+
+This project integrates Stripe into the Drupal Commerce payment and checkout
+systems.
+
+ * To submit bug reports and feature suggestions, or to track changes:
+   https://www.drupal.org/project/issues/commerce_stripe_checkout
+
+
+REQUIREMENTS
+------------
+
+This module requires the following modules and libraries:
+
+* Drupal Commerce - https://www.drupal.org/project/commerce
+* Stripe PHP - https://github.com/stripe/stripe-php
+
+
+INSTALLATION
+------------
+ 
+ * for further information. Commerce stripe checkout, like all Commerce
+ modules, must be installed via Composer.
+   `composer require "drupal/commerce_stripe_checkout"`
+ * Or install as you would normally install a contributed Drupal module. See:
+   https://www.drupal.org/docs/8/extending-drupal-8/installing-modules and
+   install the Stripe PHP library via Composer. Run the following command:
+   `composer require stripe/stripe-php ^10.0`
+
+
+CONFIGURATION
+-------------
+
+    1. Navigate to Administration > Extend and enable the module.
+    2. Navigate to Administration > Commerce > Configuration > Payment
+    Gateways.
+    3. Add new payment gateway:
+
+        * Select Stripe checkout Plugin.
+        * Fill in the Live Test Secret key and Test Secret key provided with
+        your Stripe registration.
+
+
+MAINTAINERS
+-----------
+
+ * Sujan Shrestha (sujan-shrestha) - https://www.drupal.org/u/sujan-shrestha
diff --git a/commerce_stripe_checkout.info.yml b/commerce_stripe_checkout.info.yml
index 443e111..41cac1f 100644
--- a/commerce_stripe_checkout.info.yml
+++ b/commerce_stripe_checkout.info.yml
@@ -8,4 +8,4 @@ dependencies:
   - commerce:commerce (>=2.3)
   - commerce:commerce_order
   - commerce:commerce_cart
-  - commerce:commerce_payment
\ No newline at end of file
+  - commerce:commerce_payment
diff --git a/commerce_stripe_checkout.module b/commerce_stripe_checkout.module
index cb2660d..81b24c0 100644
--- a/commerce_stripe_checkout.module
+++ b/commerce_stripe_checkout.module
@@ -1,14 +1,14 @@
 <?php
 
-use Drupal\Core\Routing\RouteMatchInterface;
-use Drupal\commerce_payment\Entity\PaymentInterface;
-use Drupal\commerce_order\Entity\OrderInterface;
-
 /**
  * @file
- * Contains commerce_stripe_checkout.module.
+ * Hooks implementation for the Commerce Stripe Checkout module.
  */
 
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\commerce_payment\Entity\PaymentInterface;
+use Drupal\commerce_order\Entity\OrderInterface;
+
 /**
  * Implements hook_help().
  */
@@ -16,11 +16,11 @@ function commerce_stripe_checkout_help($route_name, RouteMatchInterface $arg) {
 
   switch ($route_name) {
     case 'help.page.commerce_stripe_checkout':
-    $output = '';
-    $output .= '<h3>' . t('About') . '</h3>';
-    $output .= '<p>' . t('A custom module for Drupal 9/10 Commerce Stripe Checkout that extends the functionality of Drupal Commerce and integrates it with the Stripe Checkout payment gateway. It allows you to handle transactions securely using the Stripe payment platform which will redirect users to a pre-built Stripe form.') . '</p>';
+      $output = '';
+      $output .= '<h3>' . t('About') . '</h3>';
+      $output .= '<p>' . t('A custom module for Drupal 9/10 Commerce Stripe Checkout that extends the functionality of Drupal Commerce and integrates it with the Stripe Checkout payment gateway. It allows you to handle transactions securely using the Stripe payment platform which will redirect users to a pre-built Stripe form.') . '</p>';
 
-    return $output;
+      return $output;
   }
 }
 
@@ -31,54 +31,55 @@ function commerce_stripe_checkout_help($route_name, RouteMatchInterface $arg) {
  *   The payment entity to update.
  */
 function commerce_stripe_checkout_change_payment_status_completed(PaymentInterface $payment, OrderInterface $order) {
- $payment->setState('completed');
- $payment->save();
+  $payment->setState('completed');
+  $payment->save();
 
   // Set the order status to "completed".
- $order->set('state', 'completed');
+  $order->set('state', 'completed');
 
   // Save the order entity.
- $order->save();
+  $order->save();
 }
+
 /**
  * Custom function to change the payment status to "completed".
  *
- * @param \Drupal\commerce_payment\Entity\PaymentInterface $payment
- *   The payment entity to update.
+ * @param \Drupal\commerce_order\Entity\OrderInterface $order
+ *   The order interface.
  */
 function commerce_stripe_checkout_change_payment_status_cancelled(OrderInterface $order) {
   // Set the order status to "cancelled".
- $order->set('state', 'cancelled');
+  $order->set('state', 'cancelled');
 
   // Save the order entity.
- $order->save();
+  $order->save();
 }
 
-
- /**
-  * Log messages on the system
-  * @param  $log_type type of the error message
-  * @param  $message  message body
-  * @return
-  */
- function log_commerce_stripe_checkout_messages($log_type, $message)
- {
+/**
+ * Log messages on the system.
+ *
+ * @param string $log_type
+ *   Type of the error message.
+ * @param string $message
+ *   Message body.
+ */
+function log_commerce_stripe_checkout_messages($log_type, $message) {
   switch ($log_type) {
     case 'alert':
-    \Drupal::logger('paypal_plus')->alert($message);
-    break;
+      \Drupal::logger('paypal_plus')->alert($message);
+      break;
 
     case 'warning':
-    \Drupal::logger('paypal_plus')->warning($message);
-    break;
+      \Drupal::logger('paypal_plus')->warning($message);
+      break;
 
     case 'debug':
-    \Drupal::logger('paypal_plus')->debug($message);
-    break;
+      \Drupal::logger('paypal_plus')->debug($message);
+      break;
 
     default:
-    \Drupal::logger('paypal_plus')->info($message);
-    break;
+      \Drupal::logger('paypal_plus')->info($message);
+      break;
   }
 }
 
@@ -86,16 +87,16 @@ function commerce_stripe_checkout_change_payment_status_cancelled(OrderInterface
  * Implements hook_form_alter().
  */
 function commerce_stripe_checkout_form_alter(&$form, &$form_state, $form_id) {
-  if($form_id == 'commerce_payment_gateway_edit_form' || $form_id == 'commerce_payment_gateway_add_form') {
+  if ($form_id == 'commerce_payment_gateway_edit_form' || $form_id == 'commerce_payment_gateway_add_form') {
     $form['configuration']['form']['live_secret_key']['#states'] = [
       'visible' => [
-        'input[name="configuration[commerce_stripe_checkout_checkout][mode]"]' => ['value' => 'live']
-      ]
+        'input[name="configuration[commerce_stripe_checkout_checkout][mode]"]' => ['value' => 'live'],
+      ],
     ];
     $form['configuration']['form']['secret_key']['#states'] = [
       'visible' => [
-        'input[name="configuration[commerce_stripe_checkout_checkout][mode]"]' => ['value' => 'test']
-      ]
+        'input[name="configuration[commerce_stripe_checkout_checkout][mode]"]' => ['value' => 'test'],
+      ],
     ];
   }
-}
\ No newline at end of file
+}
diff --git a/commerce_stripe_checkout.routing.yml b/commerce_stripe_checkout.routing.yml
index fd6fce1..d089fd5 100755
--- a/commerce_stripe_checkout.routing.yml
+++ b/commerce_stripe_checkout.routing.yml
@@ -1,15 +1,17 @@
 commerce_stripe_checkout.payment_success:
   path: '/stripe-pay/success'
   defaults:
-    _controller: '\Drupal\commerce_stripe_checkout\Controller\StripeController::payment_success'
+    _controller: '\Drupal\commerce_stripe_checkout\Controller\StripeController::paymentSuccess'
     _title: ""
   requirements:
+    # No access restrictions
     _access: 'TRUE'
 
 commerce_stripe_checkout.payment_cancel:
   path: '/stripe-pay/cancel'
   defaults:
-    _controller: '\Drupal\commerce_stripe_checkout\Controller\StripeController::payment_cancel'
+    _controller: '\Drupal\commerce_stripe_checkout\Controller\StripeController::paymentCancel'
     _title: ""
   requirements:
-    _access: 'TRUE'
\ No newline at end of file
+    # No access restrictions
+    _access: 'TRUE'
diff --git a/src/Controller/StripeController.php b/src/Controller/StripeController.php
index 8158825..3ca8f9c 100755
--- a/src/Controller/StripeController.php
+++ b/src/Controller/StripeController.php
@@ -5,148 +5,135 @@ namespace Drupal\commerce_stripe_checkout\Controller;
 use Drupal\Core\Controller\ControllerBase;
 use Drupal\Core\Url;
 use Symfony\Component\HttpFoundation\RedirectResponse;
-use Symfony\Component\HttpFoundation\JsonResponse;
-use Symfony\Component\HttpFoundation\Request;
 use Drupal\commerce_order\Entity\OrderInterface;
 use Drupal\commerce_payment\Entity\PaymentInterface;
 
 /**
  * Defines StripeController class.
  */
-class StripeController extends ControllerBase
-{
-    /**
-     * Callback URL handling for Sendinblue API API.
-     *
-     * @param \Symfony\Component\HttpFoundation\Request $request
-     *   Request.
-     *
-     * @return array
-     *   Return markup for the page.
-     */
-    public function payment_success()
-    {
-        $stsess = \Drupal::request()->query->get('stsess');
-        $get_stripe_stsess = $this->get_stripe_stsess();
-
-        if ($stsess != $get_stripe_stsess) {
-            return $this->redirect_homepage();
-        }
-
-        $get_stripe_payment = $this->get_stripe_payment();
-        $get_stripe_order = $this->get_stripe_order();
-
-        if ($get_stripe_order instanceof OrderInterface && $get_stripe_payment instanceof PaymentInterface) {
-
-            commerce_stripe_checkout_change_payment_status_completed($get_stripe_payment, $get_stripe_order);
-
-            $message = '';
-            // Invoke the custom hook for success message.
-            \Drupal::moduleHandler()->invokeAll('commerce_stripe_checkout_success_message', [&$message]);
-            if($message == '') {
-                $message = '<strong>Success!</strong> Your payment has been successfully processed.';
-            }
-
-            \Drupal::messenger()->addMessage($this->t($message));
-
-            $this->unset_stripe_session();
-
-            $url = Url::fromRoute('commerce_checkout.form', ['commerce_order' => $get_stripe_order->id()]);
-
-            $response = new RedirectResponse($url->toString());
-            // $response->send();
-            return $response;
-        } else {
-            return $this->redirect_homepage();
-        }
+class StripeController extends ControllerBase {
+
+  /**
+   * Callback URL handling for Sendinblue API API.
+   *
+   * @return array
+   *   Return markup for the page.
+   */
+  public function paymentSuccess() {
+    $stsess = \Drupal::request()->query->get('stsess');
+    $getStripeStsess = $this->getStripeStsess();
+
+    if ($stsess != $getStripeStsess) {
+      return $this->redirectHomepage();
     }
 
-    /**
-     * Callback URL handling for Sendinblue API API.
-     *
-     * @param \Symfony\Component\HttpFoundation\Request $request
-     *   Request.
-     *
-     * @return array
-     *   Return markup for the page.
-     */
-    public function payment_cancel()
-    {
-        $stsess = \Drupal::request()->query->get('stsess');
-        $get_stripe_stsess = $this->get_stripe_stsess();
-        if ($stsess != $get_stripe_stsess) {
-            return $this->redirect_homepage();
-        }
-
-        $get_stripe_order = $this->get_stripe_order();
-        if ($get_stripe_order instanceof OrderInterface) {
-            commerce_stripe_checkout_change_payment_status_cancelled($get_stripe_order);
-            $this->unset_stripe_session();
-
-            $message = '';
-
-            // Invoke the custom hook for failure message.
-            \Drupal::moduleHandler()->invokeAll('commerce_stripe_checkout_failure_message', [&$message]);
-
-            if($message == '') {
-                $message =  '<strong>Payment Canceled!</strong> Your transaction has been canceled.';
-            }
-
-            \Drupal::messenger()->addMessage($this->t($message));
-        }
-
-        return $this->redirect_homepage();
-    }
+    $getStripePayment = $this->getStripePayment();
+    $getStripeOrder = $this->getStripeOrder();
 
-    /**
-     * get stripe payment
-     */
-    public function get_stripe_payment()
-    {
-        $session = \Drupal::service('session');
-        $stripe_payment = $session->get('stripe_payment')??0;
-        return $stripe_payment;
-    }
+    if ($getStripeOrder instanceof OrderInterface && $getStripePayment instanceof PaymentInterface) {
 
-    /**
-     * Get stripe order
-     */
-    public function get_stripe_order()
-    {
-        $session = \Drupal::service('session');
-        $stripe_order = $session->get('stripe_order')??0;
-        return $stripe_order;
-    }
+      commerce_stripe_checkout_change_payment_status_completed($getStripePayment, $getStripeOrder);
 
-    /**
-     * Get stripe session key
-     */
-    public function get_stripe_stsess()
-    {
-        $session = \Drupal::service('session');
-        $stsess = $session->get('stsess');
-        return $stsess;
-    }
+      $message = '';
+      // Invoke the custom hook for success message.
+      \Drupal::moduleHandler()->invokeAll('commerce_stripe_checkout_success_message', [&$message]);
+      if ($message == '') {
+        $message = $this->t('<strong>Success!</strong> Your payment has been successfully processed.');
+      }
 
-    /**
-     * Unset stripe session
-     */
-    public function unset_stripe_session()
-    {
-        $session = \Drupal::service('session');
-        $session->set('stripe_payment', []);
-        $session->set('stripe_order', []);
-        $session->set('stsess', '');
+      \Drupal::messenger()->addMessage($message);
+
+      $this->unsetStripeSession();
+
+      $url = Url::fromRoute('commerce_checkout.form', ['commerce_order' => $getStripeOrder->id()]);
+
+      $response = new RedirectResponse($url->toString());
+      // $response->send();
+      return $response;
+    }
+    else {
+      return $this->redirectHomepage();
     }
+  }
+
+  /**
+   * Callback URL handling for Sendinblue API API.
+   *
+   * @return array
+   *   Return markup for the page.
+   */
+  public function paymentCancel() {
+    $stsess = \Drupal::request()->query->get('stsess');
+    $getStripeStsess = $this->getStripeStsess();
+    if ($stsess != $getStripeStsess) {
+      return $this->redirectHomepage();
+    }
+
+    $getStripeOrder = $this->getStripeOrder();
+    if ($getStripeOrder instanceof OrderInterface) {
+      commerce_stripe_checkout_change_payment_status_cancelled($getStripeOrder);
+      $this->unsetStripeSession();
+
+      $message = '';
+
+      // Invoke the custom hook for failure message.
+      \Drupal::moduleHandler()->invokeAll('commerce_stripe_checkout_failure_message', [&$message]);
 
-    /**
-     * Redirect to homepage
-     */
-    public function redirect_homepage()
-    {
-        $redirect_url = Url::fromRoute('<front>', [], ['absolute' => true])->toString();
-        $response = new RedirectResponse($redirect_url);
-        // $response->send();
-        return $response;
+      if ($message == '') {
+        $message = $this->t('<strong>Payment Canceled!</strong> Your transaction has been canceled.');
+      }
+
+      \Drupal::messenger()->addMessage($message);
     }
+
+    return $this->redirectHomepage();
+  }
+
+  /**
+   * Get stripe payment.
+   */
+  public function getStripePayment() {
+    $session = \Drupal::service('session');
+    $stripe_payment = $session->get('stripe_payment') ?? 0;
+    return $stripe_payment;
+  }
+
+  /**
+   * Get stripe order.
+   */
+  public function getStripeOrder() {
+    $session = \Drupal::service('session');
+    $stripe_order = $session->get('stripe_order') ?? 0;
+    return $stripe_order;
+  }
+
+  /**
+   * Get stripe session key.
+   */
+  public function getStripeStsess() {
+    $session = \Drupal::service('session');
+    $stsess = $session->get('stsess');
+    return $stsess;
+  }
+
+  /**
+   * Unset stripe session.
+   */
+  public function unsetStripeSession() {
+    $session = \Drupal::service('session');
+    $session->set('stripe_payment', []);
+    $session->set('stripe_order', []);
+    $session->set('stsess', '');
+  }
+
+  /**
+   * Redirect to homepage.
+   */
+  public function redirectHomepage() {
+    $redirect_url = Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString();
+    $response = new RedirectResponse($redirect_url);
+    // $response->send();
+    return $response;
+  }
+
 }
diff --git a/src/Event/CommerceStripeCheckoutEvents.php b/src/Event/CommerceStripeCheckoutEvents.php
index ba0333e..2665220 100644
--- a/src/Event/CommerceStripeCheckoutEvents.php
+++ b/src/Event/CommerceStripeCheckoutEvents.php
@@ -8,20 +8,22 @@ namespace Drupal\commerce_stripe_checkout\Event;
 final class CommerceStripeCheckoutEvents {
 
   /*
-    * Name of the event fired when CommerceStripeCheckout authorizes a transaction.
-    *
-    * @Event
-    *
-    * @see \Drupal\commerce_stripe_checkout\Event\CommerceStripeCheckoutPaymentEvent
-    */
+   * Name of event fired when CommerceStripeCheckout authorizes a transaction.
+   *
+   * @Event
+   *
+   * @see
+   * \Drupal\commerce_stripe_checkout\Event\CommerceStripeCheckoutPaymentEvent
+   */
   const PAYMENT_SUCCESS = 'commerce_stripe_checkout.payment_success';
   /**
    * Name of the event fired when CommerceStripeCheckout voids a transaction.
    *
    * @Event
    *
-   * @see \Drupal\commerce_stripe_checkout\Event\CommerceStripeCheckoutPaymentEvent
+   * @see
+   * \Drupal\commerce_stripe_checkout\Event\CommerceStripeCheckoutPaymentEvent
    */
   const PAYMENT_FAILURE = 'commerce_stripe_checkout.payment_failure';
 
-}
\ No newline at end of file
+}
diff --git a/src/Event/CommerceStripeCheckoutPaymentEvent.php b/src/Event/CommerceStripeCheckoutPaymentEvent.php
index f583008..d642be2 100644
--- a/src/Event/CommerceStripeCheckoutPaymentEvent.php
+++ b/src/Event/CommerceStripeCheckoutPaymentEvent.php
@@ -25,7 +25,6 @@ class CommerceStripeCheckoutPaymentEvent extends Event {
    * @param \Drupal\commerce_order\Entity\OrderInterface $order
    *   The order.
    */
-
   public function __construct(OrderInterface $order) {
     $this->order = $order;
   }
@@ -39,4 +38,5 @@ class CommerceStripeCheckoutPaymentEvent extends Event {
   public function getOrder() {
     return $this->order;
   }
-}
\ No newline at end of file
+
+}
diff --git a/src/Plugin/Commerce/PaymentGateway/CommerceStripeCheckoutCheckout.php b/src/Plugin/Commerce/PaymentGateway/CommerceStripeCheckoutCheckout.php
index d96234b..f71dd52 100644
--- a/src/Plugin/Commerce/PaymentGateway/CommerceStripeCheckoutCheckout.php
+++ b/src/Plugin/Commerce/PaymentGateway/CommerceStripeCheckoutCheckout.php
@@ -22,8 +22,6 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 
-
-
 /**
  * Provides the Stripe Checkout payment gateway plugin.
  *
@@ -120,13 +118,13 @@ class CommerceStripeCheckoutCheckout extends OffsitePaymentGatewayBase implement
     $form['live_secret_key'] = [
       '#type' => 'textfield',
       '#title' => $this->t('Live Test Secret key'),
-      '#description' => t('The merchant id from the stirpe provider.'),
+      '#description' => $this->t('The merchant id from the stirpe provider.'),
       '#default_value' => $this->state->get('stripe_checkout.live_secret_key'),
     ];
     $form['secret_key'] = [
       '#type' => 'textfield',
       '#title' => $this->t('Test Secret key'),
-      '#description' => t('The secret key id from the stirpe provider.'),
+      '#description' => $this->t('The secret key id from the stirpe provider.'),
       '#default_value' => $this->state->get('stripe_checkout.secret_key'),
     ];
 
@@ -176,7 +174,7 @@ class CommerceStripeCheckoutCheckout extends OffsitePaymentGatewayBase implement
       $this->eventDispatcher->dispatch(CommerceStripeCheckoutEvents::PAYMENT_FAILURE, $event);
 
       $this->messenger->addWarning($this->t('Transaction failed: @message'), [
-        '@message' => $request->request->get('message')
+        '@message' => $request->request->get('message'),
       ]);
     }
   }
@@ -195,7 +193,7 @@ class CommerceStripeCheckoutCheckout extends OffsitePaymentGatewayBase implement
 
     foreach ($order->getItems() as $item) {
       $product_sku = $item->getPurchasedEntity()->getSku();
-      $order_desc .= $item->getTitle()  . ' [' . $product_sku . ']';
+      $order_desc .= $item->getTitle() . ' [' . $product_sku . ']';
       $order_desc .= ', ';
     }
 
@@ -207,13 +205,14 @@ class CommerceStripeCheckoutCheckout extends OffsitePaymentGatewayBase implement
     $nonce = md5(microtime() . mt_rand());
 
     // Build a name-value pair array for this transaction.
-    // The data which should be signed to be transported to CommerceStripeCheckout.ro.
+    // The data which should be signed to be transported to
+    // CommerceStripeCheckout.ro.
     $data = [
       'amount' => Calculator::round($amount->getNumber(), 2),
       'currency' => $amount->getCurrencyCode(),
       'invoice_id' => $order->id(),
       'order_desc' => $order_desc,
-      'merch_id' => $configuration['live_secret_key']??'',
+      'merch_id' => $configuration['live_secret_key'] ?? '',
       'timestamp' => $timestamp,
       'nonce' => $nonce,
     ];
@@ -231,11 +230,11 @@ class CommerceStripeCheckoutCheckout extends OffsitePaymentGatewayBase implement
       'currency' => $amount->getCurrencyCode(),
       'invoice_id' => $order->id(),
       'order_desc' => $order_desc,
-      'merch_id' => $configuration['live_secret_key']??'',
+      'merch_id' => $configuration['live_secret_key'] ?? '',
       'timestamp' => $timestamp,
       'nonce' => $nonce,
       'order' => $order,
-      'fp_hash' => strtoupper($this->hashData($data, $configuration['secret_key']??''))
+      'fp_hash' => strtoupper($this->hashData($data, $configuration['secret_key'] ?? '')),
     ];
 
     return $nvp_data;
@@ -245,33 +244,33 @@ class CommerceStripeCheckoutCheckout extends OffsitePaymentGatewayBase implement
    * Get data from Request object.
    *
    * @param \Symfony\Component\HttpFoundation\Request $request
-   *  The request object.
+   *   The request object.
    *
    * @return array
    *   The built request array.
    */
   public function getRequestData(Request $request) {
     return [
-     'amount' => addslashes(trim($request->request->get('amount'))),
-     'curr' => addslashes(trim($request->request->get('curr'))),
-     'invoice_id' => addslashes(trim($request->request->get('invoice_id'))),
+      'amount' => addslashes(trim($request->request->get('amount'))),
+      'curr' => addslashes(trim($request->request->get('curr'))),
+      'invoice_id' => addslashes(trim($request->request->get('invoice_id'))),
        // A unique id provided by CommerceStripeCheckout.ro.
-     'ep_id' => addslashes(trim($request->request->get('ep_id'))),
-     'merch_id' => addslashes(trim($request->request->get('merch_id'))),
+      'ep_id' => addslashes(trim($request->request->get('ep_id'))),
+      'merch_id' => addslashes(trim($request->request->get('merch_id'))),
        // For the transaction to be ok, the action should be 0.
-     'action' => addslashes(trim($request->request->get('action'))),
+      'action' => addslashes(trim($request->request->get('action'))),
        // The transaction response message.
-     'message' => addslashes(trim($request->request->get('message'))),
+      'message' => addslashes(trim($request->request->get('message'))),
        // If the transaction action is different 0, the approval value is empty.
-     'approval' => addslashes(trim($request->request->get('approval'))),
-     'timestamp' => addslashes(trim($request->request->get('timestamp'))),
-     'nonce' => addslashes(trim($request->request->get('nonce'))),
-   ];
- }
+      'approval' => addslashes(trim($request->request->get('approval'))),
+      'timestamp' => addslashes(trim($request->request->get('timestamp'))),
+      'nonce' => addslashes(trim($request->request->get('nonce'))),
+    ];
+  }
 
   /**
-    * {@inheritdoc}
-    */
+   * {@inheritdoc}
+   */
   public function onNotify(Request $request) {
     $data = $request->request->all();
 
@@ -289,8 +288,7 @@ class CommerceStripeCheckoutCheckout extends OffsitePaymentGatewayBase implement
 
     $order = Order::load($data['invoice_id']);
 
-    $payment = $this->createPaymentStorage($order, $request, 'notify');
-
+    // $payment = $this->createPaymentStorage($order, $request, 'notify');
     if ($request->request->get('action') == "0") {
       $order->set('state', 'completed');
       $this->messenger->addMessage($this->t('The payment was made successfully.'));
@@ -298,7 +296,7 @@ class CommerceStripeCheckoutCheckout extends OffsitePaymentGatewayBase implement
     }
     else {
       $this->messenger->addWarning($this->t('Transaction failed: @message.', [
-        '@message' => $request->request->get('message')
+        '@message' => $request->request->get('message'),
       ]));
       $url = Url::fromUri('internal:/checkout/' . $order->id() . '/order_information');
     }
@@ -312,9 +310,11 @@ class CommerceStripeCheckoutCheckout extends OffsitePaymentGatewayBase implement
    * Create a PaymentStorage object.
    *
    * @param \Drupal\commerce_order\Entity\OrderInterface $order
-   *  The commerce_order object.
+   *   The commerce_order object.
    * @param \Symfony\Component\HttpFoundation\Request $request
-   *  The Request object.
+   *   The Request object.
+   * @param string $payment_state
+   *   The payment state.
    *
    * @return \Drupal\Core\Entity\EntityStorageInterface
    *   The PaymentStorage object.
@@ -340,33 +340,27 @@ class CommerceStripeCheckoutCheckout extends OffsitePaymentGatewayBase implement
       $payment_storage->state = 'authorization_voided';
 
       $this->messenger->addWarning($this->t('Transaction failed: @message'), [
-        '@message' => $request->request->get('message')
+        '@message' => $request->request->get('message'),
       ]);
     }
     $payment_storage->save();
     return $payment_storage;
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function onCancel(OrderInterface $order, Request $request) {
-    parent::onCancel($order, $request);
-  }
-
   /**
    * Custom function from CommerceStripeCheckout documentation.
-   * Fore more details, please read the documentation from module.
+   *
+   * For more details, please read the documentation from module.
    *
    * @param array $data
-   *  Data that is passed through SHA1 function.
+   *   Data that is passed through SHA1 function.
    * @param string $key
-   *  Test Secret key.
+   *   Test Secret key.
    *
-   * @return string.
-   *  Hash code that is sent to CommerceStripeCheckout.
+   * @return string
+   *   Hash code that is sent to CommerceStripeCheckout.
    */
-  public static function hashData($data, $key) {
+  public static function hashData(array $data, $key) {
     $str = NULL;
 
     foreach ($data as $d) {
@@ -378,38 +372,38 @@ class CommerceStripeCheckoutCheckout extends OffsitePaymentGatewayBase implement
         $str .= strlen($d) . $d;
       }
     }
-      // We convert the secret code into a binary string.
-    // $key = pack('H*', $key);
-
+    // We convert the secret code into a binary string.
+    // $key = pack('H*', $key);.
     return self::hashSHA1($str, $key);
   }
 
- /**
-  * Custom function from CommerceStripeCheckout documentation.
-  * Fore more details, please read the documentation from module.
-  *
-  * @param string $data
-  *   Data regarding the order.
-  * @param string $key
-  *   Test Secret key.
-  *
-  * @return string.
-  *   The digest of the function.
-  */
- private static function hashSHA1($data, $key) {
-   $blocksize = 64;
-   $hashfunc = 'md5';
-
-   if (strlen($key) > $blocksize) {
-    $key = pack('H*', $hashfunc($key));
-  }
+  /**
+   * Custom function from CommerceStripeCheckout documentation.
+   *
+   * For more details, please read the documentation from module.
+   *
+   * @param string $data
+   *   Data regarding the order.
+   * @param string $key
+   *   Test Secret key.
+   *
+   * @return string
+   *   The digest of the function.
+   */
+  private static function hashSHA1($data, $key) {
+    $blocksize = 64;
+    $hashfunc = 'md5';
+
+    if (strlen($key) > $blocksize) {
+      $key = pack('H*', $hashfunc($key));
+    }
 
-  $key = str_pad($key, $blocksize, chr(0x00));
-  $ipad = str_repeat(chr(0x36), $blocksize);
-  $opad = str_repeat(chr(0x5c), $blocksize);
+    $key = str_pad($key, $blocksize, chr(0x00));
+    $ipad = str_repeat(chr(0x36), $blocksize);
+    $opad = str_repeat(chr(0x5c), $blocksize);
 
-  $hmac = pack('H*', $hashfunc(($key ^ $opad) . pack('H*', $hashfunc(($key ^ $ipad) . $data))));
-  return bin2hex($hmac);
-}
+    $hmac = pack('H*', $hashfunc(($key ^ $opad) . pack('H*', $hashfunc(($key ^ $ipad) . $data))));
+    return bin2hex($hmac);
+  }
 
 }
diff --git a/src/Plugin/Commerce/PaymentGateway/CommerceStripeCheckoutCheckoutInterface.php b/src/Plugin/Commerce/PaymentGateway/CommerceStripeCheckoutCheckoutInterface.php
index 139d220..1103222 100644
--- a/src/Plugin/Commerce/PaymentGateway/CommerceStripeCheckoutCheckoutInterface.php
+++ b/src/Plugin/Commerce/PaymentGateway/CommerceStripeCheckoutCheckoutInterface.php
@@ -5,10 +5,10 @@ namespace Drupal\commerce_stripe_checkout\Plugin\Commerce\PaymentGateway;
 use Drupal\commerce_payment\Entity\PaymentInterface;
 
 /**
- * Provides the interface for the CommerceStripeCheckout Checkout payment gateway.
+ * Provides interface for the CommerceStripeCheckout Checkout payment gateway.
  */
 interface CommerceStripeCheckoutCheckoutInterface {
-  
+
   /**
    * SetCommerceStripeCheckoutCheckout request.
    *
@@ -19,7 +19,7 @@ interface CommerceStripeCheckoutCheckoutInterface {
    *
    * @return array
    *   CommerceStripeCheckout data.
-   *   
    */
   public function setCommerceStripeCheckoutCheckoutData(PaymentInterface $payment);
+
 }
diff --git a/src/PluginForm/CommerceStripeCheckoutCheckoutForm.php b/src/PluginForm/CommerceStripeCheckoutCheckoutForm.php
index ae2a236..9ea109a 100644
--- a/src/PluginForm/CommerceStripeCheckoutCheckoutForm.php
+++ b/src/PluginForm/CommerceStripeCheckoutCheckoutForm.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\commerce_stripe_checkout\PluginForm;
 
+use Stripe\Checkout\Session;
+use Stripe\Stripe;
 use Drupal\commerce_payment\PluginForm\PaymentOffsiteForm as BasePaymentOffsiteForm;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\commerce_order\Entity\OrderInterface;
@@ -9,6 +11,9 @@ use Drupal\Core\Url;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Drupal\Component\Utility\Random;
 
+/**
+ * Provides the payment form for Commerce Stripe Checkout.
+ */
 class CommerceStripeCheckoutCheckoutForm extends BasePaymentOffsiteForm {
 
   /**
@@ -24,10 +29,11 @@ class CommerceStripeCheckoutCheckoutForm extends BasePaymentOffsiteForm {
     $configuration = $payment_gateway_plugin->getConfiguration();
     $mode = $configuration['mode'];
 
-    if($mode == 'live') {
-      $secret_key = $configuration['live_secret_key']??'';
-    } else {
-      $secret_key = $configuration['secret_key']??'';
+    if ($mode == 'live') {
+      $secret_key = $configuration['live_secret_key'] ?? '';
+    }
+    else {
+      $secret_key = $configuration['secret_key'] ?? '';
     }
 
     $order = $payment->getOrder();
@@ -50,7 +56,7 @@ class CommerceStripeCheckoutCheckoutForm extends BasePaymentOffsiteForm {
     $order = $commerce_stripe_checkout_data['order'];
     $currency = $commerce_stripe_checkout_data['currency'];
 
-    $line_items_data = array();
+    $line_items_data = [];
 
     if ($order instanceof OrderInterface) {
       // Get the order's line items.
@@ -58,7 +64,7 @@ class CommerceStripeCheckoutCheckoutForm extends BasePaymentOffsiteForm {
 
       // Loop through the line items.
       foreach ($line_items as $line_item) {
-        $line_item_data = array();
+        $line_item_data = [];
         // Perform operations with each line item.
         // For example, you can access the title and quantity.
         $title = $line_item->getTitle();
@@ -68,9 +74,8 @@ class CommerceStripeCheckoutCheckoutForm extends BasePaymentOffsiteForm {
 
         $unit_price_number = $unit_price->getNumber();
 
-        $unit_price_value = $unit_price_number*100;
-        // amount in cents
-
+        $unit_price_value = $unit_price_number * 100;
+        // Amount in cents.
         $line_item_data = [
           'price_data' => [
             'currency' => $currency,
@@ -88,14 +93,14 @@ class CommerceStripeCheckoutCheckoutForm extends BasePaymentOffsiteForm {
 
     try {
       if (class_exists('\Stripe\Stripe')) {
-      // Set your Stripe API keys
-        \Stripe\Stripe::setApiKey($secret_key);
+        // Set your Stripe API keys.
+        Stripe::setApiKey($secret_key);
 
-        $success_redirect_url = Url::fromRoute('commerce_stripe_checkout.payment_success', ['stsess' => $stsess], ['absolute' => true])->toString();
-        $cancel_redirect_url = Url::fromRoute('commerce_stripe_checkout.payment_cancel', ['stsess' => $stsess], ['absolute' => true])->toString();
+        $success_redirect_url = Url::fromRoute('commerce_stripe_checkout.paymentSuccess', ['stsess' => $stsess], ['absolute' => TRUE])->toString();
+        $cancel_redirect_url = Url::fromRoute('commerce_stripe_checkout.paymentCancel', ['stsess' => $stsess], ['absolute' => TRUE])->toString();
 
-      // Create a new checkout session
-        $session = \Stripe\Checkout\Session::create([
+        // Create a new checkout session.
+        $session = Session::create([
           'payment_method_types' => ['card'],
           'line_items' => $line_items_data,
           'mode' => 'payment',
@@ -103,12 +108,11 @@ class CommerceStripeCheckoutCheckoutForm extends BasePaymentOffsiteForm {
           'cancel_url' => $cancel_redirect_url,
         ]);
 
-      // Get the checkout session ID
+        // Get the checkout session ID.
         $redirect_url = $session->url;
 
-      // Get plugin configuration.
-        $plugin_config = $payment_gateway_plugin->getConfiguration();
-
+        // Get plugin configuration.
+        // $plugin_config = $payment_gateway_plugin->getConfiguration();
         $commerce_stripe_checkout_data = $payment_gateway_plugin->setCommerceStripeCheckoutCheckoutData($payment);
         foreach ($commerce_stripe_checkout_data as $name => $value) {
           if (!empty($value)) {
@@ -118,17 +122,20 @@ class CommerceStripeCheckoutCheckoutForm extends BasePaymentOffsiteForm {
 
         $response = new RedirectResponse($redirect_url);
         $response->send();
-      } else {
-        $message = 'Something went wrong. Please contact the site administrator.';
-        \Drupal::messenger()->addError(t($message));
+      }
+      else {
+        $message = $this->('Something went wrong. Please contact the site administrator.');
+        \Drupal::messenger()->addError($message);
 
         $message = 'Stripe is missing on the system. Please install the dependency with following command "composer require stripe/stripe-php ^10.0"';
         log_commerce_stripe_checkout_messages('alert', $message);
       }
-    } catch (\Exception $e) {
+    }
+    catch (\Exception $e) {
       $message = $e->getMessage();
-      \Drupal::messenger()->addError(t($message));
+      \Drupal::messenger()->addError($message);
       log_commerce_stripe_checkout_messages('alert', $message);
     }
   }
+
 }
