config('site.user_appid'), 'secret' => config('site.user_appsecret'), // 下面为可选项 // 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名 'response_type' => 'array', 'log' => [ 'level' => 'debug', 'file' => RUNTIME_PATH . '/wechat_user.log', ], ]; }else{ $config = [ 'app_id' => config('site.sender_appid'), 'secret' => config('site.sender_appserret'), // 下面为可选项 // 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名 'response_type' => 'array', 'log' => [ 'level' => 'debug', 'file' => RUNTIME_PATH . '/wechat_sender.log', ], ]; } $app[$client]=Factory::miniProgram($config); } return $app[$client]; } public static function payment($client='user'){ static $app=[]; if(!isset($app[$client])) { $config = [ 'app_id' => config('site.user_appid'), 'secret' => config('site.user_appsecret'), // 下面为可选项 // 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名 'response_type' => 'array', 'log' => [ 'level' => 'debug', 'file' => RUNTIME_PATH . '/wechat_user.log', ], ]; $app[$client]=Factory::payment($config); } return $app[$client]; } }