$this->mall_id]); $service->agentBySplitBillLogId(105); } catch (\Exception $e) { dd($e); } } /** * 代付 * * @return void */ public function actionAgent() { $service = new YunPayService(['mall_id' => $this->mall_id]); $agent = new AgentTrans( date('YmdHis') . rand(100, 999), 0.01, '6227003172460193052', '杨金城', '测试' ); $service->sendPayRq($agent); } /** * 签约链接 * * @return void */ public function actionSign() { $service = new YunPayService(['mall_id' => $this->mall_id]); $url = $service->getSignUrl(); dd($url); } public function actionScan() { $service = new YunPayService(['mall_id' => $this->mall_id]); $service->scanUrl(); } public function actionCashier() { $id = 51; $order = StoreCashierOrder::findOne($id); // 触发门店收银台订单结算事件 $event = new CashierOrderSettledEvent($this->mall_id); $order_data['order_no'] = $order['order_no']; $order_data['amount_received'] = 0.9; $order_data['user_id'] = $order['user_id']; $order_data['store_id'] = $order['store_id']; $order_data['mall_id'] = $order['mall_id']; $order_data['type'] = 2; //类型:1:o2o订单;2:o2o收银台订单 Yii::$app->services->events->dispatch($event, $order_data, $event->listeners); } public function actionNotify() { $json = << $this->mall_id]); // $service = new NotifyService(['mall_id' => $this->mall_id]); $service->notify($data); } public function actionRefund() { // $json = << $this->mall_id]); $service->notify($data); } public function actionLog() { $service = new NotifyService(['mall_id' => $this->mall_id]); $service->addFileLog('123', '123', [123]); } public function actionHai() { $event = new CashierOrderPaidEvent($this->mall_id); $order['id'] = 302; $order['operator_id'] = 0; $order['operator_name'] = ''; Yii::$app->services->events->dispatch($event, $order, $event->listeners); } public function actionC() { $id = 51; $order = StoreCashierOrder::findOne($id); // 触发门店收银台订单结算事件 $order_data['order_no'] = $order['order_no']; $order_data['amount_received'] = 0.9; $order_data['user_id'] = $order['user_id']; $order_data['store_id'] = $order['store_id']; $order_data['mall_id'] = $order['mall_id']; $order_data['type'] = 2; //类型:1:o2o订单;2:o2o收银台订单 (new SplitBillService(['mall_id' => $order['mall_id']]))->divide($order_data); } }