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


PHP GetDefaultCurrency函数代码示例

本文整理汇总了PHP中GetDefaultCurrency函数的典型用法代码示例。如果您正苦于以下问题:PHP GetDefaultCurrency函数的具体用法?PHP GetDefaultCurrency怎么用?PHP GetDefaultCurrency使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: _ConstructPostData

    protected function _ConstructPostData($postData)
    {
        // PaymentExpress accepts payments in cents
        $ccname = $postData['name'];
        $cctype = $postData['cctype'];
        $ccissueno = $postData['ccissueno'];
        $ccissuedatem = $postData['ccissuedatem'];
        $ccissuedatey = $postData['ccissuedatey'];
        $ccnum = $postData['ccno'];
        $ccexpm = $postData['ccexpm'];
        $ccexpy = $postData['ccexpy'];
        $cccvd = $postData['cccvd'];
        $transactionid = $this->GetCombinedOrderId();
        $currency = GetDefaultCurrency();
        $xml = '<Txn>
						<PostUsername>' . $this->GetValue('username') . '</PostUsername>
						<PostPassword>' . $this->GetValue('merchantpassword') . '</PostPassword>
						<CardHolderName>' . $ccname . '</CardHolderName>
						<CardNumber>' . $ccnum . '</CardNumber>
						<Amount>' . number_format($this->GetGatewayAmount(), 2, '.', '') . '</Amount>
						<DateExpiry>' . $ccexpm . $ccexpy . '</DateExpiry>
						<Cvc2>' . $cccvd . '</Cvc2>
						<InputCurrency>' . $currency['currencycode'] . '</InputCurrency>
						<TxnType>Purchase</TxnType>
						<TxnId>' . $transactionid . '</TxnId>
						<MerchantReference>' . $transactionid . '</MerchantReference>
					</Txn>';
        return $xml;
    }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:29,代码来源:module.pxpost.php

