config = $config; } /** * 通知 */ public function notify() { } /** * 获取统一下单的基本信息 */ public function order($account_id, $project_id, $uid, $username, $product_id, $name, $cash, $openid = false, $type = 1, $order_id = false) { $order_id = $this->createOrder($uid, $username, $account_id, $project_id, $product_id, $name, $cash, $this->config['type'], $order_id); return $order_id; } /** * 获取二维码支付 */ public function qrcode($order, $refer) { return $order; } /** * 获取小程序支付 */ public function applet($order) { return $order; } /** * 获取页面支付 */ public function page($order, $refer) { return $order; } # 退款 public function refund($order_id, $cash) { $out_trade_no = $order_id; $cash = $cash * 100; $total_fee = $cash; $refund_fee = $cash; $input = new \WxPayRefund(); $input->SetOut_trade_no($out_trade_no); $input->SetTotal_fee($total_fee); $input->SetRefund_fee($refund_fee); $input->SetOut_refund_no($out_trade_no . '_' . time()); $input->SetOp_user_id($this->config->GetMerchantId()); $result = \WxPayApi::refund($this->config, $input); return $result; } }