Payment/EventListener/AbstractPaymentListener.php
protected function generateKey(PaymentInterface $payment)
    {
        if (0 == strlen($payment->getKey())) {
            $this->keyGenerator->generate($payment);

            return true;
        }

        return false;
    }
protected function generateKey(PaymentInterface $payment)
    {
        if (0 == strlen($payment->getKey())) {
            $this->keyGenerator->generate($payment);

            return true;
        }

        return false;
    }
protected function generateKey ( PaymentInterface $ payment ) { if ( 0 == strlen ( $ payment -> getKey ( ) ) ) { $ this -> keyGenerator -> generate ( $ payment ) ; return true ; } return false ; }
Generates the payment key.

@param PaymentInterface $payment

@return bool Whether the payment has been changed or not.
Generates the payment key .