コード例 #1
0
ファイル: Method.php プロジェクト: kingsj/core
 /**
  * Additional check for PPS 
  * 
  * @return boolean
  */
 public function isEnabled()
 {
     $result = parent::isEnabled();
     if ($result && \XLite\Module\CDev\Paypal\Main::PP_METHOD_PPS == $this->getServiceName()) {
         $result = !$this->getProcessor()->isExpressCheckoutEnabled();
     }
     return $result;
 }
コード例 #2
0
ファイル: AXPayments.php プロジェクト: kewaunited/xcart
 /**
  * Get payment method admin zone icon URL
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return string | boolean
  */
 public function getAdminIconURL(\XLite\Model\Payment\Method $method)
 {
     if (false !== strpos($method->getServiceName(), 'XPayments.Allowed')) {
         $name = $method->getServiceName();
     } else {
         $name = str_replace('XPayments', 'XPayments.Allowed', $method->getServiceName());
     }
     $file = 'modules/CDev/XPaymentsConnector/icons/' . $name . '.png';
     $filePath = LC_DIR_SKINS . 'admin' . LC_DS . 'en' . LC_DS . str_replace('/', LC_DS, $file);
     return \Includes\Utils\FileManager::isExists($filePath) ? \XLite\Core\Layout::getInstance()->getResourceWebPath($file) : true;
 }
コード例 #3
0
ファイル: Moneybookers.php プロジェクト: kingsj/core
 /**
  * Get payemnt method icon path
  *
  * @param \XLite\Model\Order          $order  Order
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return string
  */
 public function getIconPath(\XLite\Model\Order $order, \XLite\Model\Payment\Method $method)
 {
     $type = $this->convertServiceNameToType($method->getServiceName());
     $icon = isset($this->paymentTypeIcons[$type]) ? $this->paymentTypeIcons[$type] : null;
     if (is_array($icon)) {
         $code3 = $order->getProfile() && $order->getProfile()->getBillingAddress() ? $order->getProfile()->getBillingAddress()->getCountry()->getCode3() : null;
         $icon = $code3 && isset($icon[$code3]) ? $icon[$code3] : null;
     }
     return $icon ? 'modules/CDev/Moneybookers/icons/' . $icon : parent::getIconPath($order, $method);
 }
コード例 #4
0
ファイル: PaypalWPS.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Return TRUE if the test mode is ON
  *
  * @param \XLite\Model\Payment\Method $method Payment method object
  *
  * @return boolean
  */
 public function isTestMode(\XLite\Model\Payment\Method $method)
 {
     return \XLite\View\FormField\Select\TestLiveMode::TEST === $method->getSetting('mode');
 }
コード例 #5
0
ファイル: Order.php プロジェクト: kingsj/core
 /**
  * Return true if current payment method is PayPal
  * 
  * @param \XLite\Model\Payment\Method $method Payment method object
  *  
  * @return boolean
  */
 protected function isPaypalMethod($method)
 {
     return isset($method) && in_array($method->getServiceName(), array(\XLite\Module\CDev\Paypal\Main::PP_METHOD_PPA, \XLite\Module\CDev\Paypal\Main::PP_METHOD_PFL, \XLite\Module\CDev\Paypal\Main::PP_METHOD_EC, \XLite\Module\CDev\Paypal\Main::PP_METHOD_PPS));
 }
コード例 #6
0
 public function isTestMode(\XLite\Model\Payment\Method $method)
 {
     return $method->getSetting('test') != 'false';
 }
コード例 #7
0
ファイル: XPaymentsClient.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Currency adjusted to payment method (or to all methods in old versions)
  *
  * @param \XLite\Model\Payment\Method   $paymentMethod  Payment method
  *
  * @return \XLite\Model\Currency 
  */
 public function getCurrencyForPaymentMethod(\XLite\Model\Payment\Method $paymentMethod)
 {
     $currencyId = version_compare(\XLite\Core\Config::getInstance()->CDev->XPaymentsConnector->xpc_api_version, '1.3') >= 0 ? $paymentMethod->getSetting('currency') : \XLite\Core\Config::getInstance()->CDev->XPaymentsConnector->xpc_currency;
     $currency = \XLite\Core\Database::getRepo('XLite\\Model\\Currency')->find($currencyId);
     return $currency;
 }
コード例 #8
0
ファイル: PaypalAdaptive.php プロジェクト: kirkbauer2/kirkxc
 /**
  * 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()));
 }
コード例 #9
0
ファイル: Methods.php プロジェクト: kingsj/core
 /**
  * Get module name
  *
  * @param \XLite\Model\Payment\Method $method Method
  *
  * @return string
  */
 protected function getModuleName(\XLite\Model\Payment\Method $method)
 {
     return $method->getProcessor()->getModule() ? $method->getProcessor()->getModule()->getModuleName() : null;
 }
コード例 #10
0
ファイル: Transaction.php プロジェクト: kirkbauer2/kirkxc
 /**
  * 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();
 }
コード例 #11
0
 /**
  * {@inheritDoc}
  */
 public function prepareEntityBeforeCommit($type)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'prepareEntityBeforeCommit', array($type));
     return parent::prepareEntityBeforeCommit($type);
 }
コード例 #12
0
ファイル: AAPI.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Return payment method processor
  *
  * @return \XLite\Model\Payment\Base\Processor
  */
 protected function getProcessor()
 {
     return $this->method ? $this->method->getProcessor() : null;
 }
コード例 #13
0
ファイル: Method.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Is forced Merchant API for Paypal Express
  * https://developer.paypal.com/docs/classic/api/#merchant
  *
  * @param \XLite\Model\Payment\Base\Processor $processor Payment processor
  *
  * @return boolean
  */
 protected function isForceMerchantAPI($processor)
 {
     $parentMethod = $processor->getParentMethod();
     return !$processor->isForcedEnabled($this) && ('email' == parent::getSetting('api_type') || 'paypal' == parent::getSetting('api_solution') || $parentMethod && !$processor->isConfigured($parentMethod));
 }
