Ejemplo n.º 1
0
 /**
  * Reads payment plans from database.
  *
  * @return array of payment plans [ plan_id, name, price, description ]
  */
 public function execute()
 {
     $response = array();
     $result = Api_Dao_Payments::getPlansByAid($this->aid);
     if (count($result) == 0) {
         $response['result'] = '';
     } else {
         $plans = array();
         foreach ($result as $key => $row) {
             $plan = array();
             $plan['plan_id'] = $row['id'];
             $plan['aid'] = $row['aid'];
             $plan['network_id'] = $row['network_id'];
             $plan['name'] = $row['name'];
             $plan['length'] = $row['length'];
             $plan['unit'] = $row['unit'];
             $plan['price'] = $row['price'];
             $plan['description'] = $row['description'];
             $plan['num_friends'] = $row['num_friends'];
             $plans[] = $plan;
         }
         $response['plans'] = $plans;
     }
     //    	error_log( 'SubscriptionsGetAppPlans response: ' . print_r( $response, true ) );
     return $response;
 }
Ejemplo n.º 2
0
 public static function getSubscriptionsByUidNid($uid, $nid)
 {
     return Api_Dao_Payments::getSubscriptionsByUidNid($uid, $nid);
 }
Ejemplo n.º 3
0
 private static function calculateAmount($planid)
 {
     $plan = Api_Dao_Payments::getPlanByPlanid($planid);
     $price = $plan[0]['price'];
     return $price;
 }