[ 'enable' => true, 'file' => root_path('runtime') . 'paylog' . DIRECTORY_SEPARATOR . date('Ym') . DIRECTORY_SEPARATOR . date('d') . '.log', 'level' => env('app_debug') ? 'debug' : 'info', // 建议生产环境等级调整为 info,开发环境为 debug 'type' => 'single', // optional, 可选 daily. 'max_file' => 30, // optional, 当 type 为 daily 时有效,默认 30 天 ], 'http' => [ // optional 'timeout' => 5.0, ] ], [ $type => [ 'default' => $config ] ] ); } public function returnFormat($param) { if ($param instanceof MessageInterface) { $return_value = $param->getBody()->getContents(); } else if ($param instanceof Collection) { $return_value = $param->all(); } else { $return_value = $param; } if(isset($return_value['code'])){ throw new PayException($return_value['message']); } return $return_value; } /** * 解析退款返回数据并解析 * @param $our_trade_no * @param $refund_no * @param $status * @param int $success_time * @param string $reason * @return array */ public function getRefundData($our_trade_no, $refund_no, $status, $success_time = 0, $reason = '') { return [ 'our_trade_no' => $our_trade_no, 'refund_no' => $refund_no, 'status' => $status, 'success_time' => $success_time, 'reason' => $reason ]; } /** * 获取转账数据并解析 * @param $transfer_no * @param $status * @param $reason * @return void */ public function getTransferData($transfer_no, $status, $reason) { } }