本文整理匯總了PHP中Xml::toSimpleXml方法的典型用法代碼示例。如果您正苦於以下問題:PHP Xml::toSimpleXml方法的具體用法?PHP Xml::toSimpleXml怎麽用?PHP Xml::toSimpleXml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Xml
的用法示例。
在下文中一共展示了Xml::toSimpleXml方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sendRedPack
public function sendRedPack($data)
{
$data['mch_billno'] = time();
$data['mch_id'] = c('weixin.mch_id');
$data['wxappid'] = c('weixin.appid');
$data['total_num'] = "1";
//紅包發放總人數
$data['client_ip'] = Request::ip();
$data['nonce_str'] = $this->getRandStr(16);
$data['sign'] = $this->makeSign($data);
$xml = Xml::toSimpleXml($data);
$res = $this->curl_post_ssl("https://api.mch.weixin.qq.com/mmpaymkttransfers/sendredpack", $xml);
return Xml::toSimpleArray($res);
}
示例2: unifiedorder
protected function unifiedorder($data)
{
$data['appid'] = c('weixin.appid');
$data['mch_id'] = c('weixin.mch_id');
$data['notify_url'] = c('weixin.notify_url');
$data['nonce_str'] = $this->getRandStr(16);
$data['trade_type'] = 'JSAPI';
$data['openid'] = Weixin::instance('oauth')->snsapiBase();
$data['sign'] = $this->makeSign($data);
$xml = Xml::toSimpleXml($data);
$res = Curl::post("https://api.mch.weixin.qq.com/pay/unifiedorder", $xml);
return Xml::toSimpleArray($res);
}