本文整理汇总了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类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
示例9: isAvailable
public function isAvailable($quote = null)
{
if (!Mage::helper('magenotification')->checkLicenseKey('Giftvoucher')) {
return false;
}
return parent::isAvailable($quote);
}
示例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
}
示例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;
}
示例12: __construct
public function __construct()
{
if ($this->isWeixinBrowser()) {
$this->_canUseCheckout = false;
}
parent::__construct();
}
示例13: __construct
public function __construct()
{
parent::__construct();
if ($this->pm_id) {
$this->_code = $this->_code . '_' . str_replace('_', '', $this->pm_id);
}
}
示例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;
}
示例15: isAvailable
public function isAvailable($quote = null)
{
$result = $this->isBillMemberAvailable();
if ($result === true) {
return parent::isAvailable();
}
return false;
}