function getInput() { $dynamic_url = JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component&po='; $accepted_url = JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&po='; $refused_url = JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginUserPaymentCancel&po='; $msg = ""; $msg .= '<div>'; $msg .= "<strong>" . tsmText::_('VMPAYMENT_KLIKANDPAY_CONF_DYNAMIC_RETURN_URL') . "</strong>"; $msg .= "<br />"; $msg .= tsmText::_('VMPAYMENT_KLIKANDPAY_CONF_DYNAMIC_RETURN_URL_TIP'); $msg .= "<br />"; $msg .= '<input class="required" readonly size="180" value="' . $dynamic_url . '" />'; $msg .= "</div>"; $msg .= '<div style="margin-top: 10px ;">'; $msg .= "<strong>" . tsmText::_('VMPAYMENT_KLIKANDPAY_CONF_URL_TRANSACTION_ACCEPTED') . "</strong>"; $msg .= "<br />"; $msg .= tsmText::_('VMPAYMENT_KLIKANDPAY_CONF_URL_TRANSACTION_ACCEPTED_TIP'); $msg .= "<br />"; $msg .= '<input class="required" readonly size="180" value="' . $accepted_url . '" />'; $msg .= "</div>"; $msg .= '<div style="margin-top: 10px ;">'; $msg .= "<strong>" . tsmText::_('VMPAYMENT_KLIKANDPAY_CONF_URL_TRANSACTION_REFUSED') . "</strong>"; $msg .= "<br />"; $msg .= tsmText::_('VMPAYMENT_KLIKANDPAY_CONF_URL_TRANSACTION_REFUSED_TIP'); $msg .= "<br />"; //$msg .= $refused_url ; $msg .= '<input class="required" readonly size="180" value="' . $refused_url . '" />'; $msg .= "</div>"; return $msg; }
function save($data = 0) { $fileModel = tmsModel::getModel('media'); //Now we try to determine to which this media should be long to $data = array_merge(vRequest::getRequest(), vRequest::get('media')); //$data['file_title'] = vRequest::getVar('file_title','','post','STRING',JREQUEST_ALLOWHTML); if (!empty($data['file_description'])) { $data['file_description'] = JComponentHelper::filterText($data['file_description']); //vRequest::filter(); vRequest::getHtml('file_description',''); } /*$data['media_action'] = vRequest::getCmd('media[media_action]'); $data['media_attributes'] = vRequest::getCmd('media[media_attributes]'); $data['file_type'] = vRequest::getCmd('media[file_type]');*/ if (empty($data['file_type'])) { $data['file_type'] = $data['media_attributes']; } $msg = ''; if ($id = $fileModel->store($data)) { $msg = tsmText::_('com_tsmart_FILE_SAVED_SUCCESS'); } $cmd = vRequest::getCmd('task'); if ($cmd == 'apply') { $redirection = 'index.php?option=com_tsmart&view=media&task=edit&tsmart_media_id=' . $id; } else { $redirection = 'index.php?option=com_tsmart&view=media'; } $this->setRedirect($redirection, $msg); }
function displayMediaFull($imageArgs = '', $lightbox = true, $effect = "class='modal'", $description = true) { if (!$this->file_is_forSale) { // Remote image URL if (substr($this->file_url, 0, 4) == "http") { $file_url = $this->file_url; $file_alt = $this->file_title; } else { $rel_path = str_replace('/', DS, $this->file_url_folder); $fullSizeFilenamePath = VMPATH_ROOT . DS . $rel_path . $this->file_name . '.' . $this->file_extension; if (!file_exists($fullSizeFilenamePath)) { $file_url = $this->theme_url . 'assets/images/vmgeneral/' . tsmConfig::get('no_image_found'); $file_alt = tsmText::_('com_tsmart_NO_IMAGE_FOUND') . ' ' . $this->file_description; } else { $file_url = $this->file_url; $file_alt = $this->file_meta; } } $postText = false; if ($description) { $postText = $this->file_description; } if (!empty($this->file_class)) { $imageArgs = $this->filterImageArgs($imageArgs); } return $this->displayIt($file_url, $file_alt, $imageArgs, $lightbox, $effect, $postText); } else { //Media which should be sold, show them only as thumb (works as preview) return $this->displayMediaThumb(array('id' => 'vm_display_image'), false); } }
function __construct($method, $paypalPlugin) { parent::__construct($method, $paypalPlugin); //Set the credentials if ($this->_method->sandbox) { $this->api_login_id = trim($this->_method->sandbox_api_login_id); $this->api_signature = trim($this->_method->sandbox_api_signature); $this->api_password = trim($this->_method->sandbox_api_password); $this->payflow_partner = trim($this->_method->sandbox_payflow_partner); $this->payflow_vendor = trim($this->_method->sandbox_payflow_vendor); } else { $this->api_login_id = trim($this->_method->api_login_id); $this->api_signature = trim($this->_method->api_signature); $this->api_password = trim($this->_method->api_password); } if (empty($this->api_login_id) || empty($this->api_signature) || empty($this->api_password)) { $text = tsmText::sprintf('VMPAYMENT_PAYPAL_CREDENTIALS_NOT_SET', $this->_method->payment_name, $this->_method->virtuemart_paymentmethod_id); vmError($text, $text); } if (empty($this->_method->payflow_partner) or empty($this->_method->sandbox_payflow_partner)) { $sandbox = ""; if ($this->_method->sandbox) { $sandbox = 'SANDBOX_'; } $text = tsmText::sprintf('VMPAYMENT_PAYPAL_PARAMETER_REQUIRED', tsmText::_('VMPAYMENT_PAYPAL_' . $sandbox . 'PAYFLOW_PARTNER'), $this->_method->payment_name, $this->_method->virtuemart_paymentmethod_id); vmError($text); } }
function check() { if (empty($this->notify_email) || !filter_var($this->notify_email, FILTER_VALIDATE_EMAIL)) { vmError(tsmText::_('com_tsmart_ENTER_A_VALID_EMAIL_ADDRESS'), tsmText::_('com_tsmart_ENTER_A_VALID_EMAIL_ADDRESS')); return false; } return parent::check(); }
/** * Only send an email if the ERP is enabled, and authorization is done by ERP * IN all other cases, there will be an authorization after OrderConfirmed, that will send an email * @param $order */ function onResponseUpdateOrderHistory($order) { $order_history['order_status'] = $this->_currentMethod->status_orderconfirmed; $order_history['customer_notified'] = $this->getCustomerNotified(); $order_history['comments'] = tsmText::_('VMPAYMENT_AMAZON_COMMENT_STATUS_ORDERCONFIRMED'); $modelOrder = tmsModel::getModel('orders'); $modelOrder->updateStatusForOneOrder($order['details']['BT']->virtuemart_order_id, $order_history, false); }
/** * Check if the given coupon code exists, is (still) valid and valid for the total order amount * @param string $_code Coupon code * @param float $_billTotal Total amount for the order * @author Oscar van Eijk * @author Max Milbers * @return string Empty when the code is valid, otherwise the error message */ public static function ValidateCouponCode($_code, $_billTotal) { if (empty($_code) or $_code == tsmText::_('COM_VIRTUEMART_COUPON_CODE_ENTER') or $_code == tsmText::_('COM_VIRTUEMART_COUPON_CODE_CHANGE')) { return ''; } $couponData = 0; JPluginHelper::importPlugin('vmcoupon'); $dispatcher = JDispatcher::getInstance(); $returnValues = $dispatcher->trigger('plgVmValidateCouponCode', array($_code, $_billTotal)); if (!empty($returnValues)) { foreach ($returnValues as $returnValue) { if ($returnValue !== null) { //Take a look on this seyi, I am not sure about that, but it should work at least simular note by Max return $returnValue; } } } if (empty($couponData)) { $_db = JFactory::getDBO(); $_q = 'SELECT IFNULL( NOW() >= `coupon_start_date` OR `coupon_start_date`="0000-00-00 00:00:00" , 1 ) AS started , `coupon_start_date` , IFNULL (`coupon_expiry_date`!="0000-00-00 00:00:00" and NOW() > `coupon_expiry_date`,0) AS `ended` , `coupon_expiry_date` , `coupon_value_valid` , `coupon_used` FROM `#__virtuemart_coupons` WHERE `coupon_code` = "' . $_db->escape($_code) . '"'; $_db->setQuery($_q); $couponData = $_db->loadObject(); } if (!$couponData) { return tsmText::_('COM_VIRTUEMART_COUPON_CODE_INVALID'); } if ($couponData->coupon_used) { $session = JFactory::getSession(); $session_id = $session->getId(); if ($couponData->coupon_used != $session_id) { return tsmText::_('COM_VIRTUEMART_COUPON_CODE_INVALID'); } } if (!$couponData->started) { return tsmText::_('COM_VIRTUEMART_COUPON_CODE_NOTYET') . $couponData->coupon_start_date; } if ($couponData->ended) { self::RemoveCoupon($_code, true); return tsmText::_('COM_VIRTUEMART_COUPON_CODE_EXPIRED'); } if ($_billTotal < $couponData->coupon_value_valid) { if (!class_exists('CurrencyDisplay')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php'; } $currency = CurrencyDisplay::getInstance(); $coupon_value_valid = $currency->priceDisplay($couponData->coupon_value_valid); return tsmText::_('COM_VIRTUEMART_COUPON_CODE_TOOLOW') . " " . $coupon_value_valid; } return ''; }
protected function getOptions() { $creditcards = RealexHelperRealex::getRealexCreditCards(); $prefix = 'VMPAYMENT_REALEX_HPP_API_CC_'; foreach ($creditcards as $creditcard) { $options[] = JHtml::_('select.option', $creditcard, tsmText::_($prefix . strtoupper($creditcard))); } return $options; }
protected function getOptions() { $creditcards = PaypalHelperPaypal::getPaypalCreditCards(); $prefix = 'VMPAYMENT_PAYPAL_CC_'; foreach ($creditcards as $creditcard) { $options[] = JHtml::_('select.option', $creditcard, tsmText::_($prefix . strtoupper($creditcard))); } return $options; }
/** * Send the ask question email. * @author Kohl Patrick, Christopher Roussel */ public function mailAskquestion() { vRequest::vmCheckToken(); if (!class_exists('shopFunctionsF')) { require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php'; } $model = tmsModel::getModel('vendor'); $mainframe = JFactory::getApplication(); $vars = array(); $min = tsmConfig::get('asks_minimum_comment_length', 50) + 1; $max = tsmConfig::get('asks_maximum_comment_length', 2000) - 1; $commentSize = vRequest::getString('comment'); if (function_exists('mb_strlen')) { $commentSize = mb_strlen($commentSize); } else { $commentSize = strlen($commentSize); } $validMail = filter_var(vRequest::getVar('email'), FILTER_VALIDATE_EMAIL); $virtuemart_vendor_id = vRequest::getInt('virtuemart_vendor_id', 1); if (!class_exists('VirtueMartModelVendor')) { require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php'; } $userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id); //$vendorUser = JFactory::getUser($userId); if ($commentSize < $min || $commentSize > $max || !$validMail) { $this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=vendor&task=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE), tsmText::_('COM_VIRTUEMART_COMMENT_NOT_VALID_JS')); return; } $user = JFactory::getUser(); $fromMail = vRequest::getVar('email'); //is sanitized then $fromName = vRequest::getVar('name', ''); //is sanitized then $fromMail = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromMail); $fromName = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromName); if (!empty($user->id)) { if (empty($fromMail)) { $fromMail = $user->email; } if (empty($fromName)) { $fromName = $user->name; } } $vars['user'] = array('name' => $fromName, 'email' => $fromMail); $VendorEmail = $model->getVendorEmail($virtuemart_vendor_id); $vars['vendor'] = array('vendor_store_name' => $fromName); if (shopFunctionsF::renderMail('vendor', $VendorEmail, $vars, 'vendor')) { $string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY'; } else { $string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY'; } $mainframe->enqueueMessage(tsmText::_($string)); // Display it all $view = $this->getView('vendor', 'html'); $view->setLayout('mail_confirmed'); $view->display(); }
function getInput() { $flag = $this->value; if ($this->value == 'NB') { $flag = 'NO'; } $flagImg = JURI::root(TRUE) . '/media/mod_languages/images/' . strtolower($flag) . '.gif'; return '<strong>' . tsmText::_('VMPAYMENT_KLARNA_CONF_SETTINGS_' . $this->value) . '</strong><img style="margin-left: 5px;" src="' . $flagImg . '" />'; }
protected function getInput() { //VmConfig::loadJLang('com_virtuemart'); $categorylist = ShopFunctions::categoryListTree(array($this->value)); $html = '<select multiple="true" class="inputbox ' . $this->class . '" name="' . $this->name . '" >'; $html .= '<option value="0">' . tsmText::_('COM_VIRTUEMART_NONE') . '</option>'; $html .= $categorylist; $html .= "</select>"; return $html; }
protected function getInput() { if (empty($this->element['description'])) { return ''; } $description = (string) $this->element['description']; $class = $this->element['class'] ? ' class="' . trim((string) $this->element['class']) . '"' : ''; $html = !empty($description) ? tsmText::_($description) : ''; return '<span ' . $class . '>' . $html . '</span>'; }
function getInput() { $js = ' //<![CDATA[ jQuery(document).ready(function( $ ) { jQuery("#heidelpay_getheidelpay_link").click( function() { if ( $("#heidelpay_getheidelpay_show_hide").is(":visible") ) { $("#heidelpay_getheidelpay_show_hide").hide("slow"); $("#heidelpay_getheidelpay_link").html("' . addslashes(tsmText::_('VMPAYMENT_HEIDELPAY_CREATE_ACCOUNT')) . '"); } else { $("#heidelpay_getheidelpay_show_hide").show("slow"); $("#heidelpay_getheidelpay_link").html("' . addslashes(tsmText::_('VMPAYMENT_HEIDELPAY_GET_HEIDELPAY_HIDE')) . '"); } }); }); //]]> '; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); $cid = vRequest::getvar('cid', NULL, 'array'); if (is_Array($cid)) { $virtuemart_paymentmethod_id = $cid[0]; } else { $virtuemart_paymentmethod_id = $cid; } $query = "SELECT payment_params FROM `#__virtuemart_paymentmethods` WHERE virtuemart_paymentmethod_id = '" . $virtuemart_paymentmethod_id . "'"; $db = JFactory::getDBO(); $db->setQuery($query); $params = $db->loadResult(); $payment_params = explode("|", $params); foreach ($payment_params as $payment_param) { if (empty($payment_param)) { continue; } $param = explode('=', $payment_param); $payment_params[$param[0]] = substr($param[1], 1, -1); } $id = ""; if (isset($payment_params['HEIDELPAY_SECURITY_SENDER']) and ($payment_params['HEIDELPAY_SECURITY_SENDER'] == '31HA07BC8124AD82A9E96D9A35FAFD2A' or $payment_params['HEIDELPAY_SECURITY_SENDER'] == '')) { $id = "heidelpay_getheidelpay_link"; $display = ''; $html = '<a href="#" id="' . $id . '">' . tsmText::_('VMPAYMENT_HEIDELPAY_ALREADY_ACCOUNT') . '</a>'; } else { $id = "heidelpay_getheidelpay_link"; $display = ' style="display: none;"'; $html = '<a href="#" id="' . $id . '">' . tsmText::_('VMPAYMENT_HEIDELPAY_CREATE_ACCOUNT') . '</a>'; } $lang = $this->getLang(); $html .= '<div id="heidelpay_getheidelpay_show_hide" align=""' . $display . ' >'; $url = "http://demoshops.heidelpay.de/contactform/?campaign=vituemart&shop=vituemart&lang=" . $lang; $html .= '<iframe src="' . $url . '" scrolling="yes" style="x-overflow: none;" frameborder="0" height="1400px" width="300px"></iframe>'; $html .= "</div>"; return $html; }
protected function getInput() { vmJsApi::addJScript('/plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/js/admin.js'); vmJsApi::css('admin', 'plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/css/'); $url = "http://www.realexpayments.com/partner-referral?id=tsmart"; $logo = '<img src="http://www.realexpayments.com/images/logo_realex_large.png" width="150"/>'; $html = '<p><a target="_blank" href="' . $url . '" >' . $logo . '</a></p>'; $html .= '<p><a target="_blank" href="' . $url . '" class="signin-button-link">' . tsmText::_('VMPAYMENT_REALEX_HPP_API_REGISTER') . '</a>'; $html .= ' <a target="_blank" href="http://docs.tsmart.net/manual/shop-menu/payment-methods/realex-hpp-and-api.html" class="signin-button-link">' . tsmText::_('VMPAYMENT_REALEX_HPP_API_DOCUMENTATION') . '</a></p>'; return $html; }
function display($tpl = null) { $db = JFactory::getDBO(); if ($tsmart_media_id = vRequest::getInt('tsmart_media_id')) { //$db = JFactory::getDBO(); $query = 'SELECT `file_url`,`file_title` FROM `#__tsmart_medias` where `tsmart_media_id`=' . $tsmart_media_id; $db->setQuery($query); $json = $db->loadObject(); if (isset($json->file_url)) { $json->file_url = JURI::root() . $json->file_url; $json->msg = 'OK'; echo vmJsApi::safe_json_encode($json); } else { $json->msg = '<b>' . tsmText::_('com_tsmart_NO_IMAGE_SET') . '</b>'; echo json_encode($json); } } elseif ($custom_jplugin_id = vRequest::getInt('custom_jplugin_id')) { $table = '#__extensions'; $ext_id = 'extension_id'; $q = 'SELECT `params`,`element` FROM `' . $table . '` WHERE `' . $ext_id . '` = "' . $custom_jplugin_id . '"'; $db->setQuery($q); $this->jCustom = $db->loadObject(); $customModel = tmsModel::getModel('custom'); $this->custom = $customModel->getCustom(); // Get the payment XML. $formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmcustom' . DS . $this->jCustom->element . DS . $this->jCustom->element . '.xml'); if (file_exists($formFile)) { tsmConfig::loadJLang('plg_vmpsplugin', false); if (!class_exists('vmPlugin')) { require VMPATH_PLUGINLIBS . DS . 'vmplugin.php'; } $filename = 'plg_vmcustom_' . $this->jCustom->element; vmPlugin::loadJLang($filename, 'vmcustom', $this->jCustom->element); $this->custom = tmsModel::getModel('custom')->getCustom(); $varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm'); $this->custom->form = JForm::getInstance($this->jCustom->element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]'); $this->custom->params = new stdClass(); foreach ($varsToPush as $k => $field) { if (strpos($k, '_') != 0) { $this->custom->params->{$k} = $field[0]; } } $this->custom->form->bind($this->custom->getProperties()); $form = $this->custom->form; include VMPATH_ADMIN . DS . 'fields' . DS . 'formrenderer.php'; echo '<input type="hidden" value="' . $this->jCustom->element . '" name="custom_value">'; } else { $this->custom->form = null; //VmConfig::$echoDebug = 1; vmdebug('File does not exist ' . $formFile); } } jExit(); }
function getInput() { $js = ' //<![CDATA[ jQuery(document).ready(function( $ ) { jQuery("#paybox_getpaybox_link").click( function() { if ( $("#paybox_getpaybox_show_hide").is(":visible") ) { $("#paybox_getpaybox_show_hide").hide("slow"); $("#paybox_getpaybox_link").html("' . addslashes(tsmText::_('VMPAYMENT_PAYBOX_ALREADY_ACCOUNT')) . '"); } else { $("#paybox_getpaybox_show_hide").show("slow"); $("#paybox_getpaybox_link").html("' . addslashes(tsmText::_('VMPAYMENT_PAYBOX_GET_PAYBOX_HIDE')) . '"); } }); }); //]]> '; vmJsApi::addJScript("vm.getPaybox", $js); vmJsApi::addJScript('/plugins/vmpayment/paybox/paybox/assets/js/admin.js'); vmJsApi::css('admin', 'plugins/vmpayment/paybox/paybox/assets/css/'); $cid = vRequest::getvar('cid', NULL, 'array'); if (is_Array($cid)) { $virtuemart_paymentmethod_id = $cid[0]; } else { $virtuemart_paymentmethod_id = $cid; } $query = "SELECT * FROM `#__virtuemart_paymentmethods` WHERE virtuemart_paymentmethod_id = '" . $virtuemart_paymentmethod_id . "'"; $db = JFactory::getDBO(); $db->setQuery($query); $params = $db->loadObject(); $html = '<img src="http://tsmart.boutique-paybox.com/PayboxLogo.jpg" width="200px"/><br />'; if ($params->created_on == $params->modified_on) { $id = "paybox_getpaybox_link"; $html .= '<a href="#" id="' . $id . '">' . tsmText::_('VMPAYMENT_PAYBOX_GET_PAYBOX_HIDE') . '</a>'; $display = ''; $html .= '<div id="paybox_getpaybox_show_hide" align=""' . $display . ' >'; } else { $id = "paybox_getpaybox_link"; $html .= '<a href="#" id="' . $id . '">' . tsmText::_('VMPAYMENT_PAYBOX_ALREADY_ACCOUNT') . '</a>'; $display = ' style="display: none;"'; $html .= '<div id="paybox_getpaybox_show_hide" align=""' . $display . ' >'; } $id = ""; $lang = $this->getLang(); if ($lang == 'fr') { $url = "http://tsmart.boutique-paybox.com/PayboxPres.html"; } else { $url = "http://tsmart.boutique-paybox.com/PayboxPres.html"; } $html .= '<iframe src="' . $url . '" scrolling="yes" style="x-overflow: none;" frameborder="0" height="1400px" width="800px"></iframe>'; $html .= "</div>"; return $html; }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { tsmConfig::loadConfig(); tsmConfig::loadJLang('com_tsmart'); $categorylist = ShopFunctions::categoryListTree(array($this->value)); $html = '<select class="inputbox" name="' . $this->name . '" >'; $html .= '<option value="0">' . tsmText::_('com_tsmart_CATEGORY_FORM_TOP_LEVEL') . '</option>'; $html .= $categorylist; $html .= "</select>"; return $html; }
/** * if asynchronous mode, ? * @param $order */ public function onResponseUpdateOrderHistory($order) { $order_history = array(); $amazonState = ""; $reasonCode = ""; $authorizeResponse = $this->amazonData; // if am $getAuthorizationDetailsResult = $authorizeResponse->getGetAuthorizationDetailsResult(); $authorizationDetails = $getAuthorizationDetailsResult->getAuthorizationDetails(); if ($authorizationDetails->isSetAuthorizationStatus()) { $authorizationStatus = $authorizationDetails->getAuthorizationStatus(); if (!$authorizationStatus->isSetState()) { return false; } $amazonState = $authorizationStatus->getState(); if ($authorizationStatus->isSetReasonCode()) { $reasonCode = $authorizationStatus->getReasonCode(); } } // In asynchronous mode, AuthorizationResponse is always Pending. Order status is not updated if ($amazonState == 'Pending') { return $amazonState; } $order_history['customer_notified'] = 1; // SYNCHRONOUS MODE: amazon returns in real time the final process status if ($amazonState == 'Open') { // it should always be the case if the CaptureNow == false $order_history['order_status'] = $this->_currentMethod->status_authorization; $order_history['comments'] = tsmText::_('VMPAYMENT_AMAZON_COMMENT_STATUS_AUTHORIZATION_OPEN'); $order_history['customer_notified'] = 1; } elseif ($amazonState == 'Closed') { // it should always be the case if the CaptureNow == true if (!($authorizationDetails->isSetCaptureNow() and $authorizationDetails->getCaptureNow())) { $this->debugLog('SYNCHRONOUS , capture Now, and Amazon State is NOT CLOSED' . __FUNCTION__ . var_export($authorizeResponse, true), 'error'); return $amazonState; } $order_history['order_status'] = $this->_currentMethod->status_capture; $order_history['comments'] = tsmText::_('VMPAYMENT_AMAZON_COMMENT_STATUS_CAPTURED'); $order_history['customer_notified'] = 1; } elseif ($amazonState == 'Declined') { // handling Declined Authorizations $order_history['order_status'] = $this->_currentMethod->status_cancel; $order_history['comments'] = $reasonCode; if ($authorizationStatus->isSetReasonDescription()) { $order_history['comments'] .= " " . $authorizationStatus->getReasonDescription(); } $order_history['customer_notified'] = 0; } $order_history['amazonState'] = $amazonState; $modelOrder = tmsModel::getModel('orders'); $modelOrder->updateStatusForOneOrder($order['details']['BT']->virtuemart_order_id, $order_history, TRUE); return $amazonState; }
protected function getInput() { JHtml::_('behavior.colorpicker'); vmJsApi::addJScript('/plugins/vmpayment/paypal/paypal/assets/js/admin.js'); vmJsApi::css('paypal', 'plugins/vmpayment/paypal/paypal/assets/css/'); $url = "https://www.paypal.com/us/webapps/mpp/referral/paypal-payments-standard?partner_id=83EP5DJG9FU6L"; $logo = '<img src="https://www.paypalobjects.com/en_US/i/logo/PayPal_mark_60x38.gif" />'; $html = '<p><a target="_blank" href="' . $url . '" >' . $logo . '</a></p>'; $html .= '<p><a target="_blank" href="' . $url . '" class="signin-button-link">' . tsmText::_('VMPAYMENT_PAYPAL_REGISTER') . '</a>'; $html .= ' <a target="_blank" href="http://docs.tsmart.net/manual/shop-menu/payment-methods/paypal.html" class="signin-button-link">' . tsmText::_('VMPAYMENT_PAYPAL_DOCUMENTATION') . '</a></p>'; return $html; }
protected function getOptions() { tsmConfig::loadConfig(); tsmConfig::loadJLang('com_tsmart', false); $cModel = tmsModel::getModel('currency'); $values = $cModel->getVendorAcceptedCurrrenciesList(); $options[] = JHtml::_('select.option', 0, tsmText::_('com_tsmart_DEFAULT_VENDOR_CURRENCY')); $options[] = JHtml::_('select.option', -1, tsmText::_('com_tsmart_SELECTED_MODULE_CURRENCY')); foreach ($values as $v) { $options[] = JHtml::_('select.option', $v->tsmart_currency_id, $v->currency_txt); } return $options; }
function getInput() { tsmConfig::loadConfig(); $model = tmsModel::getModel('Manufacturer'); $manufacturers = $model->getManufacturers(true, true, false); $emptyOption = JHtml::_('select.option', '', tsmText::_('com_tsmart_LIST_EMPTY_OPTION'), 'tsmart_manufacturer_id', 'mf_name'); if (!empty($manufacturers) and is_array($manufacturers)) { array_unshift($manufacturers, $emptyOption); } else { $manufacturers = array($emptyOption); } return JHtml::_('select.genericlist', $manufacturers, $this->name, 'class="inputbox" size="1"', 'tsmart_manufacturer_id', 'mf_name', $this->value, $this->id); }
/** * Method to get the field input markup. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { tsmConfig::loadConfig(); tsmConfig::loadJLang('com_tsmart'); $option = vRequest::getCmd('option'); if (!function_exists('curl_init') or !function_exists('curl_exec')) { return tsmText::_('com_tsmart_PS_CURL_LIBRARY_NOT_INSTALLED'); } else { $js = "\n jQuery(document).ready(function( \$ ) {\n \$( '#vmcurl' ) .closest('.control-group').hide();\n });\n "; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); return '<span id="vmcurl"></span>'; } }
function getOrderHistory($paybox_data, $order, $payments) { $amountInCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $order['details']['BT']->order_currency); $order_history['comments'] = tsmText::sprintf('VMPAYMENT_' . $this->plugin_name . '_PAYMENT_STATUS_CONFIRMED_RECURRING', $amountInCurrency['display'], $order['details']['BT']->order_number); $amountInCurrency = vmPSPlugin::getAmountInCurrency($paybox_data['M'] * 0.01, $order['details']['BT']->order_currency); $order_history['comments'] .= "<br />" . tsmText::sprintf('VMPAYMENT_' . $this->plugin_name . '_PAYMENT_STATUS_CONFIRMED_RECURRING_2', $amountInCurrency['display']); $order_history['comments'] .= "<br />" . tsmText::_('VMPAYMENT_' . $this->plugin_name . '_RESPONSE_S') . ' ' . $paybox_data['S']; $subscribe_comment = ''; $order_history['customer_notified'] = true; $order_history['comments'] .= $subscribe_comment; $order_history['recurring'] = $subscribe_comment; $order_history['order_status'] = $this->_method->status_success_subscribe; return $order_history; }
/** * if synchronous, then should not update order status * @param $order * @param $payments */ function onNotificationUpdateOrderHistory($order, $payments) { if ($this->_currentMethod->authorization_mode_erp_disabled == 'automatic_synchronous') { return; } $order_history = array(); $amazonState = ""; $reasonCode = ""; if ($this->amazonData->isSetCaptureDetails()) { $details = $this->amazonData->getCaptureDetails(); if ($details->isSetCaptureStatus()) { $status = $details->getCaptureStatus(); if ($status->isSetState()) { $amazonState = $status->getState(); } else { // TODO THIS IS AN ERROR } if ($status->isSetReasonCode()) { $reasonCode = $status->getReasonCode(); } } // default value $order_history['customer_notified'] = 1; if ($amazonState == 'Completed') { $order_history['order_status'] = $this->_currentMethod->status_capture; $order_history['comments'] = tsmText::_('VMPAYMENT_AMAZON_COMMENT_STATUS_CAPTURE_NOTIFICATION'); } elseif ($amazonState == 'Declined') { if ($reasonCode == 'AmazonRejected') { $order_history['order_status'] = $this->_currentMethod->status_cancel; } elseif ($reasonCode == 'ProcessingFailure') { // TODO retry the Capture again if in Open State, and then call the capture again $order_history['order_status'] = $this->_currentMethod->status_cancel; } $order_history['comments'] = tsmText::sprintf('VMPAYMENT_AMAZON_COMMENT_STATUS_CAPTURE_DECLINED', $reasonCode); } elseif ($amazonState == 'Pending') { $order_history['order_status'] = $this->_currentMethod->status_orderconfirmed; $order_history['comments'] = tsmText::_('VMPAYMENT_AMAZON_COMMENT_STATUS_CAPTURE_PENDING'); $order_history['customer_notified'] = 0; } elseif ($amazonState == 'Closed') { // keep old status $order_history['customer_notified'] = 0; $order_history['order_status'] = $order['details']['BT']->order_status; $order_history['comments'] = tsmText::sprintf('VMPAYMENT_AMAZON_COMMENT_STATUS_CAPTURE_CLOSED', $reasonCode); } $order_history['amazonState'] = $amazonState; $orderModel = tmsModel::getModel('orders'); $orderModel->updateStatusForOneOrder($order['details']['BT']->virtuemart_order_id, $order_history, false); } }
/** * Validates the userfields record fields. * * @return boolean True if the table buffer is contains valid data, false otherwise. */ function check() { if (preg_match('/[^a-z0-9\\._\\-]/i', $this->name) > 0) { vmError(tsmText::_('com_tsmart_NAME_OF_USERFIELD_CONTAINS_INVALID_CHARACTERS')); return false; } if ($this->name != 'tsmart_country_id' and $this->name != 'tsmart_state_id') { $reqValues = array('select', 'multiselect', 'radio', 'multicheckbox'); if (in_array($this->type, $reqValues) and $this->_nrOfValues == 0) { vmError(tsmText::_('com_tsmart_VALUES_ARE_REQUIRED_FOR_THIS_TYPE')); return false; } } return parent::check(); }
function getInput() { vmJsApi::addJScript('/plugins/vmpayment/klikandpay/klikandpay/assets/js/admin.js'); $lang = $this->getLang(); if ($lang == 'fr') { $url = "https://www.klikandpay.com/cgi-bin/connexion.pl?FROM=869B834067"; } else { $url = "https://www.klikandpay.com/cgi-bin/connexion.pl?FROM=869B834067&L=en"; } $logo = '<img src="https://www.klikandpay.com/images/logo_en.png" style="width: 150px;">'; $html = '<p><a target="_blank" href="' . $url . '" >' . $logo . '</a></p>'; $html .= '<p><a class="signin-button-link" href="' . $url . '" target="_blank">' . tsmText::_('VMPAYMENT_KLIKANDPAY_GET') . '</a>'; $html .= ' <a target="_blank" href="https://www.youtube.com/watch?v=DVcUU3FiuMM" class="signin-button-link">' . tsmText::_('VMPAYMENT_KLIKANDPAY_DOCUMENTATION') . '</a></p>'; return $html; }
function renderMailLayout($doVendor, $recipient) { $tpl = tsmConfig::get('order_mail_html') ? 'mail_html_notify' : 'mail_raw_notify'; $this->doVendor = $doVendor; $this->fromPdf = false; $this->uselayout = $tpl; $this->subject = !empty($this->subject) ? $this->subject : tsmText::_('COM_VIRTUEMART_CART_NOTIFY_MAIL_SUBJECT'); $this->layoutName = $tpl; $this->setLayout($tpl); $this->isMail = true; $this->user = new stdClass(); $this->user->name = $this->vendor->vendor_store_name; $this->user->email = $this->vendorEmail; parent::display(); }
protected function getOptions() { tsmConfig::loadJLang('com_tsmart_orders', TRUE); $options = array(); $db = JFactory::getDBO(); $query = 'SELECT `order_status_code` AS value, `order_status_name` AS text FROM `#__tsmart_orderstates` WHERE `tsmart_vendor_id` = 1 ORDER BY `ordering` ASC '; $db->setQuery($query); $values = $db->loadObjectList(); foreach ($values as $value) { $options[] = JHtml::_('select.option', $value->value, tsmText::_($value->text)); } return $options; }
/** * @param $klikandpay_data * @param $order * @param $payments * @return mixed */ function getOrderHistory($klikandpay_data, $order, $payments) { $subscribe_comment = ''; $amountInCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $order['details']['BT']->order_currency); $order_history['comments'] = tsmText::sprintf('VMPAYMENT_KLIKANDPAY_PAYMENT_STATUS_CONFIRMED', $amountInCurrency['display'], $order['details']['BT']->order_number); $amountInCurrency = vmPSPlugin::getAmountInCurrency($klikandpay_data['MONTANTXKP'], $order['details']['BT']->order_currency); if (isset($klikandpay_data['PROCHAINE'])) { $subscribe_comment = tsmText::_('VMPAYMENT_KLIKANDPAY_RESPONSE_PROCHAINE') . ' ' . $klikandpay_data['PROCHAINE']; } $order_history['customer_notified'] = true; $order_history['comments'] .= $subscribe_comment; // At the moment, KP only sends a notification on a successful transaction // it does not send notification , if a payment is not done, or if a subscription is stopped from KP BO $order_history['order_status'] = $this->_method->status_success_subscribe; return $order_history; }