当前位置: 首页>>代码示例>>PHP>>正文


PHP vRequest::getFloat方法代码示例

本文整理汇总了PHP中vRequest::getFloat方法的典型用法代码示例。如果您正苦于以下问题:PHP vRequest::getFloat方法的具体用法?PHP vRequest::getFloat怎么用?PHP vRequest::getFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vRequest的用法示例。


在下文中一共展示了vRequest::getFloat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: languagepack

 /**
  * @return null
  * @throws KlarnaApiException
  */
 public function languagepack()
 {
     $sSubAction = vRequest::getWord('subAction');
     if (!isset($this->template['name']) || $this->template['name'] == '') {
         $this->template['name'] = "default";
     }
     if ($sSubAction == "klarna_box") {
         $sNewISO = vRequest::getWord('newIso');
         $sCountry = vRequest::getWord('country');
         $iSum = vRequest::getFloat('sum', 0);
         $iInvoiceFee = vRequest::getFloat('fee', 0);
         $iFlag = vRequest::getInt('flag');
         $sType = vRequest::getWord('type');
         $aParams = vRequest::getVar('params');
         $aValues = vRequest::getVar('values');
         // foreach($aValues as $key => $value) {
         // $aValues[$key] = utf8_encode($value);
         // }
         // foreach($aParams as $key => $value) {
         // $aParams[$key] = utf8_decode($value);
         // }
         if ($sType != "part" && $sType != "invoice" && $sType != "spec") {
             throw new KlarnaApiException("Invalid parameters");
         }
         $this->api->setCountry($sCountry);
         if ($sType == 'spec') {
             $types = array(KlarnaPClass::SPECIAL);
         } else {
             $types = array(KlarnaPClass::CAMPAIGN, KlarnaPClass::ACCOUNT, KlarnaPClass::FIXED);
         }
         $oApi = new KlarnaAPI($sCountry, $sNewISO, $sType, $iSum, $iFlag, $this->api, $types, VMKLARNAPLUGINWEBROOT);
         // $oApi->addSetupValue ('web_root', $this->webroot);
         // $oApi->setPaths ();
         $oApi->addSetupValue('eid', $this->eid);
         if ($sType == 'invoice') {
             $oApi->setInvoiceFee($iInvoiceFee);
         }
         $oApi->setCurrency($this->api->getCurrency());
         if (count($this->coSetup) > 0) {
             $oApi->addMultipleSetupValues($this->coSetup);
         }
         return $oApi->retrieveLayout($aParams, $aValues);
         // if ($sType == 'spec') {
         // return $oApi->retrieveHTML($aParams, $aValues, null, $this->template);
         // } else {
         // return $oApi->retrieveHTML ($aParams, $aValues);
         // }
     } else {
         if ($sSubAction == 'jsLanguagePack') {
             $sNewISO = vRequest::getWord('newIso');
             $sFetch = "";
         } else {
             throw new KlarnaApiException("Invalid sub-action");
         }
     }
 }
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:60,代码来源:klarna_ajax.php

