public function requestToken(TokenRequest $request)
    {
        $result = $this->request('POST', '/tokens', [
            'card[number]' => $request->getCardNumber(),
            'card[exp_month]' => $request->getExpirationMonth(),
            'card[exp_year]' => $request->getExpirationYear(),
            'card[cvc]' => $request->getSecurityCode(),
            'card[name]' => $request->getHolderName(),
            'currency' => $request->getCurrency(),
            'email' => $request->getEmail(),
        ]);

        return $this->objectConverter->convert($result);
    }
public function requestToken(TokenRequest $request)
    {
        $result = $this->request('POST', '/tokens', [
            'card[number]' => $request->getCardNumber(),
            'card[exp_month]' => $request->getExpirationMonth(),
            'card[exp_year]' => $request->getExpirationYear(),
            'card[cvc]' => $request->getSecurityCode(),
            'card[name]' => $request->getHolderName(),
            'currency' => $request->getCurrency(),
            'email' => $request->getEmail(),
        ]);

        return $this->objectConverter->convert($result);
    }
public function requestToken ( TokenRequest $ request ) { $ result = $ this -> request ( 'POST' , '/tokens' , [ 'card[number]' => $ request -> getCardNumber ( ) , 'card[exp_month]' => $ request -> getExpirationMonth ( ) , 'card[exp_year]' => $ request -> getExpirationYear ( ) , 'card[cvc]' => $ request -> getSecurityCode ( ) , 'card[name]' => $ request -> getHolderName ( ) , 'currency' => $ request -> getCurrency ( ) , 'email' => $ request -> getEmail ( ) , ] ) ; return $ this -> objectConverter -> convert ( $ result ) ; }
Returns a new token.

@param  TokenRequest $request
@return Token

@throws RequestException
Returns a new token .