示例#1
0
 private function createSubscription()
 {
     foreach ($this->order->items as $item) {
         if ($item->booking->type == 'subscription') {
             $subscriptionData = new Registry(['product_id' => $item->product_id, 'event_id' => $item->event_id, 'start_date' => $item->start_date]);
             $this->subscriptions[] = Sp4kAppsSubscriptionApp::getInstance($subscriptionData)->getItem()->update();
         }
     }
 }
示例#2
0
 protected function execute()
 {
     if ($this->state->get('paging', false)) {
         $limit = $this->state->get('limit');
         $filters = $this->state->get('filters');
         $count = $this->state->get('count', false);
         $appState = new Joomla\Registry\Registry(['limit' => $limit, 'count' => $count, 'filters' => $filters]);
         /** @var Sp4kAppsSubscriptionApp $registrationApp */
         $app = Sp4kAppsSubscriptionApp::getInstance($appState);
         $appCollection = $app->getCollection();
         $this->count = $appCollection->count;
         $this->items = $appCollection->items;
         foreach ($this->items as $item) {
             $item->child = Sp4kAppsChildApp::getInstance(new Registry(['id' => $item->child_id]))->getItem();
             $item->product = Sp4kAppsProductApp::getInstance(new Registry(['id' => $item->product_id, 'plugins' => false]))->getItem();
         }
     } else {
         $this->items = Sp4kAppsSubscriptionApp::getInstance(new Joomla\Registry\Registry($this->state->toObject()))->getItems();
     }
 }
示例#3
0
 public function execute()
 {
     $app = new Sp4kAppsAccountApp(new Registry($this->state->toObject()));
     $this->item = $app->getItem();
     $this->id = $this->item->id;
     $this->created = $this->item->created;
     $accountFilter = ['filters' => ['account_id' => $this->id]];
     if ($this->item->id != null) {
         $this->item->parents = Sp4kAppsParentApp::getInstance(new Registry($accountFilter))->getItems();
         foreach ($this->item->parents as &$parent) {
             $juser = JFactory::getuser($parent->juser_id);
             $parent->name = $juser->name;
             $parent->email = $juser->email;
         }
         $this->item->children = Sp4kAppsChildApp::getInstance(new Registry($accountFilter))->getItems();
         foreach ($this->item->children as $child) {
             $this->item->registrations = $this->item->registrations + Sp4kAppsRegistrationApp::getInstance(new Registry(['filters' => ['child_id' => $child->id]]))->getItems();
         }
         $this->item->subscriptions = Sp4kAppsSubscriptionApp::getInstance(new Registry($accountFilter))->getItems();
         $this->item->orders = Sp4kAppsOrderApp::getInstance(new Registry($accountFilter))->getItems();
     }
 }
示例#4
0
 private function processSubscriptions()
 {
     foreach ($this->cart['items'] as $item) {
         if ($item->product->config->payment->recurring->enabled) {
             $subscriptionData = new Registry(['order_id' => $this->order->id, 'product_id' => $item->product_id, 'start_date' => $item->plugins->booking->date_start, 'end_date' => $item->plugins->booking->date_end, 'billing' => $item->plugins->payment->processor = 'bank', 'billing_start' => strtotime($item->plugins->pricing->next_paydate), 'paydate' => $item->plugins->pricing->paydate, 'payinfo' => $this->state->get('pl')]);
             $this->subscriptions[] = Sp4kAppsSubscriptionApp::getInstance($subscriptionData)->getItem()->update();
         }
     }
 }
示例#5
0
 public function execute()
 {
     $this->item = Sp4kAppsSubscriptionApp::getInsance(new Joomla\Registry\Registry($this->state->toObject()))->getItem();
 }