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