示例2: IsSupported

 public function IsSupported()
 {
     $currency = GetDefaultCurrency();
     // Check if the default currency is supported by the payment gateway
     if (!in_array($currency['currencycode'], $this->_currenciesSupported)) {
         $currencies = '';
         if (count($this->_currenciesSupported) == 1) {
             $currencies = implode(',', $this->_currenciesSupported);
         } else {
             foreach ($this->_currenciesSupported as $currency) {
                 if ($currency == $this->_currenciesSupported[count($this->_currenciesSupported) - 1]) {
                     $currencies .= ' and ' . $currency;
                 } else {
                     $currencies .= $currency . ', ';
                 }
             }
         }
         $this->SetError(sprintf(GetLang($this->_languagePrefix . 'CurrecyNotSupported'), $currencies));
     }
     // Check if SSL is required and exists
     if ($this->RequiresSSL()) {
         if (!GetConfig('UseSSL')) {
             $this->SetError(GetLang($this->_languagePrefix . 'NoSSLError'));
         }
     }
     if ($this->_requiresCurl && !function_exists("curl_exec")) {
         $this->SetError(GetLang('CreditCardCurlRequired'));
     }
     if ($this->HasErrors()) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:34,代码来源:class.generic.creditcard.php

示例3: SendNotification

 /**
  * Send the order notification email
  */
 public function SendNotification()
 {
     $emails = array();
     $this->_message = $this->BuildEmailMessage();
     $this->_email = $this->GetValue("emailaddress");
     if (empty($this->_email)) {
         return;
     }
     $emails = preg_split('#[,\\s]+#si', $this->_email, -1, PREG_SPLIT_NO_EMPTY);
     // Create a new email object through which to send the email
     $store_name = GetConfig('StoreName');
     require_once ISC_BASE_PATH . "/lib/email.php";
     $obj_email = GetEmailClass();
     $obj_email->Set('CharSet', GetConfig('CharacterSet'));
     $obj_email->From(GetConfig('OrderEmail'), $store_name);
     $obj_email->Set("Subject", sprintf(GetLang('NEmailSubjectLine'), $this->GetOrderId(), $store_name, FormatPrice($this->GetOrderTotal(), false, true, false, GetDefaultCurrency())));
     $obj_email->AddBody("html", $this->_message);
     // Add all recipients
     foreach ($emails as $email) {
         $obj_email->AddRecipient($email, "", "h");
     }
     $email_result = $obj_email->Send();
     if ($email_result['success']) {
         $result = array("outcome" => "success", "message" => sprintf(GetLang('EmailNotificationSentUser'), implode("<br />", $emails)));
     } else {
         $result = array("outcome" => "fail", "message" => GetLang('NEmailSendingFailed'));
     }
     return $result;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:32,代码来源:module.email.php

示例4: initializeAdmin

	public function initializeAdmin()
	{
		$quantity = 1;

		if (isset($GLOBAL['var_orders'])) {
			$quantity = $GLOBAL['var_orders'];
		}

		// If we're using a cart quantity drop down, load that
		if (GetConfig('TagCartQuantityBoxes') == 'dropdown') {
			$GLOBALS['SelectId'] = "orders";
			$GLOBALS['Qty0'] = Interspire_Template::getInstance('admin')->render('Snippets/DiscountItemQtySelect.html');
		// Otherwise, load the textbox
		} else {
			$GLOBALS['SelectId'] = "orders";
			$GLOBALS['Qty0'] = Interspire_Template::getInstance('admin')->render('Snippets/DiscountItemQtyText.html');
		}

		if (!isset($GLOBALS['var_ps'])) {
			$GLOBALS['var_ps'] = GetLang('ChooseAProduct');
		}

		$currency = GetDefaultCurrency();
		if ($currency['currencystringposition'] == "LEFT") {
			$GLOBALS['CurrencyLeft'] = $currency['currencystring'];
		}
		else {
			$GLOBALS['CurrencyRight'] =  $currency['currencystring'];
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:module.xoffforrepeatcustomers.php

示例5: _ConstructPostData

 protected function _ConstructPostData($postData)
 {
     // Realex accepts payments in cents
     $ccname = $postData['name'];
     $cctype = strtolower($postData['cctype']);
     $ccissueno = $postData['ccissueno'];
     $ccissuedatem = $postData['ccissuedatem'];
     $ccissuedatey = $postData['ccissuedatey'];
     $ccnum = $postData['ccno'];
     $ccexpm = $postData['ccexpm'];
     $ccexpy = $postData['ccexpy'];
     $cccvd = $postData['cccvd'];
     $timestamp = strftime("%Y%m%d%H%M%S");
     $amount = number_format($this->GetGatewayAmount() * 100, 0, '', '');
     $account = $this->GetValue('account');
     $currency = GetDefaultCurrency();
     $currency = $currency['currencycode'];
     $orderid = $this->GetCombinedOrderId();
     $merchantid = $this->GetValue('merchantid');
     $merchantsecret = $this->GetValue('merchantsecret');
     $hash = sha1("{$timestamp}.{$merchantid}.{$orderid}.{$amount}.{$currency}.{$ccnum}");
     $hash = sha1("{$hash}.{$merchantsecret}");
     $order_desc = sprintf(GetLang('YourOrderFrom'), $GLOBALS['StoreName']);
     $xml = "<request type='auth' timestamp='{$timestamp}'>\n\t\t\t\t\t\t<merchantid>{$merchantid}</merchantid>";
     if (!empty($account)) {
         $xml .= "<account>{$account}</account>";
     }
     $xml .= "<orderid>{$orderid}</orderid>\n\t\t\t\t\t\t<amount currency='{$currency}'>{$amount}</amount>\n\t\t\t\t\t\t<card>\n\t\t\t\t\t\t\t<number>{$ccnum}</number>\n\t\t\t\t\t\t\t<expdate>{$ccexpm}{$ccexpy}</expdate>\n\t\t\t\t\t\t\t<type>{$cctype}</type>\n\t\t\t\t\t\t\t<chname>{$ccname}</chname>\n\t\t\t\t\t\t\t";
     if ($this->GetValue("cardcode") == "YES") {
         $xml .= "\t<cvn>\n\t\t\t\t\t\t\t\t<number>{$cccvd}</number>\n\t\t     \t\t\t\t\t<presind>1</presind>\n\t\t    \t\t\t\t</cvn>";
     }
     $xml .= "\t</card>\n\t\t\t\t\t\t<autosettle flag='1' />\n\t\t\t\t\t\t<sha1hash>{$hash}</sha1hash>\n\t\t\t\t\t</request>";
     return $xml;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:34,代码来源:module.realex.php

示例6: IsSupported

	public function IsSupported()
	{
		$currencycode = GetDefaultCurrency();
		$currencycode = $currencycode['currencycode'];

		if (!in_array($currencycode, $this->_currenciesSupported)) {
			$this->SetError(GetLang('AmazonFpsCurrecyNotSupported'));
		}

		if ($this->RequiresSSL()) {
			if(!GetConfig('UseSSL')) {
				$this->SetError(GetLang('AmazonFpsNoSSLError'));
			}
		}

		if(!function_exists("curl_exec")) {
			$this->SetError(GetLang('CreditCardCurlRequired'));
		}

		if($this->HasErrors()) {
			return false;
		}
		else {
			return true;
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:26,代码来源:module.amazonfps.php

示例7: BuildSmsMessage

		/**
		* Build and format the message to be sent
		*/
		private function BuildSmsMessage()
		{
			if($this->testMode == true) {
				return urlencode('SMSMessageTest');
			}
			else {
				$message = sprintf(GetLang('SMSMessageContents'), $this->_orderid, $GLOBALS['StoreName'], $this->_ordernumitems, FormatPrice($this->_ordertotal, false, true, false, GetDefaultCurrency()), $this->_orderpaymentmethod);
				return urlencode($message);
			}
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:13,代码来源:module.sms.php

示例8: initializeAdmin

	public function initializeAdmin()
	{
		$currency = GetDefaultCurrency();
		if ($currency['currencystringposition'] == "LEFT") {
			$GLOBALS['CurrencyLeft'] = $currency['currencystring'];
		}
		else {
			$GLOBALS['CurrencyRight'] =  $currency['currencystring'];
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:10,代码来源:module.freeshippingwhenoverx.php

示例9: GetDefaultCurrencyCode

 /**
  * Get the currency code of the default currency for the store
  *
  * @return void
  **/
 public function GetDefaultCurrencyCode()
 {
     static $code = '';
     if ($code != '') {
         return $code;
     }
     $defaultCurrency = GetDefaultCurrency();
     $code = $defaultCurrency['currencycode'];
     return $code;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:15,代码来源:module.googlecheckout.php

示例10: BuildMsnMessage

		/**
		* Build and format the message to be sent
		*/
		private function BuildMsnMessage()
		{
			if($this->testMode) {
				return GetLang('MSNMessageTest');
			}
			else {
				$store_name = GetConfig('StoreName');
				$message = sprintf(GetLang('MSNMessageContents'), $this->_orderid, $store_name, $this->_ordernumitems, FormatPrice($this->_ordertotal, false, true, false, GetDefaultCurrency()), $this->_orderpaymentmethod, $GLOBALS['ShopPath'], $this->_orderid);
				return str_replace("{NL}", chr(10), $message);
			}
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:14,代码来源:module.msn.php

示例11: _ConstructPostData

 protected function _ConstructPostData($postData)
 {
     $currency = GetDefaultCurrency();
     $currencycode = strtolower($currency['currencycode']);
     switch ($postData['cctype']) {
         case 'VISA':
             $cctype = '001';
             break;
         case 'MC':
             $cctype = '002';
             break;
         case 'AMEX':
             $cctype = '003';
             break;
         case 'DISCOVER':
             $cctype = '004';
             break;
         case 'DINERS':
             $cctype = '005';
             break;
         default:
             $cctype = '000';
             break;
     }
     $amount = $this->GetGatewayAmount();
     $billingDetails = $this->GetBillingDetails();
     $timestamp = getmicrotime();
     $transactionid = $this->GetCombinedOrderId();
     $signatureData = getMerchantID() . $amount . $currencycode . $timestamp . 'sale';
     $cybersourcePost['merchantID'] = getMerchantID();
     $cybersourcePost['billTo_firstName'] = htmlentities($billingDetails['ordbillfirstname']);
     $cybersourcePost['billTo_lastName'] = $billingDetails['ordbilllastname'];
     $cybersourcePost['billTo_street1'] = $billingDetails['ordbillstreet1'];
     $cybersourcePost['billTo_city'] = $billingDetails['ordbillsuburb'];
     $cybersourcePost['billTo_state'] = $billingDetails['ordbillstate'];
     $cybersourcePost['billTo_postalCode'] = $billingDetails['ordbillzip'];
     $cybersourcePost['billTo_country'] = $billingDetails['ordbillcountry'];
     $cybersourcePost['billTo_email'] = $billingDetails['ordbillemail'];
     $cybersourcePost['card_cardType'] = $cctype;
     $cybersourcePost['card_accountNumber'] = $postData['ccno'];
     $cybersourcePost['card_expirationMonth'] = $postData['ccexpm'];
     $cybersourcePost['card_expirationYear'] = '20' . $postData['ccexpy'];
     $cybersourcePost['orderPage_timestamp'] = $timestamp;
     $cybersourcePost['orderPage_signaturePublic'] = hopHash($signatureData, getPublicKey());
     $cybersourcePost['orderPage_serialNumber'] = getSerialNumber();
     $cybersourcePost['orderPage_version'] = '4';
     $cybersourcePost['orderPage_transactionType'] = 'sale';
     $cybersourcePost['amount'] = $amount;
     $cybersourcePost['currency'] = $currencycode;
     $cybersourcePost['hash'] = md5($this->GetValue("accessid") . $transactionid . $_COOKIE['SHOP_ORDER_TOKEN'] . $amount);
     $cybersourcePost['orderid'] = $transactionid;
     $cybersourcePost['iscsessionid'] = $_COOKIE['SHOP_ORDER_TOKEN'];
     return $cybersourcePost;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:54,代码来源:module.cybersource.php

示例12: IsSupported

 public function IsSupported()
 {
     $currencycode = GetDefaultCurrency();
     $currencycode = $currencycode['currencycode'];
     if (!in_array($currencycode, $this->_currenciesSupported)) {
         $this->SetError(GetLang($this->_languagePrefix . 'CurrecyNotSupported'));
     }
     if ($this->HasErrors()) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:13,代码来源:module.simplepay.php

示例13: IsSupported

 public function IsSupported()
 {
     $currency = GetDefaultCurrency();
     // Check if the default currency is supported by the payment gateway
     if (!in_array($currency['currencycode'], $this->_currenciesSupported)) {
         $this->SetError(sprintf(GetLang($this->_languagePrefix . 'CurrecyNotSupported'), implode(',', $this->_currenciesSupported)));
     }
     if ($this->HasErrors()) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:13,代码来源:module.payflowlinks.php

示例14: IsSupported

 /**
  * Check if this checkout module can be enabled or not.
  *
  * @return boolean True if this module is supported on this install, false if not.
  */
 public function IsSupported()
 {
     $currency = GetDefaultCurrency();
     $supportedCurrencies = array('USD', 'EUR', 'GBP', 'JPY', 'CAD', 'AUD', 'MXP');
     // Check if the default currency is supported by the payment gateway
     if (!in_array($currency['currencycode'], $supportedCurrencies)) {
         $this->SetError(sprintf(GetLang('PayPalExpressCurrecyNotSupported'), implode(',', $supportedCurrencies)));
     }
     if ($this->HasErrors()) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:19,代码来源:module.paypalexpress.php

示例15: TransferToProvider

	/**
	*	Redirect the customer to PayMate's site to enter their payment details
	*/
	public function TransferToProvider()
	{
		$payMateCurrency = '';
		$defaultCurrency = GetDefaultCurrency();

		if (isset($defaultCurrency['currencycode']) && trim($defaultCurrency['currencycode']) !== '') {
			$payMateCurrency = $defaultCurrency['currencycode'];
		}

		// Default the default currency code to AUD if we have none or if we have an unsupported one
		if ($payMateCurrency == '' || !$this->checkSupportedCurrencies($payMateCurrency)) {
			$payMateCurrency = 'AUD';
		}

		$payMateUsername = trim($this->GetValue("username"));

		if($this->GetValue("testmode") == "YES") {
			$payMateURL = sprintf("https://www.paymate.com.au/PayMate/TestExpressPayment?mid=%s", $payMateUsername);
		}
		else {
			$payMateURL = sprintf("https://www.paymate.com/PayMate/ExpressPayment?mid=%s", $payMateUsername);
		}

		$billingDetails = $this->GetBillingDetails();
		$hiddenFields = array(
			'currency'				=> $payMateCurrency,
			'amt'					=> $this->GetGatewayAmount(),
			'amt_editable'			=> 'N',
			'ref'					=> $_COOKIE['SHOP_ORDER_TOKEN'],
			'return'				=> $GLOBALS['ShopPathSSL'].'/finishorder.php',
			'popup'					=> 'false',

			// Customer details
			'pmt_contact_firstname'	=> $billingDetails['ordbillfirstname'],
			'pmt_contact_surname'	=> $billingDetails['ordbilllastname'],
			'pmt_sender_email'		=> $billingDetails['ordbillemail'],
			'pmt_contact_phone'		=> $billingDetails['ordbillphone'],
			'pmt_country'			=> GetCountryISO2ByName($billingDetails['ordbillcountry']),
			'regindi_address1'		=> $billingDetails['ordbillstreet1'],
			'regindi_address2'		=> $billingDetails['ordbillstreet2'],
			'regindi_pcode'			=> $billingDetails['ordbillzip'],
			'regindi_sub'			=> $billingDetails['ordbillsuburb'],
			'regindi_state'			=> $billingDetails['ordbillstate']
		);

		$this->RedirectToProvider($payMateURL, $hiddenFields);
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:50,代码来源:module.paymate.php


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