private function getSupportElement() { $control = new Customweb_Form_Control_Html('supportText', Customweb_I18n_Translation::__("If you have any issues with the module please feel free to contact us. See our <a href='https://www.sellxed.com/en/support' target='_blank'>support page</a> for more information.")); $element = new Customweb_Form_Element(Customweb_I18n_Translation::__("Support"), $control); $element->setRequired(false); return $element; }
private function getMandateElements(Customweb_Payment_Authorization_IOrderContext $orderContext) { $customer = $orderContext->getBillingAddress()->getFirstName() . ' ' . $orderContext->getBillingAddress()->getLastName(); $mandateId = Customweb_Payment_Authorization_Method_Sepa_Mandate::generateMandateId(self::$MANDATE_ID_SCHEMA); $mandateIdControl = new Customweb_Form_Control_HiddenInput('MANDATEID', $mandateId); $mandateIdElement = new Customweb_Form_HiddenElement($mandateIdControl); $mandateTextControl = new Customweb_Form_Control_Html('mandate_text', $this->getMandateText($mandateId, $customer)); $mandateTextElement = new Customweb_Form_Element(Customweb_I18n_Translation::__('Mandate text'), $mandateTextControl); $mandateTextElement->setRequired(false); return array($mandateIdElement, $mandateTextElement); }
/** * Creates the CVC element and control. * * @return void */ protected function buildCVCElement() { if ($this->getCvcFieldName() !== null && $this->isCvcElementShown()) { $this->createCVCControl(); $this->cvcElement = new Customweb_Form_Element(Customweb_I18n_Translation::__('CVC Code'), $this->cvcControl, Customweb_I18n_Translation::__('Please enter here the CVC code from your card. You find the code on the back of the card.')); $this->cvcElement->setRequired($this->isCvcElementRequired())->setElementIntention(Customweb_Form_Intention_Factory::getCvcIntention())->setErrorMessage($this->getCvcElementErrorMessage()); } }
public function getAliasSelect() { $payment = $this->getMethod(); $result = ''; if ($payment->getHelper()->getConfigurationValue('alias_manager') != 'inactive') { $aliasList = $payment->loadAliasForCustomer(); if (count($aliasList)) { $alias = array('new' => ''); foreach ($aliasList as $key => $value) { $alias[$key] = $value; } // The onchange even listener is added here, because there seems to be a bug with prototype's observe // on select fields. ::[License_Identifier]:: $selectControl = new Customweb_Form_Control_Select('alias', $alias, 'new'); $aliasElement = new Customweb_Form_Element($payment->getHelper()->__('Saved cards: '), $selectControl, $payment->getHelper()->__('You may choose one of the cards you paid before on this site.')); $aliasElement->setRequired(false); $result = $payment->getFormRenderer()->renderElements(array(0 => $aliasElement)); } } return $result; }
public function getAliasSelect() { $payment = $this->getMethod(); $result = ""; if ($payment->getPaymentMethodConfigurationValue('alias_manager') == 'active') { $aliasList = $payment->loadAliasForCustomer(); if (count($aliasList)) { $alias = array('new' => Mage::helper('SaferpayCw')->__('New card')); foreach ($aliasList as $key => $value) { $alias[$key] = $value; } // The onchange even listener is added here, because there seems to be a bug with prototype's observe // on select fields. $selectControl = new Customweb_SaferpayCw_Model_Select("alias_select", $alias, 'new', "cwpm_" . $payment->getCode() . ".loadAliasData(this)"); $aliasElement = new Customweb_Form_Element(Mage::helper('SaferpayCw')->__("Saved cards:"), $selectControl, Mage::helper('SaferpayCw')->__("You may choose one of the cards you paid before on this site.")); $aliasElement->setRequired(false); $renderer = new Customweb_SaferpayCw_Model_FormRenderer(); $renderer->setNameSpacePrefix($payment->getCode()); $result = $renderer->renderElements(array(0 => $aliasElement)); } } return $result; }
/** * Creates a sales tax number element. * * @param string $fieldName * @param string $defaultvalue * @return Customweb_Form_Element */ public static function getSalesTaxNumberElement($fieldName, $defaultvalue = '', $required = true) { $control = new Customweb_Form_Control_TextInput($fieldName, $defaultvalue); $control->setAutocomplete(false); $description = Customweb_I18n_Translation::__('Please enter here the sales tax number of your company.'); if (!$required) { $description .= ' ' . Customweb_I18n_Translation::__('If it is not applicable leave the field empty.'); } $element = new Customweb_Form_Element(Customweb_I18n_Translation::__('Sales Tax Number'), $control, $description); if ($required) { $control->addValidator(new Customweb_Form_Validator_NotEmpty($control, Customweb_I18n_Translation::__("You have to enter sales tax number of your company."))); $element->setRequired(true); } else { $element->setRequired(false); } return $element; }