Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 2
0
 /**
  * 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');
 }
Esempio n. 3
0
 /**
  * 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');
 }
Esempio n. 4
0
 /**
  * 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;
 }
Esempio n. 5
0
 public function isTestMode(\XLite\Model\Payment\Method $method)
 {
     return $method->getSetting('test') != 'false';
 }
Esempio n. 6
0
 /**
  * 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;
 }
Esempio n. 7
0
 /**
  * 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');
 }
Esempio n. 8
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');
 }
Esempio n. 9
0
 /**
  * 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');
 }
Esempio n. 11
0
 /**
  * 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);
 }
Esempio n. 13
0
 /**
  * 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;
 }
Esempio n. 14
0
 /**
  * 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));
 }
Esempio n. 15
0
 /**
  * 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;
 }