示例2: plgVmOnSelfCallBE

 function plgVmOnSelfCallBE($type, $name, &$render)
 {
     if ($name != $this->_name || $type != 'vmpayment') {
         return FALSE;
     }
     $virtuemart_paymentmethod_id = vRequest::getInt('virtuemart_paymentmethod_id');
     //Load the method
     if (!($this->_currentMethod = $this->getVmPluginMethod($virtuemart_paymentmethod_id))) {
         return NULL;
         // Another method was selected, do nothing
     }
     $amount = vRequest::getFloat('amount');
     $actions = array('rebatePayment', 'settlePayment');
     $action = vRequest::getCmd('action');
     if (!in_array($action, $actions)) {
         vmError('VMPAYMENT_REALEX_HPP_API_UPDATEPAYMENT_UNKNOWN_ACTION');
         return NULL;
     }
     $virtuemart_order_id = vRequest::getInt('virtuemart_order_id');
     if (!($payments = $this->getDatasByOrderId($virtuemart_order_id))) {
         return null;
     }
     $orderModel = VmModel::getModel('orders');
     $orderData = $orderModel->getOrder(vRequest::getInt('virtuemart_order_id'));
     $requestSent = false;
     $order_history_comment = '';
     $realexInterface = $this->_loadRealexInterface();
     $canDo = true;
     if ($action == 'settlePayment') {
         $requestSent = true;
         $order_history_comment = vmText::_('VMPAYMENT_REALEX_HPP_API_UPDATE_STATUS_CAPTURE');
         $realexInterface->setOrder($orderData);
         $realexInterface->setPaymentCurrency();
         $realexInterface->setTotalInPaymentCurrency($amount);
         $realexInterface->loadCustomerData();
         $response = $realexInterface->settleTransaction($payments);
     } elseif ($action == 'rebatePayment') {
         $requestSent = true;
         $response = $this->doRebate($realexInterface, $orderData, $payments, $amount);
     }
     if ($requestSent) {
         if ($response) {
             $db_values = $this->_storeRealexInternalData($response, $this->_currentMethod->virtuemart_paymentmethod_id, $orderData['details']['BT']->virtuemart_order_id, $orderData['details']['BT']->order_number, $realexInterface->request_type);
             $xml_response = simplexml_load_string($response);
             $success = $realexInterface->isResponseSuccess($xml_response);
             if (!$success) {
                 $error = $xml_response->message . " (" . (string) $xml_response->result . ")";
                 $realexInterface->displayError($error);
             } else {
                 $order_history = array();
                 $order_history['comments'] = $order_history_comment;
                 $order_history['customer_notified'] = false;
                 $order_history['order_status'] = $orderData['details']['BT']->order_status;
                 $modelOrder = VmModel::getModel('orders');
                 $modelOrder->updateStatusForOneOrder($orderData['details']['BT']->virtuemart_order_id, $order_history, false);
             }
         } else {
             vmError('VMPAYMENT_REALEX_HPP_API_NO_RESPONSE');
         }
     }
     $app = JFactory::getApplication();
     $link = 'index.php?option=com_virtuemart&view=orders&task=edit&virtuemart_order_id=' . $virtuemart_order_id;
     $app->redirect(JRoute::_($link, FALSE));
 }
开发者ID:virtuemart-fr,项目名称:virtuemart-fr,代码行数:64,代码来源:realex_hpp_api.php

示例3: plgVmOnSelfCallBE

	function plgVmOnSelfCallBE ($type, $name, &$render) {
		if ($name != $this->_name || $type != 'vmpayment') {
			return FALSE;
		}
		$action = vRequest::getCmd('action');
		$virtuemart_paymentmethod_id = vRequest::getInt('virtuemart_paymentmethod_id');
		//Load the method
		if (!($this->_currentMethod = $this->getVmPluginMethod($virtuemart_paymentmethod_id))) {
			return NULL; // Another method was selected, do nothing
		}
		$virtuemart_order_id = vRequest::getInt('virtuemart_order_id');
		if (!($payments = $this->getDatasByOrderId($virtuemart_order_id))) {
			return null;
		}
		$orderModel = VmModel::getModel('orders');
		$order = $orderModel->getOrder($virtuemart_order_id);
		$this->_order_number = $this->getUniqueReferenceId($order['details']['BT']->order_number);
		$this->_amount = vRequest::getFloat('amount');

		switch ($action) {
			case 'refundPayment':
				if ($this->canDoRefund($payments, $order)) {
					$this->refundPayment($payments, $order);
				}
				break;
			case 'capturePayment':

				if ($authorizationId = $this->canDoCapture($payments, $order)) {
					// may be we did a new authorization in case of partial capture
					$this->capturePayment($payments, $order);
				}
				break;
			case 'newAuthorization':

				if ($this->canDoAuthorization($payments, $order)) {
					$this->getAuthorization($this->getOffAmazonPaymentsService_Client(), NULL, $order, false);
				}
				break;
			default:
				vmError('VMPAYMENT_AMAZON_UPDATEPAYMENT_UNKNOWN_ACTION');
		}
		$app = JFactory::getApplication();
		$link = 'index.php?option=com_virtuemart&view=orders&task=edit&virtuemart_order_id=' . $virtuemart_order_id;

		$app->redirect(JRoute::_($link, FALSE));

	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:47,代码来源:amazon.php


注:本文中的vRequest::getFloat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。