SetBody($productname); $input->SetAttach('test'); $input->SetOut_trade_no($order_no); $input->SetTotal_fee($money * 100); $input->SetTime_start(date('YmdHis')); $input->SetTime_expire(date('YmdHis', time() + 1600)); $input->SetGoods_tag('test'); $input->SetNotify_url($mymps_global['SiteUrl'] . '/include/payment/wxnative/notify.php'); $input->SetTrade_type('NATIVE'); $input->SetProduct_id('1'); $result = $notify->GetPayUrl($input); $url2 = $result['code_url']; if (!$url2) { exit('支付请求过程出错'); } $gourl = $mymps_global['SiteUrl'] . '/member/index.php?m=pay&ac=wxnative&qrcode=' . urlencode($url2) . '&fee=' . $money . '&order_no=' . $order_no . '&pdname=' . urlencode($productname); header("Location: {$gourl} "); function getOrderNo() { global $timestamp; return rand(11, 99) . $timestamp . rand(11, 99); }