protected function getOptions() { $creditcards = PaypalHelperPaypal::getPaypalCreditCards(); $prefix = 'VMPAYMENT_PAYPAL_CC_'; foreach ($creditcards as $creditcard) { $options[] = JHtml::_('select.option', $creditcard, vmText::_($prefix . strtoupper($creditcard))); } return $options; }
protected function getInput() { JFactory::getLanguage()->load('plg_vmpayment_paypal', JPATH_ADMINISTRATOR); $creditcards = PaypalHelperPaypal::getPaypalCreditCards(); $prefix = 'VMPAYMENT_PAYPAL_CC_'; $fields = array(); foreach ($creditcards as $creditcard) { $fields[$creditcard]['value'] = $creditcard; $fields[$creditcard]['text'] = vmText::_($prefix . strtoupper($fields[$creditcard]['value'])); } return JHTML::_('select.genericlist', $creditcards, $this->name, 'size="1"', 'value', 'title', $this->value); }
function fetchElement($name, $value, &$node, $control_name) { JFactory::getLanguage()->load('plg_vmpayment_paypal', JPATH_ADMINISTRATOR); $creditcards = PaypalHelperPaypal::getPaypalCreditCards(); $prefix = 'VMPAYMENT_PAYPAL_CC_'; $fields = array(); foreach ($creditcards as $creditcard) { $fields[$creditcard]['value'] = $creditcard; $fields[$creditcard]['text'] = vmText::_($prefix . strtoupper($fields[$creditcard]['value'])); } $attribs = ' '; $attribs .= ' multiple="multiple"'; $attribs .= $node->attributes('class') ? ' class="' . $node->attributes('class') . '"' : ''; return JHTML::_('select.genericlist', $fields, $control_name . '[' . $name . '][]', $attribs, 'value', 'text', $value, $control_name . $name); }
/** * * List payment methods selection * @param VirtueMartCart $cart * @param int $selected * @param $htmlIn * @return bool */ public function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn) { if ($this->getPluginMethods($cart->vendorId) === 0) { if (empty($this->_name)) { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('COM_VIRTUEMART_CART_NO_' . strtoupper($this->_psType))); return false; } else { return false; } } $method_name = $this->_psType . '_name'; $htmla = array(); foreach ($this->methods as $this->_currentMethod) { if ($this->checkConditions($cart, $this->_currentMethod, $cart->pricesUnformatted)) { $html = ''; $cart_prices = array(); $cart_prices['withTax'] = ''; $cart_prices['salesPrice'] = ''; $methodSalesPrice = $this->setCartPrices($cart, $cart_prices, $this->_currentMethod); $this->_currentMethod->$method_name = $this->renderPluginName($this->_currentMethod); $html .= $this->getPluginHtml($this->_currentMethod, $selected, $methodSalesPrice); if ($this->_currentMethod->paypalproduct == 'api') { if (empty($this->_currentMethod->creditcards)) { $this->_currentMethod->creditcards = PaypalHelperPaypal::getPaypalCreditCards(); } elseif (!is_array($this->_currentMethod->creditcards)) { $this->_currentMethod->creditcards = (array)$this->_currentMethod->creditcards; } $html .= $this->renderByLayout('creditcardform', array('creditcards' => $this->_currentMethod->creditcards, 'virtuemart_paymentmethod_id' => $this->_currentMethod->virtuemart_paymentmethod_id, 'method' => $this->_currentMethod, 'sandbox' => $this->_currentMethod->sandbox, 'customerData' => $this->customerData)); } if ($this->_currentMethod->payment_type == '_xclick-auto-billing' && $this->_currentMethod->billing_max_amount_type == 'cust') { $html .= $this->renderByLayout('billingmax', array("method"=>$this->_currentMethod, "customerData"=>$this->customerData)); } if ($this->_currentMethod->payment_type == '_xclick-subscriptions') { $paypalInterface = $this->_loadPayPalInterface(); $html .= '<br/><span class="vmpayment_cardinfo">' . $paypalInterface->getRecurringProfileDesc() . '</span>'; } if ($this->_currentMethod->payment_type == '_xclick-payment-plan') { $paypalInterface = $this->_loadPayPalInterface(); $html .= '<br/><span class="vmpayment_cardinfo">' . $paypalInterface->getPaymentPlanDesc() . '</span>'; } $htmla[] = $html; } } $htmlIn[] = $htmla; return true; }