public static function getCards() { RecruiterController::requireLogin(); $recruiterId = $_SESSION['_id']; $cards = StripeBilling::getCardsByRecruiter($recruiterId); echo toJSON($cards); }
public static function applicantsTabCredits() { RecruiterController::requireLogin(); $jobId = new MongoId($_POST['jobId']); // Make sure job exists. // Make sure recruiter owns the job. if (!self::checkJobExists($jobId)) { return; } if (!self::ownsJob($jobId)) { return; } $countsHash = self::getCountsHash($jobId); $cards = StripeBilling::getCardsByRecruiter($_SESSION['_id']); $data = array_merge(['cards' => $cards], $countsHash); echo toJSON($data); }