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


PHP SimpleXMLElement::Error方法代码示例

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


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

示例1: TransferToProvider

	public function TransferToProvider()
	{
		$currency = GetDefaultCurrency();
		$currencyCode = $currency['currencycode'];

		$orders = $this->GetOrders();
		list(,$order) = each($orders);

		$amount = number_format($this->GetGatewayAmount(), '2');

		$billingDetails = $this->GetBillingDetails();

		$invoiceDescription = '';
		$quote = getCustomerQuote();
		foreach ($quote->getItems() as /** @var ISC_QUOTE_ITEM */$item){
			if ($invoiceDescription) {
				$invoiceDescription .= ", ";
			}

			$invoiceDescription .= $item->getQuantity() . 'x ' . $item->getName();
		}

		$data = array(
			'CustomerID'		=> $this->GetValue('customerid'),
			'UserName'			=> $this->GetValue('username'),
			'Currency'			=> $currencyCode,
			'Amount'			=> $amount,
			'ReturnURL'			=> $GLOBALS['ShopPath'] . '/finishorder.php',
			'CancelURL'			=> $GLOBALS['ShopPath'] . '/finishorder.php',
			'CompanyName'		=> GetConfig('CompanyName'),

			'CustomerFirstName'	=> $billingDetails['ordbillfirstname'],
			'CustomerLastName'	=> $billingDetails['ordbilllastname'],
			'CustomerAddress'	=> $billingDetails['ordbillstreet1'] . ' ' . $billingDetails['ordbillstreet2'],
			'CustomerCity'		=> $billingDetails['ordbillsuburb'],
			'CustomerState'		=> $billingDetails['ordbillstate'],
			'CustomerPostCode'	=> $billingDetails['ordbillzip'],
			'CustomerCountry'	=> $billingDetails['ordbillcountry'],
			'CustomerPhone'		=> $billingDetails['ordbillphone'],
			'CustomerEmail'		=> $billingDetails['ordbillemail'],

			'InvoiceDescription'=> $invoiceDescription,
			'MerchantReference' => $this->GetCombinedOrderId(),
		);

		$ewayUrl = $this->_ewayURL . 'Request?';
		$ewayUrl .= http_build_query($data);

		$response = PostToRemoteFileAndGetResponse($ewayUrl);

		if (empty($response)) {
			$this->logInvalidResponse($response, true);
		}

		try {
			$xml = new SimpleXMLElement($response);
		}
		catch (Exception $ex) {
			$this->logInvalidResponse($response, true);
		}

		if ((string)$xml->Result == 'True') {
			$transferUri = (string)$xml->URI;
			$this->RedirectToProvider($transferUri);
		}
		else {
			$this->logInvalidResponse((string)$xml->Error(), true);
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:69,代码来源:class.eway.hosted.php


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