public function SendOrderNotifyToShops($orderid) { $orderid = "285"; $wxm = new WxNotify(); $result = $wxm->SendOrderNotifyToShops($orderid); echo $result; }
public function testc() { // $type=92; // $form_openid='oKxDRvyD0gFYNwby4lh7kGrOUcM8'; // // $shengyuprizenum=50; // $mkjp=D('M/Kanjia'); // $ZhongPara= $mkjp->GetZhongJ($type); // // // // echo $ZhongPara; $openid = "olAupxKj09dfzPwt91YeQTDwIjCY"; $wxm = new WxNotify(); $result = $wxm->KJNotify($form['nickname'], $openid, '', '10元话费'); echo $result; // //开启事务 // M()->startTrans(); // //保存帮砍信息 // // $add_ZhongParaStatus=TRUE; // $save_kanjiaparastatus=TRUE; // if($add_money==$shengyumoney){ // $add_ZhongParaStatus=M('kanzhong')->add($ZhongPara); // $save_kanjiaparastatus=M('kanjia_para')->where(array('kjcode'=>$type))->setField('shengyuprizenum',$shengyuprizenum-1); // } // // // // if( $add_ZhongParaStatus && $save_kanjiaparastatus){ // M()->commit(); // echo "aaaaaaaaaaaaaa"; // } // else{ // M()->rollback(); // echo "EEEEEEEEEEEE"; // } }
public function PayNotify($parameter) { $payres = array("status" => -1); $orderNo = $parameter['OrderNo']; $transaction_id = $parameter['transaction_id']; $fee_type = 'RMB'; //货币类型 $mMPay = D('M/MemberPay'); $dataInfo = $mMPay->GetByPayNo($orderNo); if ($dataInfo && $dataInfo["PayType"] == "recharge" && $dataInfo["Status"] == 0) { $dataInfo["ChangeTime"] = date('Y-m-d H:i:s'); $dataInfo["result_code"] = $result_code . ''; $dataInfo["fee_type"] = $fee_type . ''; $dataInfo["transaction_id"] = $transaction_id . ''; $dataInfo["cash_fee"] = $cash_fee . ''; $dataInfo["Status"] = 99; $cardid = $dataInfo["cardid"]; $result = $mMPay->UpdateRechange($dataInfo, $cardid); if ($result["status"] == 1) { $payres["status"] = 1; } } else { if ($dataInfo && $dataInfo["PayType"] == "order" && $dataInfo["Status"] == 0) { $dataInfo["ChangeTime"] = date('Y-m-d H:i:s'); $dataInfo["result_code"] = $result_code . ''; $dataInfo["fee_type"] = $fee_type . ''; $dataInfo["transaction_id"] = $transaction_id . ''; $dataInfo["cash_fee"] = $cash_fee . ''; $dataInfo["Status"] = 99; $tfee = $dataInfo['amount']; $accountmoney = $dataInfo['accountmoney']; $accountscore = $dataInfo['accountscore']; //扣余额 $orderid = $dataInfo["extendid"]; if ($accountmoney > 0 || $accountscore > 0) { $cardid = $dataInfo["cardid"]; $res = $mMPay->OrderValuePay($dataInfo, $cardid); //更新订单状态 if ($res["status"] == 0) { $wxm = new WxNotify(); $wxm->SendOrderNotifyToShops($orderid); $payres["status"] = 1; } } else { $cardid = $dataInfo["cardid"]; $result = $mMPay->UpdatePayOrder($dataInfo); if ($result["status"] == 1) { $wxm = new WxNotify(); $wxm->SendOrderNotifyToShops($orderid); $payres["status"] = 1; } } } else { if ($dataInfo && $dataInfo["Status"] == 99) { $payres["status"] = 1; } else { $content = "-----------------未处理的对象-----------------"; $content = $content . "orderNo={$orderNo}===支付宝交易号={$transaction_id}"; logger($content); $payres["status"] = 1; } } } return $payres; }