コード例 #14
0
 /**
  * Check - payment method is configured or not
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return boolean
  */
 public function isAllSettingsProvided(\XLite\Model\Payment\Method $method)
 {
     return $method->getSetting('merchant_id') && $method->getSetting('pub_cert') && $method->getSetting('pub_key') && $method->getSetting('private_key') && $method->getSetting('private_key_pass') && $method->getSetting('currency');
 }
コード例 #15
0
ファイル: AAdmin.php プロジェクト: kingsj/core
 /**
  * Check - display separate Configure button or not
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return boolean
  */
 protected function isSeparateConfigureButtonVisible(\XLite\Model\Payment\Method $method)
 {
     return ($method->getWarningNote() || $method->isTestMode()) && $method->isConfigurable() && !$method->isForcedEnabled();
 }
コード例 #16
0
ファイル: Velocity.php プロジェクト: ashishCetuG/xcart-plugin
 /**
  * Check - payment method is configured or not
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return boolean
  */
 public function isConfigured(\XLite\Model\Payment\Method $method)
 {
     return 'live' == $method->getSetting('mode') && $method->getSetting('identitytoken') && $method->getSetting('workflowid') && $method->getSetting('applicationprofileid') && $method->getSetting('merchantprofileid') || 'test' == $method->getSetting('mode') && $method->getSetting('identitytoken') && $method->getSetting('workflowid') && $method->getSetting('applicationprofileid') && $method->getSetting('merchantprofileid');
 }
コード例 #17
0
 public function isConfigured(\XLite\Model\Payment\Method $method)
 {
     return $method->getSetting('secretKey') && $method->getSetting('publicKey');
 }
コード例 #18
0
ファイル: OrderAbstract.php プロジェクト: kewaunited/xcart
 /**
  * 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;
 }
コード例 #19
0
 /**
  * Returns URL to payment module
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return string
  */
 public function getPaymentModuleURL(\XLite\Model\Payment\Method $method)
 {
     $result = '';
     list($moduleAuthor, $moduleName) = explode('_', $method->getModuleName());
     if ($method->isModuleInstalled()) {
         // Payment module is installed
         $pageId = \XLite\Core\Database::getRepo('XLite\\Model\\Module')->getInstalledPageId($moduleAuthor, $moduleName, \XLite\View\Pager\Admin\Module\Manage::getInstance()->getItemsPerPage());
         $params = array('clearCnd' => 1, \XLite\View\Pager\APager::PARAM_PAGE_ID => $pageId);
         $result = \XLite\Core\Converter::buildURL('addons_list_installed', '', $params) . '#' . $moduleName;
     } else {
         // Payment module is not installed
         $widget = new \XLite\View\Pager\Admin\Module\Install();
         list(, $limit) = $widget->getLimitCondition()->limit;
         $pageId = \XLite\Core\Database::getRepo('XLite\\Model\\Module')->getMarketplacePageId($moduleAuthor, $moduleName, $limit);
         $params = array('clearCnd' => 1, 'clearSearch' => 1, \XLite\View\Pager\APager::PARAM_PAGE_ID => $pageId, \XLite\View\ItemsList\AItemsList::PARAM_SORT_BY => \XLite\View\ItemsList\Module\AModule::SORT_OPT_ALPHA);
         $result = $this->buildURL('addons_list_marketplace', '', $params) . '#' . $moduleName;
     }
     return $result;
 }
コード例 #20
0
ファイル: APaypal.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Get initial transaction type (used when customer places order)
  *
  * @param \XLite\Model\Payment\Method $method Payment method object OPTIONAL
  *
  * @return string
  */
 public function getInitialTransactionType($method = null)
 {
     return 'A' == ($method ? $method->getSetting('transaction_type') : $this->getSetting('transaction_type')) ? \XLite\Model\Payment\BackendTransaction::TRAN_TYPE_AUTH : \XLite\Model\Payment\BackendTransaction::TRAN_TYPE_SALE;
 }
コード例 #21
0
ファイル: AuthorizeNetSIM.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Check - payment method has enabled test mode or not
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return boolean
  */
 public function isTestMode(\XLite\Model\Payment\Method $method)
 {
     return (bool) $method->getSetting('test');
 }
コード例 #22
0
ファイル: Settings.php プロジェクト: kewaunited/xcart
 /**
  * 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;
 }
コード例 #23
0
ファイル: AAdminAbstract.php プロジェクト: kewaunited/xcart
 /**
  * Returns 'after' list name (with payment method service name)
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return string
  */
 protected function getAfterListName(\XLite\Model\Payment\Method $method)
 {
     $serviceName = $method->getServiceName();
     return 'after.' . preg_replace('/[^\\w]/', '_', $serviceName);
 }
コード例 #24
0
ファイル: XPayments.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Check - payment method has enabled test mode or not
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return boolean
  */
 public function isTestMode(\XLite\Model\Payment\Method $method)
 {
     return 'Y' == $method->getSetting('isTestMode');
 }
コード例 #25
0
ファイル: Stripe.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Get initial transaction type (used when customer places order)
  *
  * @param \XLite\Model\Payment\Method $method Payment method object OPTIONAL
  *
  * @return string
  */
 public function getInitialTransactionType($method = null)
 {
     $type = $method ? $method->getSetting('type') : $this->getSetting('type');
     return 'sale' == $type ? \XLite\Model\Payment\BackendTransaction::TRAN_TYPE_AUTH : \XLite\Model\Payment\BackendTransaction::TRAN_TYPE_SALE;
 }