コード例 #1
0
ファイル: app.php プロジェクト: RustyIngles/sp4k_php
 public function update()
 {
     if ($this->item) {
         $this->item->update();
     } elseif ($this->collection) {
         $this->collection->update();
     } else {
         $this->_error = "Unable to update; no data loaded.";
     }
 }
コード例 #2
0
ファイル: item.php プロジェクト: RustyIngles/sp4k_php
 public function update()
 {
     parent::update();
     $classname = 'Sp4kAppsSubscriptionPaymentMethods' . ucfirst($this->getState()->get('billing'));
     if (class_exists($classname)) {
         /** @var Sp4kAppsSubscriptionPaymentMethodsBank $paymentProcessor */
         $paymentProcessor = new $classname(new Registry(['agreement' => ['account_config' => $this->getState()->get('billing'), 'user' => $this->getState()->get('juser'), 'paymentMonthInYear' => (int) strftime('%m', $this->getState()->get('billing_start')), 'paymentDayInMonth' => $this->getState()->get('paydate'), 'start' => strftime('%d/%m/%Y', $this->getState()->get('billing_start'))], 'paymentinfo' => $this->getState()->get('payinfo')]));
         //set up an account for this user if one does not already exist with the payment provider.
         $paymentProcessor->initializeAgreement();
         if ($payment_error = $paymentProcessor->getError()) {
             $this->_error = $payment_error;
         } else {
             $this->state = 1;
             $this->status = 1;
             //failed/complete/unresolved/abandoned/cancelled/rejected
             $this->pm_ref_agreement_id = $paymentProcessor->agreement_id;
             $this->bind();
             parent::update();
         }
     }
     return;
 }