/**
* Save a credit card with paypal
*
* This helps you avoid the hassle of securely storing credit
* card information on your site. PayPal provides a credit card
* id that you can use for charging future payments.
*
* @param array $params credit card parameters
*/
function saveCard($params)
{
$card = new CreditCard();
$card->setType($params['type']);
$card->setNumber($params['number']);
$card->setExpireMonth($params['expire_month']);
$card->setExpireYear($params['expire_year']);
$card->setCvv2($params['cvv2']);
$card->create(getApiContext());
return $card->getId();
}