public static function addPaymentInfo() { RecruiterController::requireLogin(); global $params; $recruiterId = $_SESSION['_id']; $customerId = RecruiterModel::getCustomerId($recruiterId); if (is_null($customerId)) { // Create new customer id. $email = $_SESSION['email']; $customerId = StripeBilling::createCustomer($email); RecruiterModel::setCustomerId($recruiterId, $customerId); } // Add card info. $tokenObj = $params['token']; $token = $tokenObj['id']; $card = StripeBilling::addCard($customerId, $token); echo toJSON($card); }