/** * Get payment method setting by its name * * @param string $name Setting name * * @return string */ public function getSetting($name) { if (\XLite\Module\CDev\Paypal\Main::PP_METHOD_EC == $this->getServiceName() && $this->isForcedEnabled()) { $parentMethod = $this->getProcessor()->getParentMethod(); $result = $parentMethod->getSetting($name); } else { $result = parent::getSetting($name); } return $result; }
/** * 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'); }
/** * 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'); }
/** * 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; }
public function isTestMode(\XLite\Model\Payment\Method $method) { return $method->getSetting('test') != 'false'; }
/** * 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; }
/** * 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'); }
/** * 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'); }
/** * 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'); }
public function isConfigured(\XLite\Model\Payment\Method $method) { return $method->getSetting('secretKey') && $method->getSetting('publicKey'); }
/** * 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; }
/** * {@inheritDoc} */ public function getSetting($name) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getSetting', array($name)); return parent::getSetting($name); }
/** * Returns Paypal API (Merchant API) setting value stored in Express Checkout payment method * * @param string $name Setting name * * @return string */ protected function getSetting($name) { return $this->method ? $this->method->getSetting($name) : null; }
/** * 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)); }
/** * 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; }