Ejemplo n.º 1
0
 public static function getCardsByRecruiter(MongoId $recruiterId)
 {
     // Get cards.
     $customerId = RecruiterModel::getCustomerId($recruiterId);
     if (is_null($customerId)) {
         $cards = [];
     } else {
         $cards = StripeBilling::getCards($customerId);
     }
     return $cards;
 }
 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);
 }