Example #1
0
 public function unifiedorder($openId, $product_id)
 {
     $input = new WxPayUnifiedOrder();
     $input->SetBody("test");
     $input->SetAttach("test");
     $input->SetOut_trade_no(WxPayConfig::MCHID . date("YmdHis"));
     $input->SetTotal_fee("1");
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 600));
     $input->SetGoods_tag("test");
     //donot support ?r=xxx?
     //$payNotifyUrl = "http://wosotech.com/wx/web/index.php?r=wap/paynotify";
     $payNotifyUrl = "http://wosotech.com/wx/web/wxpaynotify.php";
     $input->SetNotify_url($payNotifyUrl);
     //$input->SetNotify_url(urlencode($payNotifyUrl));
     //$input->SetNotify_url("http://wosotech.com/wx/models/wxpay/wxpay_sdk/example/notify.php");
     $input->SetTrade_type("NATIVE");
     $input->SetOpenid($openId);
     $input->SetProduct_id($product_id);
     $result = WxPayApi::unifiedOrder($input);
     return $result;
 }