本文整理汇总了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);
}
}