src/Payum/Stripe/Action/Api/CreateTokenForCreditCardAction.php
public function execute($request)
    {
        /** @var $request CreateTokenForCreditCard */
        RequestNotSupportedException::assertSupports($this, $request);

        /** @var CreditCardInterface $card */
        $card = $request->getModel();

        $token = ArrayObject::ensureArrayObject($request->getToken());
        $token['object'] = 'card';
        $token['number'] = SensitiveValue::ensureSensitive($card->getNumber());
        $token['exp_month'] = SensitiveValue::ensureSensitive($card->getExpireAt()->format('m'));
        $token['exp_year'] = SensitiveValue::ensureSensitive($card->getExpireAt()->format('Y'));

        if ($card->getSecurityCode()) {
            $token['cvc'] = SensitiveValue::ensureSensitive($card->getSecurityCode());
        }

        $this->gateway->execute(new CreateToken($token));
        
        $request->setToken($token->toUnsafeArray());
    }
public function execute($request)
    {
        /** @var $request CreateTokenForCreditCard */
        RequestNotSupportedException::assertSupports($this, $request);

        /** @var CreditCardInterface $card */
        $card = $request->getModel();

        $token = ArrayObject::ensureArrayObject($request->getToken());
        $token['object'] = 'card';
        $token['number'] = SensitiveValue::ensureSensitive($card->getNumber());
        $token['exp_month'] = SensitiveValue::ensureSensitive($card->getExpireAt()->format('m'));
        $token['exp_year'] = SensitiveValue::ensureSensitive($card->getExpireAt()->format('Y'));

        if ($card->getSecurityCode()) {
            $token['cvc'] = SensitiveValue::ensureSensitive($card->getSecurityCode());
        }

        $this->gateway->execute(new CreateToken($token));
        
        $request->setToken($token->toUnsafeArray());
    }
{@inheritDoc}