unifiedOrderByOrderIdForSao($params); return $return; } /** * Des:取消订单 * Name: cancel * @param $params array order_id:订单ID name:订单名称 total_fee:总金额-元 refund_fee退款金额 * @param int $type 3、微信 4、支付宝 * @return array * @author 倪宗锋 */ public static function cancel($params, $type) { if ($type == 3) {//微信支付 $pay = new WeChatPay(); $return = $pay->cancelOrder($params); } else {//阿里支付 $pay = new AliPay(); $return = $pay->cancelOrder($params); } return $return; } /** * Des: 直接付款 * Name: pay * @param $params array * $order_id string 订单表 订单ID * $name string 产品名称 * $total_fee int 总金额 单位元 * $openid string 用户opendid * @param $type 1微信 2支付宝 * * @return array * @author 倪宗锋 */ public static function pay($params,$type = 1) { if($type == 1) { $pay = new WeChatPay();//微信支付类 }else { $pay = new AliPay();//支付宝支付类 } $return = $pay->webPay($params); return $return['data']['payData']; } /** * Des: 支付 目前只支持微信直接支付 * Name: pay * @param $orderId string 订单ID * * @return array * @author 倪宗锋 */ public static function checkIsPay($orderId) { $pay = new WeChatPay(); $return = $pay->checkIsPay($orderId); return $return; } }