unifiedOrderByOrderIdForSao($params); return $return; } /** * Des:取消订单 * Name: cancel * @param $params array order_id:订单ID name:订单名称 total_fee:总金额-元 refund_fee退款金额 * @param int $type * @return array * @author 倪宗锋 */ public static function cancel($params, $type = 1) { /****微信支付****/ if ($type == 1) { $pay = new WeChatPay(); } elseif ($type == 2) { /****阿里支付****/ $pay = new AliPay(); } else { $pay = new FxAmount(); } $return = $pay->cancelOrder($params); return $return; } /** * Des: 直接付款 * Name: pay * @param $params array * $order_id string 订单表 订单ID * $name string 产品名称 * $total_fee int 总金额 单位元 * $openid string 用户opendid * $type 1微信 2支付宝 * * @return array * @author 倪宗锋 */ public static function pay($params,$type = 1) { if($type == 1) { $pay = new WeChatPay(); $return = $pay->unifiedOrderByOrderIdForWeChat($params); }else { $pay = new AliPay(); $return = $pay->webPay($params); } // include ROOT_PATH.'/common/util/WeChatHtml.php'; 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; } }