{"action":"opened","issue":{"url":"https://api.github.com/repos/hotelbeds-sdk/hotel-api-sdk-php/issues/19","repository_url":"https://api.github.com/repos/hotelbeds-sdk/hotel-api-sdk-php","labels_url":"https://api.github.com/repos/hotelbeds-sdk/hotel-api-sdk-php/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/hotelbeds-sdk/hotel-api-sdk-php/issues/19/comments","events_url":"https://api.github.com/repos/hotelbeds-sdk/hotel-api-sdk-php/issues/19/events","html_url":"https://github.com/hotelbeds-sdk/hotel-api-sdk-php/issues/19","id":164637757,"number":19,"title":"Not authorized, review your api-key and secret!","user":{"login":"xochilpili","id":6123199,"avatar_url":"https://avatars.githubusercontent.com/u/6123199?v=3","gravatar_id":"","url":"https://api.github.com/users/xochilpili","html_url":"https://github.com/xochilpili","followers_url":"https://api.github.com/users/xochilpili/followers","following_url":"https://api.github.com/users/xochilpili/following{/other_user}","gists_url":"https://api.github.com/users/xochilpili/gists{/gist_id}","starred_url":"https://api.github.com/users/xochilpili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xochilpili/subscriptions","organizations_url":"https://api.github.com/users/xochilpili/orgs","repos_url":"https://api.github.com/users/xochilpili/repos","events_url":"https://api.github.com/users/xochilpili/events{/privacy}","received_events_url":"https://api.github.com/users/xochilpili/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-09T00:00:39Z","updated_at":"2016-07-09T00:00:39Z","closed_at":null,"body":"Hola a todos; \r\n\r\nHe generado las credenciales desde : https://developer.hotelbeds.com/docs/read/Home\r\ny he intentado usar el php script que se encuentra en la misma página, me he comunicado con uno de los asesores y fue el que me recomendó usar el SDK de hotelbeds, sin embargo, obtengo el mismo resultado: \r\n**Not authorized, review your api-key and secret!**\r\n\r\n¿Podría por favor alguien orientarme?\r\n\r\nExpongo aquí la configuración de mi php: \r\n\r\n# php --version\r\nPHP 5.6.22 (cli) (built: May 28 2016 10:12:12)\r\n\r\n# pecl info pecl_http\r\nAbout pecl.php.net/pecl_http-2.5.3\r\n\r\n# php -m \r\n[PHP Modules]\r\nbcmath\r\nbz2\r\ncalendar\r\nCore\r\nctype\r\ncurl\r\ndate\r\ndom\r\nereg\r\nexif\r\nfileinfo\r\nfilter\r\nftp\r\ngd\r\ngettext\r\ngmp\r\nhash\r\nhttp\r\niconv\r\njson\r\nldap\r\nlibxml\r\nmbstring\r\nmcrypt\r\nmhash\r\nmssql\r\nmysql\r\nmysqli\r\nopenssl\r\npcntl\r\npcre\r\nPDO\r\npdo_dblib\r\npdo_mysql\r\npdo_pgsql\r\npdo_sqlite\r\npgsql\r\nPhar\r\nposix\r\npropro\r\nraphf\r\nreadline\r\nReflection\r\nsession\r\nshmop\r\nSimpleXML\r\nsoap\r\nsockets\r\nSPL\r\nsqlite3\r\nstandard\r\nsysvmsg\r\nsysvsem\r\nsysvshm\r\ntokenizer\r\nwddx\r\nxml\r\nxmlreader\r\nxmlwriter\r\nxsl\r\nzip\r\nzlib\r\n\r\n# cat test.php\r\n\r\n<?php\r\n\trequire __DIR__.'/framework/vendor/autoload.php';\r\n\t\r\nuse hotelbeds\\hotel_api_sdk\\HotelApiClient;\r\nuse hotelbeds\\hotel_api_sdk\\model\\Destination;\r\nuse hotelbeds\\hotel_api_sdk\\model\\Occupancy;\r\nuse hotelbeds\\hotel_api_sdk\\model\\Pax;\r\nuse hotelbeds\\hotel_api_sdk\\model\\Rate;\r\nuse hotelbeds\\hotel_api_sdk\\model\\Stay;\r\nuse hotelbeds\\hotel_api_sdk\\types\\ApiVersion;\r\nuse hotelbeds\\hotel_api_sdk\\types\\ApiVersions;\r\nuse hotelbeds\\hotel_api_sdk\\messages\\AvailabilityRS;\r\n\t\r\n\t$reader = new Zend\\Config\\Reader\\Ini();\r\n\t$config = $reader->fromFile(__DIR__.'/HotelApiClient.ini');\r\n\t$cfgApi = $config['apiclient'];\r\n\r\n\t$apiClient = new HotelApiClient($cfgApi['url'],$cfgApi['apikey'],$cfgApi['sharedsecret'],new ApiVersion(ApiVersions::V1_0), $cfgApi['timeout']);\r\n\t\r\n\t$rqData = new \\hotelbeds\\hotel_api_sdk\\helpers\\Availability();\r\n\t$rqData->stay = new Stay(DateTime::createFromFormat('Y-m-d','2016-07-08'),DateTime::createFromFormat('Y-m-d','2016-07-10'));\r\n\t\r\n\t$rqData->destination = new Destination('PMI');\r\n\t$occupancy = new Occupancy();\r\n\t$occupancy->adults=2;\r\n\t$occupancy->children=1;\r\n\t$occupancy->rooms=1;\r\n\t\r\n\t$occupancy->paxes = [new Pax(Pax::AD, 30, 'Mike', 'Doe'),  new Pax(Pax::AD, 27,'Jane','Doe'),new Pax(Pax::CH, 8, 'Mack','Doe')];\r\n\t$rqData->occupancies = [$occupancy];\r\n\t\r\n\ttry{\r\n\t\t$availRS = $apiClient->availability($rqData);\r\n\t\t\r\n\t}catch(\\hotelbeds\\hotel_api_sdk\\types\\HotelSDKException $e){\r\n\t\t$auditData = $e->getAuditData();\r\n\t\terror_log($e->getMessage());\r\n\t\t//error_log(\"Audit remote data = \".json_encode($auditData->toArray()));\r\n\t\texit();\r\n\t}catch(Exception $e){\r\n\t\terror_log($e->getMessage());\r\n\t\texit();\r\n\t}\r\n\t\r\n\tif(!$availRS->isEmpty()){\r\n\t\tprint_r($availRS->hotels->toArray());\r\n\t}else{\r\n\t\techo \"No results!\\n\\n\";\r\n\t}\r\n?>\r\n\r\nAsí mismo, tuve que renombrar AvailabilityRS a availabilityRS en la carpeta messages/\r\nEn el hilo del error documentado en este repositorio, dice que habría que actualizar, sin embargo, no tengo ni una hora que lo he instalado, asumo que me ha instalado la última versión.\r\n\r\n# cat framework/composer.json \r\n{\r\n    \"require\": {\r\n        \"hotelbeds/hotel-api-sdk-php\": \"dev-master@dev\"\r\n    }\r\n}\r\n\r\nLes agradeceré su pronta respuesta.\r\n\r\nxOCh"}}
{"actor":{"display_login":"xochilpili"}}