本文整理汇总了PHP中Mage_Payment_Model_Method_Abstract::getCode方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Payment_Model_Method_Abstract::getCode方法的具体用法?PHP Mage_Payment_Model_Method_Abstract::getCode怎么用?PHP Mage_Payment_Model_Method_Abstract::getCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Payment_Model_Method_Abstract
的用法示例。
在下文中一共展示了Mage_Payment_Model_Method_Abstract::getCode方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: _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);
}
示例3: _filterValues
/**
* Filter self data to make sure it can be validated properly
*
* @return Mage_Payment_Model_Recurring_Profile
*/
protected function _filterValues()
{
// determine payment method/code
if ($this->_methodInstance) {
$this->setMethodCode($this->_methodInstance->getCode());
} elseif ($this->getMethodCode()) {
$this->getMethodInstance();
}
// unset redundant values, if empty
foreach (array('schedule_description', 'suspension_threshold', 'bill_failed_later', 'period_frequency', 'period_max_cycles', 'reference_id', 'trial_period_unit', 'trial_period_frequency', 'trial_period_max_cycles', 'init_may_fail') as $key) {
if ($this->hasData($key) && (!$this->getData($key) || '0' == $this->getData($key))) {
$this->unsetData($key);
}
}
// cast amounts
foreach (array('billing_amount', 'trial_billing_amount', 'shipping_amount', 'tax_amount', 'init_amount') as $key) {
if ($this->hasData($key)) {
if (!$this->getData($key) || 0 == $this->getData($key)) {
$this->unsetData($key);
} else {
$this->setData($key, sprintf('%.4F', $this->getData($key)));
}
}
}
// automatically determine start date, if not set
if ($this->getStartDatetime()) {
$date = new Zend_Date($this->getStartDatetime(), Varien_Date::DATETIME_INTERNAL_FORMAT);
$this->setNearestStartDatetime($date);
} else {
$this->setNearestStartDatetime();
}
return $this;
}
示例4: isValid
/**
* Validate data before save
*
* @return bool
*/
public function isValid()
{
$this->_errors = array();
if (is_null($this->_paymentMethodInstance) || !$this->_paymentMethodInstance->getCode()) {
$this->_errors[] = Mage::helper('payment')->__('Payment method code is not set.');
}
if (!$this->getReferenceId()) {
$this->_errors[] = Mage::helper('payment')->__('Reference ID is not set.');
}
return empty($this->_errors);
}
示例5: getMethodLabelAfterHtml
/**
* Payment method additional label part getter
* @param Mage_Payment_Model_Method_Abstract $method
*/
public function getMethodLabelAfterHtml(Mage_Payment_Model_Method_Abstract $method)
{
if ($form = $this->getChild('payment.method.' . $method->getCode())) {
return $form->getMethodLabelAfterHtml();
}
}
示例6: setMethod
/**
* Method code setter
*
* @param string|Mage_Payment_Model_Method_Abstract $method
* @return Mage_Paypal_Model_Config
*/
public function setMethod($method)
{
if ($method instanceof Mage_Payment_Model_Method_Abstract) {
$this->_methodCode = $method->getCode();
} elseif (is_string($method)) {
$this->_methodCode = $method;
}
return $this;
}
示例7: canPaymentMethodManageSubscriptions
/**
* Check whether the payment method can manage subscriptions.
*
* @param Mage_Payment_Model_Method_Abstract $paymentMethod
* @return boolean
*/
public function canPaymentMethodManageSubscriptions(Mage_Payment_Model_Method_Abstract $paymentMethod)
{
return $paymentMethod instanceof Customweb_Payment_Authorization_IPaymentMethod || $paymentMethod instanceof Customweb_Subscription_Model_Payment_Abstract || in_array($paymentMethod->getCode(), array('IsrInvoice'));
}
示例8: getMethodFormBlock
/**
* Retreive payment method form html
*
* @param Mage_Payment_Model_Abstract $method
* @return Mage_Payment_Block_Form
*/
public function getMethodFormBlock(Mage_Payment_Model_Method_Abstract $method)
{
$block = false;
$blockType = $method->getFormBlockType();
if ($this->getLayout()) {
$block = $this->getLayout()->createBlock($blockType, $method->getCode());
$block->setMethod($method);
}
return $block;
}
示例9: getCode
/**
* Retrieve dummy payment method code
*
* @return string
*/
public function getCode()
{
return Mage_Payment_Model_Method_Abstract::getCode();
}
示例10: getPaymentMethodFormHtml
/**
* Payment method form html getter
* @param Mage_Payment_Model_Method_Abstract $method
*/
public function getPaymentMethodFormHtml(Mage_Payment_Model_Method_Abstract $method)
{
return $this->getChildHtml('payment.method.' . $method->getCode());
}