本文整理汇总了PHP中Lib::array2xml方法的典型用法代码示例。如果您正苦于以下问题:PHP Lib::array2xml方法的具体用法?PHP Lib::array2xml怎么用?PHP Lib::array2xml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lib
的用法示例。
在下文中一共展示了Lib::array2xml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$paymentModel->attempt++;
$paymentModel->save();
$saveOrderModel->status = 'error';
$saveOrderModel->save(false);
continue;
}
$xmlArray = array('request' => array('action' => '', 'meta' => array('merchantid' => '7760', 'ipaddress' => $_SERVER['SERVER_ADDR'], 'version' => '2.0')));
$ExternalData = new ExternalData();
$xmlArray['request']['action'] = 'INSERT_ORDERWITHPAYMENT';
$payment = array('paymentproductid' => $paymentMethod, 'amount' => $amount * 100, 'currencycode' => $paymentModel->currency, 'countrycode' => strtoupper($orderModel->country_id), 'languagecode' => $r1['lang_id'], 'returnurl' => $gcOptions['returnUrl'], 'PROFILETOKEN' => $PROFILETOKEN, 'MANDATE' => 'PRESENT');
foreach ($gcPaymentArray as $key => $value) {
$payment[$key] = $value;
}
$params = array('order' => array('orderid' => $orderModel->order_id, 'amount' => $amount * 100, 'currencycode' => $paymentModel->currency, 'ipaddresscustomer' => $_SERVER['REMOTE_ADDR'], 'countrycode' => strtoupper($orderModel->country_id), 'languagecode' => $r1['lang_id'], 'merchantreference' => 'P' . $orderModel->order_id, 'firstname' => $orderModel->fname, 'surname' => $orderModel->lname, 'street' => $orderModel->address1, 'city' => $orderModel->city, 'zip' => $orderModel->zip, 'state' => $r1['state_name'] ? $r1['state_name'] : $orderModel->state_id, 'email' => $orderModel->email, 'descriptor' => $mainProduct->product_name, 'MANDATE' => 'PRESENT'), 'payment' => $payment);
$xmlArray['request']['params'] = $params;
$xml = Lib::array2xml($xmlArray);
$answer = $ExternalData->getData($gcOptions['curlUrl'], $xml);
$answerXml = simplexml_load_string($answer);
if (false) {
header("Content-type:text/xml; charset=utf-8");
echo $answer;
die;
}
if ($RESPONSE->RESULT != 'OK') {
$paymentModel->attempt++;
$paymentModel->save();
$saveOrderModel->status = 'error';
$saveOrderModel->save(false);
continue;
}
$STATUSID = $RESPONSE->STATUS->STATUSID;