wxService = new WxService(); } // ali支付 public function payAli($order) { return $this->ok("appid=sadasdaasfmkasklan&sign=sdfsdjkgsdnsvmklsas"); } // 微信支付 public function payWechat($platform, $openid, $order_no, $order_amount, $description = "购买服务") { switch ($platform) { case "app": return $this->wxService->appPay($openid, $order_no, $description, $order_amount); case "web": return $this->wxService->webPay($openid, $order_no, $description, $order_amount); case "applet": return $this->wxService->appletPay($openid, $order_no, $description, $order_amount); } return $this->fail("支付方式错误!"); } public function refundByWx($platform, $order_no, $description, $order_amount, $refund_amount) { switch ($platform) { case "app": return $this->wxService->appRefund($order_no, $description, $order_amount, $refund_amount); case "web": return $this->wxService->webRefund($order_no, $description, $order_amount, $refund_amount); case "applet": return $this->wxService->appletRefund($order_no, $description, $order_amount, $refund_amount); } return $this->fail("支付方式错误!"); } public function refundByAli($order) { return $this->ok(true); } }