code: protected function generateKey(PaymentInterface $payment)
      {
          if (0 == strlen($payment->getKey())) {
              $this->keyGenerator->generate($payment);
  
              return true;
          }
  
          return false;
      }
docs: Generates the payment key.
  
  @param PaymentInterface $payment
  
  @return bool Whether the payment has been changed or not.