/** * Get payment method configuration page URL * * @param \XLite\Model\Payment\Method $method Payment method * @param boolean $justAdded Flag if the method is just added via administration panel. * Additional init configuration can be provided OPTIONAL * * @return string */ public function getConfigurationURL(\XLite\Model\Payment\Method $method, $justAdded = false) { return \XLite\Core\Converter::buildURL('paypal_settings', '', array('method_id' => $method->getMethodId())); }
/** * Check that existing payment method is in the list of the imported methods. Mark that in the list * * @param \XLite\Model\Payment\Method $paymentMethod Payment method * @param array $list List of the imported payment methods * * @return void */ protected function checkMethodInImportedList(\XLite\Model\Payment\Method $paymentMethod, &$list) { $result = false; foreach ($list as $key => $data) { if ($paymentMethod->getName() == $data['moduleName'] && $paymentMethod->getSetting('id') == $data['id']) { $result = true; $list[$key]['paymentMethodId'] = $paymentMethod->getMethodId(); break; } } return $result; }
/** * Check last payment method * * @param \XLite\Model\Payment\Method $pmethod Payment method * @param integer $lastPaymentId Last selected payment method id * * @return boolean */ public function checkLastPaymentMethod(\XLite\Model\Payment\Method $pmethod, $lastPaymentId) { $result = $pmethod->getMethodId() == $lastPaymentId; if ($result) { $this->setPaymentMethod($pmethod); } return $result; }
/** * Get payment method configuration page URL * * @param \XLite\Model\Payment\Method $method Payment method * @param boolean $justAdded Flag if the method is just added via administration panel. Additional init configuration can be provided * * @return string */ public function getConfigurationURL(\XLite\Model\Payment\Method $method, $justAdded = false) { $url = null; if ($this->getSettingsWidget()) { $url = \XLite\Core\Converter::buildURL('payment_method', '', $justAdded ? array('method_id' => $method->getMethodId(), 'just_added' => 1) : array('method_id' => $method->getMethodId())); } elseif ($this->hasModuleSettings() && $this->getModuleSettingsForm()) { $url = $this->getModuleSettingsForm(); $url .= (false === strpos($url, '?') ? '?' : '&') . 'return=' . urlencode(\XLite\Core\Converter::buildURL('payment_settings', '', $justAdded ? array('just_added' => 1, 'method_id' => $method->getMethodId()) : array())); } return $url; }
/** * Check - transaction's method and specified method is equal or not * * @param \XLite\Model\Payment\Method $method Anothermethod * * @return boolean */ public function isSameMethod(\XLite\Model\Payment\Method $method) { return $this->getPaymentMethod() && $this->getPaymentMethod()->getMethodId() == $method->getMethodId(); }
/** * {@inheritDoc} */ public function getMethodId() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getMethodId', array()); return parent::getMethodId(); }