/** * sync_plans * * This method provides the ability to grab and insert all of the plans from recurly data * and insert it into the grind database * * ** WARNING ** * This function is only meant to be as a cron job to ensure our DB matches recurly plans * Remember that the daily plan is managed through the DB specifically * * @joshcampbell * */ public function sync_plans() { $this->load->helper('date'); $plans = Recurly_PlanList::get(); $results = array(); $i = 0; foreach ($plans as $plan => $plandata) { unset($plandata->currencies); // work around for recurly curriences issue $this->load->model("billing/planmodel", "", true); $plan_code = $plandata->plan_code; $this->planmodel->local_init($plan_code, $plandata); $result = $this->planmodel->create(); $results[] = array("name" => $plandata->plan_code, "response" => $result); $i = $i++; } $data["results"] = $results; $this->load->view('billing/plan_sync_results', $data); }
<input type="text" id="primary_email" class="required email" name="primary_email" value="" /> </li> <li> <label for="primary_phone">Phone</label> <input type="text" id="primary_phone" name="primary_phone" value="" /> </li> <li> <label for="company_description">Company Description</label> <textarea id="company_description" name="company_description"></textarea> </li> <li> <label for="membership_plan_code">Membership Type</label> <select id="membership_plan_code" name="membership_plan_code" title="Membership Type"> <option value="daily">Daily</option> <?php $plans = Recurly_PlanList::get(); foreach ($plans as $plan) { if (isset($accesspricing) && $accesspricing->allow_monthly_memberships < 1) { ?> <?php if ($plan->plan_code != 'monthly') { ?> <option value="<?php echo $plan->plan_code; ?> "><?php echo $plan->name; ?> </option> <?php }
public static function get($params = null, $client = null) { $list = new Recurly_PlanList(Recurly_Client::PATH_PLANS, $client); $list->_loadFrom(Recurly_Client::PATH_PLANS, $params); return $list; }