本文整理汇总了PHP中Mage_Payment_Model_Method_Abstract类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Payment_Model_Method_Abstract类的具体用法?PHP Mage_Payment_Model_Method_Abstract怎么用?PHP Mage_Payment_Model_Method_Abstract使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Payment_Model_Method_Abstract类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _getMethodConfigData
/**
* Return system config value by key for specified payment method
*
* @param string $key
* @param Mage_Payment_Model_Method_Abstract $method
* @param int $storeId
*
* @return string
*/
protected function _getMethodConfigData($key, Mage_Payment_Model_Method_Abstract $method, $storeId = null)
{
if (!$method->getCode()) {
return null;
}
return Mage::getStoreConfig("payment/{$method->getCode()}/{$key}", $storeId);
}
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:16,代码来源:Observer.php
示例2: getPaymentMethodInstance
/**
* Retreive payment method instance
*
* @return Mage_Payment_Model_Method_Abstract
*/
public function getPaymentMethodInstance()
{
if (is_null($this->_paymentMethodInstance)) {
$this->_paymentMethodInstance = Mage::helper('payment')->getMethodInstance($this->getMethodCode());
}
$this->_paymentMethodInstance->setStore($this->getStoreId());
return $this->_paymentMethodInstance;
}
开发者ID:jpbender,项目名称:mage_virtual,代码行数:13,代码来源:AgreementAbstract.php
示例3: getPaymentMethodInstance
/**
* Retreive payment method instance
*
* @return Mage_Payment_Model_Method_Abstract
*/
public function getPaymentMethodInstance()
{
if (is_null($this->_paymentMethodInstance)) {
$this->_paymentMethodInstance = Mage::helper('Mage_Payment_Helper_Data')->getMethodInstance($this->getMethodCode());
}
if ($this->_paymentMethodInstance) {
$this->_paymentMethodInstance->setStore($this->getStoreId());
}
return $this->_paymentMethodInstance;
}
开发者ID:natxetee,项目名称:magento2,代码行数:15,代码来源:AgreementAbstract.php
示例4: isAvailable
/**
* Check whether payment method can be used
*
* @param Mage_Sales_Model_Quote $quote
* @return bool
*/
public function isAvailable($quote = null)
{
if (!(Mage_Payment_Model_Method_Abstract::isAvailable($quote) && $this->_pro->getConfig()->isMethodAvailable())) {
return false;
}
return $this->_commonMethod->isAvailable($quote);
}
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:13,代码来源:Direct.php
示例5: getConfigPaymentAction
/**
* Get config peyment action
*
* @return string
*/
public function getConfigPaymentAction()
{
if ('pending' == $this->getConfigData('order_status')) {
return Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE;
}
return parent::getConfigPaymentAction();
}
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:12,代码来源:Free.php
示例6: getMethodInstance
/**
* Return payment method instance
*
* @return Mage_Payment_Model_Method_Abstract
*/
protected function getMethodInstance()
{
if (!$this->_methodInstance) {
$this->setMethodInstance(Mage::helper('payment')->getMethodInstance($this->getMethodCode()));
}
$this->_methodInstance->setStore($this->getStoreId());
return $this->_methodInstance;
}
开发者ID:blazeriaz,项目名称:youguess,代码行数:13,代码来源:Profile.php
示例7: isAvailable
/**
* Check whether payment method can be used
*
* @param Mage_Sales_Model_Quote $quote
* @return bool
*/
public function isAvailable($quote = null)
{
$storeId = Mage::app()->getStore($this->getStore())->getId();
$config = Mage::getModel('paypal/config')->setStoreId($storeId);
if (!(Mage_Payment_Model_Method_Abstract::isAvailable($quote) && $config->isMethodAvailable($this->getCode()))) {
return false;
}
return $this->_commonMethod->isAvailable($quote);
}
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:15,代码来源:Payflow.php
示例8: validate
/**
* Validate data before save
*
* @return Mage_Payment_Model_Billing_Agreement
*/
public function validate()
{
if (is_null($this->_paymentMethodInstance) || !$this->_paymentMethodInstance->getCode() || !$this->getCustomerId() || !$this->getReferenceId() || !$this->getStatus()) {
throw new Mage_Core_Exception('Not enough data to save billing agreement instance.');
}
return $this;
}
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:12,代码来源:Agreement.php
示例9: isAvailable
public function isAvailable($quote = null)
{
if (!Mage::helper('magenotification')->checkLicenseKey('Giftvoucher')) {
return false;
}
return parent::isAvailable($quote);
}
开发者ID:CherylMuniz,项目名称:fashion,代码行数:7,代码来源:Giftvoucher.php
示例10: isAvailable
public function isAvailable($quote = null)
{
$showBase = parent::isAvailable($quote);
$configuredMethod = Mage::getStoreConfig('payment/payonpickup/shippingmethod_method');
return $showBase && $quote && $configuredMethod && $quote->getShippingAddress() && $quote->getShippingAddress()->getShippingMethod() && $quote->getShippingAddress()->getShippingMethod() == $configuredMethod;
// Check if the specified method is available
}
开发者ID:RapidCommerceBV,项目名称:MagentoStorePickup,代码行数:7,代码来源:Payonpickup.php
示例11: assignData
public function assignData($data)
{
$logger = Mage::helper('worldpay/logger');
parent::assignData($data);
$session = Mage::getSingleton('core/session');
$session->setData('payment_token', $data->token);
$session->setData('saved_card', false);
$persistent = Mage::getStoreConfig('payment/worldpay_cc/card_on_file', Mage::app()->getStore()->getStoreId());
// If token is persistent save in db
if ($persistent && (Mage::getSingleton('customer/session')->isLoggedIn() || Mage::app()->getStore()->isAdmin())) {
if (Mage::app()->getStore()->isAdmin()) {
$customerData = Mage::getSingleton('adminhtml/session_quote')->getCustomer();
} else {
$customerData = Mage::getSingleton('customer/session')->getCustomer();
}
if ($data->token) {
if ($data->savecard) {
$token_exists = Mage::getModel('worldpay/payment')->getCollection()->addFieldToFilter('customer_id', $customerData->getId())->addFieldToFilter('token', $data->token)->getFirstItem();
if (empty($token_exists['token'])) {
$data = array('token' => $data->token, 'customer_id' => $customerData->getId());
$collection = Mage::getModel('worldpay/payment')->setData($data)->save();
}
}
} else {
if ($data->savedcard) {
// Customer has chosen a saved card
$session->setData('payment_token', $data->savedcard);
$session->setData('saved_card', true);
}
}
}
return $this;
}
开发者ID:jozefjgm,项目名称:worldpay-magento,代码行数:33,代码来源:Abstract.php
示例12: __construct
public function __construct()
{
if ($this->isWeixinBrowser()) {
$this->_canUseCheckout = false;
}
parent::__construct();
}
开发者ID:guohuadeng,项目名称:stampApp,代码行数:7,代码来源:Payment.php
示例13: __construct
public function __construct()
{
parent::__construct();
if ($this->pm_id) {
$this->_code = $this->_code . '_' . str_replace('_', '', $this->pm_id);
}
}
开发者ID:payssion,项目名称:plugin_magento,代码行数:7,代码来源:Payssion.php
示例14: validate
public function validate()
{
$errorMsg = '';
parent::validate();
$info = $this->getInfoInstance();
if (!$info->getBankDate()) {
$errorCode = 'invalid_data';
$errorMsg = $this->_getHelper()->__("Date is a required field.\n");
}
if (!$info->getUserName()) {
$errorCode = 'invalid_data';
$errorMsg .= $this->_getHelper()->__('Name is a required field.');
}
if (!$info->getBankName()) {
$errorCode = 'invalid_data';
$errorMsg .= $this->_getHelper()->__('Bank Name is a required field.');
}
if (!$info->getDepositNumber()) {
$errorCode = 'invalid_data';
$errorMsg .= $this->_getHelper()->__('Deposit Number is a required field.');
}
if ($errorMsg) {
Mage::throwException($errorMsg);
}
return $this;
}
开发者ID:sajalsoni,项目名称:Btransfer,代码行数:26,代码来源:Paymentmethod.php
示例15: isAvailable
public function isAvailable($quote = null)
{
$result = $this->isBillMemberAvailable();
if ($result === true) {
return parent::isAvailable();
}
return false;
}
开发者ID:ankita-parashar,项目名称:magento,代码行数:8,代码来源:ICC_BillMember_Model_BillMember.php
示例16: isAvailable
public function isAvailable($quote = null)
{
$adminhtml = Mage::getModel('pulsestorm_crossareasession/manager')->getSessionData('adminhtml');
$adminUser = $adminhtml['admin']['user'];
$adminLoggedIn = isset($adminUser) && $adminUser->getId() && $adminUser->getIsActive();
$isUserLoged = Mage::getSingleton('customer/session')->isLoggedIn();
return parent::isAvailable($quote) && $isUserLoged && !$adminLoggedIn;
}
开发者ID:jpcodezur,项目名称:famrashop_geocom,代码行数:8,代码来源:PointsExchangePayment.php
示例17: canUseForCountry
public function canUseForCountry($country)
{
$ebayPaymentData = Mage::registry('ebayPaymentData');
if (is_null($ebayPaymentData)) {
return false;
}
return parent::canUseForCountry($country);
}
开发者ID:par-orillonsoft,项目名称:app,代码行数:8,代码来源:PaymentMethod.php
示例18: validate
/**
* Valida dados
*
* @param Mage_Payment_Model_Info $info
* @return Mage_Payment_Model_Abstract
*/
public function validate()
{
/*
* chama validacao do metodo abstrato
*/
parent::validate();
if ($this->getConfigData('buypage', $this->getStoreId()) != "loja") {
return $this;
}
$info = $this->getInfoInstance();
$errorMsg = false;
$availableTypes = Mage::getModel('Maxima_Cielo/dc_types')->getCodes();
$ccNumber = Mage::helper('core')->decrypt($info->getCcNumber());
// remove delimitadores do cartao, como "-" e espaco
$ccNumber = preg_replace('/[\\-\\s]+/', '', $ccNumber);
$info->setCcNumber(Mage::helper('core')->encrypt($ccNumber));
$ccType = '';
// valida o numero do cartao de credito
if (in_array($info->getCcType(), $availableTypes)) {
if ($this->validateCcNum($ccNumber)) {
$ccType = 'OT';
$ccTypeRegExpList = array('SO' => '/(^(6334)[5-9](\\d{11}$|\\d{13,14}$))|(^(6767)(\\d{12}$|\\d{14,15}$))/', 'SM' => '/(^(5[0678])\\d{11,18}$)|(^(6[^05])\\d{11,18}$)|(^(601)[^1]\\d{9,16}$)|(^(6011)\\d{9,11}$)' . '|(^(6011)\\d{13,16}$)|(^(65)\\d{11,13}$)|(^(65)\\d{15,18}$)' . '|(^(49030)[2-9](\\d{10}$|\\d{12,13}$))|(^(49033)[5-9](\\d{10}$|\\d{12,13}$))' . '|(^(49110)[1-2](\\d{10}$|\\d{12,13}$))|(^(49117)[4-9](\\d{10}$|\\d{12,13}$))' . '|(^(49118)[0-2](\\d{10}$|\\d{12,13}$))|(^(4936)(\\d{12}$|\\d{14,15}$))/', 'visa' => '/^4[0-9]{12}([0-9]{3})?$/', 'mastercard' => '/^5[1-5][0-9]{14}$/', 'amex' => '/^3[47][0-9]{13}$/', 'discover' => '/^6011[0-9]{12}$/', 'JCB' => '/^(3[0-9]{15}|(2131|1800)[0-9]{11})$/', 'diners' => '/^3[0,6,8]\\d{12}$/');
foreach ($ccTypeRegExpList as $ccTypeMatch => $ccTypeRegExp) {
if (preg_match($ccTypeRegExp, $ccNumber)) {
$ccType = $ccTypeMatch;
break;
}
}
if ($info->getCcType() != 'elo' && $ccType != $info->getCcType()) {
$errorMsg = Mage::helper('Maxima_Cielo')->__('Credit card number mismatch with credit card type.');
}
} else {
$errorMsg = Mage::helper('Maxima_Cielo')->__('Invalid Credit Card Number');
}
} else {
$errorMsg = Mage::helper('Maxima_Cielo')->__('Credit card type is not allowed for this payment method.');
}
// valida o numero de verificacao
if ($errorMsg === false) {
$verificationRegEx = $this->getVerificationRegEx();
$regExp = isset($verificationRegEx[$info->getCcType()]) ? $verificationRegEx[$info->getCcType()] : '';
if ($regExp != '' && (!$info->getCcCid() || !preg_match($regExp, Mage::helper('core')->decrypt($info->getCcCid())))) {
$errorMsg = Mage::helper('Maxima_Cielo')->__('Please enter a valid credit card verification number.');
}
}
if (!$this->_validateExpDate($info->getCcExpYear(), $info->getCcExpMonth())) {
$errorMsg = Mage::helper('Maxima_Cielo')->__('Incorrect credit card expiration date.');
}
if ($errorMsg) {
Mage::throwException($errorMsg);
}
//This must be after all validation conditions
//if ($this->getIsCentinelValidationEnabled())
//{
// $this->getCentinelValidator()->validate($this->getCentinelValidationData());
//}
return $this;
}
开发者ID:danielwalterrodrigues,项目名称:asus,代码行数:64,代码来源:Dc.php
示例19: validate
public function validate()
{
parent::validate();
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
if (!in_array($currency_code, $this->_allowCurrencyCode)) {
Mage::throwException(Mage::helper('transparente')->__('Selected currency code (' . $currency_code . ') is not compatabile with Transparente'));
}
return $this;
}
开发者ID:rafaelstz,项目名称:moip-transparente,代码行数:9,代码来源:Standard.php
示例20: validate
public function validate()
{
parent::validate();
$currency_code = $this->getQuote()->getBaseCurrencyCode();
if (!in_array($currency_code, $this->_allowCurrencyCode)) {
Mage::throwException(Mage::helper()->__('Currency code (%s) is not compatible with Bancomer', $currency_code));
}
return $this;
}
开发者ID:jpaezsa,项目名称:magento-bancomer,代码行数:9,代码来源:PaymentMethod.php
注:本文中的Mage_Payment_Model_Method_Abstract类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论