{"action":"created","issue":{"url":"https://api.github.com/repos/ytorbyk/magento2-geo-ip2/issues/6","repository_url":"https://api.github.com/repos/ytorbyk/magento2-geo-ip2","labels_url":"https://api.github.com/repos/ytorbyk/magento2-geo-ip2/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/ytorbyk/magento2-geo-ip2/issues/6/comments","events_url":"https://api.github.com/repos/ytorbyk/magento2-geo-ip2/issues/6/events","html_url":"https://github.com/ytorbyk/magento2-geo-ip2/issues/6","id":347986776,"node_id":"MDU6SXNzdWUzNDc5ODY3NzY=","number":6,"title":"How to use this extension with GeoIP2 WebService?","user":{"login":"Vikram0811","id":4048181,"node_id":"MDQ6VXNlcjQwNDgxODE=","avatar_url":"https://avatars1.githubusercontent.com/u/4048181?v=4","gravatar_id":"","url":"https://api.github.com/users/Vikram0811","html_url":"https://github.com/Vikram0811","followers_url":"https://api.github.com/users/Vikram0811/followers","following_url":"https://api.github.com/users/Vikram0811/following{/other_user}","gists_url":"https://api.github.com/users/Vikram0811/gists{/gist_id}","starred_url":"https://api.github.com/users/Vikram0811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vikram0811/subscriptions","organizations_url":"https://api.github.com/users/Vikram0811/orgs","repos_url":"https://api.github.com/users/Vikram0811/repos","events_url":"https://api.github.com/users/Vikram0811/events{/privacy}","received_events_url":"https://api.github.com/users/Vikram0811/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-06T16:06:53Z","updated_at":"2018-08-08T18:53:47Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI have configured below details in as per my maxmind account. I am using web services client in order to fetch location(country/state/city) based on IP\r\n\r\n- UserID - maxmind account userid\r\n- License Key - maxmind account license key\r\n- Host - geoip.maxmind.com\r\n\r\nI am referring your WebService example in User Guide. Below is the code in my simple GeoIP module controller. It is not giving me any output when I run the code\r\n\r\n```\r\n<?php\r\n\r\nnamespace Namespace\\Modulename\\Controller\\Index;\r\n\r\nuse Magento\\Framework\\App\\Action\\Context;\r\nuse Magento\\Framework\\View\\Result\\PageFactory;\r\nuse Tobai\\GeoIp2\\Model\\WebService\\ClientFactory;\r\n\r\nclass Index extends \\Magento\\Framework\\App\\Action\\Action\r\n{\r\n\r\n    protected $resultPageFactory;\r\n    protected $clientFactory;\r\n  \r\n    public function __construct(Context $context, PageFactory $pageFactory, ClientFactory $clientFactory)\r\n    {\r\n        $this->clientFactory = $clientFactory;\r\n        $this->resultPageFactory = $pageFactory;\r\n        parent::__construct($context);\r\n    }\r\n\t\r\n    public function execute()\r\n    {\r\n\t\t\r\n        $client = $this->clientFactory->create();\r\n\t$record = $client->city('128.101.101.101');\r\n\tprint($record->country->isoCode . \"\\n\"); \r\n\tprint($record->country->name . \"\\n\"); \r\n\tprint($record->country->names['zh-CN'] . \"\\n\");\r\n\tprint($record->mostSpecificSubdivision->name . \"\\n\");\r\n\tprint($record->mostSpecificSubdivision->isoCode . \"\\n\");\r\n\tprint($record->city->name . \"\\n\"); \r\n\tprint($record->postal->code . \"\\n\"); \r\n\tprint($record->location->latitude . \"\\n\"); \r\n\tprint($record->location->longitude . \"\\n\");\r\n        \r\n    }\r\n    \r\n}\r\n```\r\n\r\nI even tried declaring API settings as below but it do not seem to work\r\n\r\n```\r\n$configs = array(\r\n'userId' => 'MyUserID',\r\n'licenseKey' => 'MylicesneKey',\r\n'host' => 'geoip.maxmind.com'\r\n);\r\n$client = $this->clientFactory->create($configs);\r\n```\r\n\r\nIn the file Tobai/GeoIp2/Model/WebService/ClientFactory.php, when I print $client, it returns nothing\r\n\r\n```\r\npublic function create(array $data = [])\r\n    {\r\n        if (isset($data['options']) && is_string($data['options'])) {\r\n            $data['options'] = ['host' => $data['options']];\r\n        } elseif (empty($data['options'])) {\r\n            $data['options'] = [];\r\n        }\r\n\r\n        $userId = !empty($data['userId']) ? $data['userId'] : $this->config->getUserId();\r\n        $licenseKey = !empty($data['licenseKey']) ? $data['licenseKey'] : $this->config->getLicenseKey();\r\n        $locales = !empty($data['locales']) ? $data['locales'] : ['en'];\r\n        $options = $data['options'] + ['host' => $this->config->getHost()];\r\n\r\n        $client = new \\GeoIp2\\WebService\\Client($userId, $licenseKey, $locales, $options);\r\n        return $client;\r\n    }\r\n```\r\n\r\nOn further inspection, it throws below exception\r\n\r\n`Fatal error: Uncaught Error: Class 'GeoIp2\\WebService\\Client' not found in /Tobai/GeoIp2/Model/WebService/ClientFactory.php:46 `\r\n\r\nThe document says\r\n\r\n**To use this API, you must create a new \\GeoIp2\\WebService\\Client object with your $accountId and $licenseKey, then you call the method corresponding to a specific end point, passing it the IP address you want to look up.**\r\n\r\nHow do I use GeoIP2 WebService example with above code? Am I missing out anything in terms of implementation?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/ytorbyk/magento2-geo-ip2/issues/comments/411513934","html_url":"https://github.com/ytorbyk/magento2-geo-ip2/issues/6#issuecomment-411513934","issue_url":"https://api.github.com/repos/ytorbyk/magento2-geo-ip2/issues/6","id":411513934,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTUxMzkzNA==","user":{"login":"Vikram0811","id":4048181,"node_id":"MDQ6VXNlcjQwNDgxODE=","avatar_url":"https://avatars1.githubusercontent.com/u/4048181?v=4","gravatar_id":"","url":"https://api.github.com/users/Vikram0811","html_url":"https://github.com/Vikram0811","followers_url":"https://api.github.com/users/Vikram0811/followers","following_url":"https://api.github.com/users/Vikram0811/following{/other_user}","gists_url":"https://api.github.com/users/Vikram0811/gists{/gist_id}","starred_url":"https://api.github.com/users/Vikram0811/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vikram0811/subscriptions","organizations_url":"https://api.github.com/users/Vikram0811/orgs","repos_url":"https://api.github.com/users/Vikram0811/repos","events_url":"https://api.github.com/users/Vikram0811/events{/privacy}","received_events_url":"https://api.github.com/users/Vikram0811/received_events","type":"User","site_admin":false},"created_at":"2018-08-08T18:53:47Z","updated_at":"2018-08-08T18:53:47Z","author_association":"NONE","body":"Hi\r\n\r\nAny updates on this?\r\n"}}
{"actor":{"display_login":"Vikram0811"}}