NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
``` public function wx_pay($attach){ require_once "../extend/WxPay/lib/WxPay.Api.php"; require_once "../extend/WxPay/example/WxPay.NativePay.php"; $notify = new \NativePay(); $input = new \WxPayUnifiedOrder(); $input->SetBody("卡密"); $input->SetOut_trade_no($attach['order_id']); $input->SetTotal_fee($attach['fee']*100); $input->SetTime_start(date("YmdHis")); $input->SetTime_expire(date("YmdHis", time() + 3600)); $input->SetNotify_url("http://test.qingdabao.com/pay/notify_url"); $input->SetTrade_type("NATIVE"); $input->SetProduct_id($attach['goods_id']); $result = $notify->GetPayUrl($input); $url = $result["code_url"]; $shops=new Shops(); $url=$shops->wx_code($url); return $url; } ```