diff --git a/.gitignore b/.gitignore
index e69de29b..61ead866 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/vendor
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 00000000..ec906711
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,475 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "This file is @generated automatically"
+ ],
+ "hash": "bf873377409fbde15ca33f42ee9e3bf0",
+ "packages": [
+ {
+ "name": "eloquent/composer-config-reader",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/eloquent/composer-config-reader.git",
+ "reference": "b79319806e1bcc101c89a023b3aeee9e5931e463"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/eloquent/composer-config-reader/zipball/b79319806e1bcc101c89a023b3aeee9e5931e463",
+ "reference": "b79319806e1bcc101c89a023b3aeee9e5931e463",
+ "shasum": ""
+ },
+ "require": {
+ "eloquent/enumeration": "~5",
+ "eloquent/liberator": "~1",
+ "icecave/isolator": "~2",
+ "justinrainbow/json-schema": "~1",
+ "php": ">=5.3"
+ },
+ "require-dev": {
+ "icecave/archer": "~1"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Eloquent\\Composer\\Configuration\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Erin Millard",
+ "email": "ezzatron@gmail.com",
+ "homepage": "http://ezzatron.com/"
+ }
+ ],
+ "description": "A light-weight component for reading Composer configuration files.",
+ "homepage": "https://github.com/eloquent/composer-config-reader",
+ "keywords": [
+ "composer",
+ "configuration",
+ "parser",
+ "reader"
+ ],
+ "time": "2014-01-22 01:05:31"
+ },
+ {
+ "name": "eloquent/enumeration",
+ "version": "5.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/eloquent/enumeration.git",
+ "reference": "9c50109cf25b2008b9b8233b814e50e0cdf8b737"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/eloquent/enumeration/zipball/9c50109cf25b2008b9b8233b814e50e0cdf8b737",
+ "reference": "9c50109cf25b2008b9b8233b814e50e0cdf8b737",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "require-dev": {
+ "icecave/archer": "~1"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Eloquent\\Enumeration\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Erin Millard",
+ "email": "ezzatron@gmail.com",
+ "homepage": "http://ezzatron.com/"
+ }
+ ],
+ "description": "An enumeration implementation for PHP.",
+ "homepage": "https://github.com/eloquent/enumeration",
+ "keywords": [
+ "class",
+ "enum",
+ "enumeration",
+ "multiton",
+ "set",
+ "type"
+ ],
+ "time": "2014-03-13 01:16:59"
+ },
+ {
+ "name": "eloquent/liberator",
+ "version": "1.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/eloquent/liberator.git",
+ "reference": "a85435066850ab47acc61296c5d20732ff4c9655"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/eloquent/liberator/zipball/a85435066850ab47acc61296c5d20732ff4c9655",
+ "reference": "a85435066850ab47acc61296c5d20732ff4c9655",
+ "shasum": ""
+ },
+ "require": {
+ "eloquent/pops": "~3",
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "icecave/archer": "~0.2"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Eloquent\\Liberator": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Erin Millard",
+ "email": "ezzatron@gmail.com",
+ "homepage": "http://ezzatron.com/"
+ }
+ ],
+ "description": "A proxy for circumventing PHP access modifier restrictions.",
+ "homepage": "https://github.com/eloquent/liberator",
+ "keywords": [
+ "access",
+ "modifier",
+ "object",
+ "private",
+ "protected",
+ "proxy",
+ "reflection"
+ ],
+ "time": "2013-03-03 23:02:47"
+ },
+ {
+ "name": "eloquent/pops",
+ "version": "3.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/eloquent/pops.git",
+ "reference": "b14090a3478f544d1b3a3b9389cb03415cf4f37f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/eloquent/pops/zipball/b14090a3478f544d1b3a3b9389cb03415cf4f37f",
+ "reference": "b14090a3478f544d1b3a3b9389cb03415cf4f37f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "icecave/archer": "~0.2"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Eloquent\\Pops": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Erin Millard",
+ "email": "ezzatron@gmail.com",
+ "homepage": "http://ezzatron.com/"
+ }
+ ],
+ "description": "PHP object proxy system.",
+ "homepage": "https://github.com/eloquent/pops",
+ "keywords": [
+ "escaping",
+ "object",
+ "proxy"
+ ],
+ "time": "2013-03-04 10:10:43"
+ },
+ {
+ "name": "icecave/isolator",
+ "version": "2.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/IcecaveStudios/isolator.git",
+ "reference": "97c51fafa39c57a8f1a31f978a48fbe6cea4a5d5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/IcecaveStudios/isolator/zipball/97c51fafa39c57a8f1a31f978a48fbe6cea4a5d5",
+ "reference": "97c51fafa39c57a8f1a31f978a48fbe6cea4a5d5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "require-dev": {
+ "icecave/archer": "~1"
+ },
+ "suggest": {
+ "eloquent/asplode": "Drop-in exception-based error handling."
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Icecave\\Isolator\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "James Harris",
+ "email": "james.harris@icecave.com.au",
+ "homepage": "https://github.com/jmalloc"
+ }
+ ],
+ "description": "Dependency injection for global functions.",
+ "homepage": "https://github.com/IcecaveStudios/isolator",
+ "keywords": [
+ "fake",
+ "mock",
+ "phake",
+ "phpunit",
+ "test",
+ "unit"
+ ],
+ "time": "2014-08-12 03:16:11"
+ },
+ {
+ "name": "justinrainbow/json-schema",
+ "version": "1.4.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/justinrainbow/json-schema.git",
+ "reference": "2465fe486c864e30badaa4d005ebdf89dbc503f3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2465fe486c864e30badaa4d005ebdf89dbc503f3",
+ "reference": "2465fe486c864e30badaa4d005ebdf89dbc503f3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "json-schema/json-schema-test-suite": "1.1.0",
+ "phpdocumentor/phpdocumentor": "~2",
+ "phpunit/phpunit": "~3.7"
+ },
+ "bin": [
+ "bin/validate-json"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "JsonSchema": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Bruno Prieto Reis",
+ "email": "bruno.p.reis@gmail.com"
+ },
+ {
+ "name": "Justin Rainbow",
+ "email": "justin.rainbow@gmail.com"
+ },
+ {
+ "name": "Igor Wiedler",
+ "email": "igor@wiedler.ch"
+ },
+ {
+ "name": "Robert Schönthal",
+ "email": "seroscho@googlemail.com"
+ }
+ ],
+ "description": "A library to validate a json schema.",
+ "homepage": "https://github.com/justinrainbow/json-schema",
+ "keywords": [
+ "json",
+ "schema"
+ ],
+ "time": "2015-03-27 16:41:39"
+ },
+ {
+ "name": "magento-hackathon/magento-composer-installer",
+ "version": "3.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Cotya/magento-composer-installer.git",
+ "reference": "1a15c8a83c61c487580ef63da820f4a90030e095"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Cotya/magento-composer-installer/zipball/1a15c8a83c61c487580ef63da820f4a90030e095",
+ "reference": "1a15c8a83c61c487580ef63da820f4a90030e095",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "1.0.0",
+ "eloquent/composer-config-reader": "2.*",
+ "php": ">=5.3.2",
+ "symfony/console": "~2.5"
+ },
+ "require-dev": {
+ "composer/composer": "1.0.*@dev",
+ "cotya/composer-test-framework": "dev-master",
+ "mikey179/vfsstream": "~1.4",
+ "phpunit/phpunit": "~4.3",
+ "phpunit/phpunit-mock-objects": "~2.3",
+ "squizlabs/php_codesniffer": "~2.1",
+ "symfony/process": "~2.5"
+ },
+ "suggest": {
+ "colinmollenhour/modman": "*",
+ "ext-SPL_Types": "*",
+ "theseer/autoload": "~1.14"
+ },
+ "bin": [
+ "bin/magento-composer-installer.php"
+ ],
+ "type": "composer-plugin",
+ "extra": {
+ "class": "MagentoHackathon\\Composer\\Magento\\Plugin"
+ },
+ "autoload": {
+ "psr-0": {
+ "MagentoHackathon\\Composer": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "OSL-3.0"
+ ],
+ "authors": [
+ {
+ "name": "Vinai Kopp",
+ "email": "vinai@netzarbeiter.com"
+ },
+ {
+ "name": "Daniel Fahlke aka Flyingmana",
+ "email": "flyingmana@googlemail.com"
+ },
+ {
+ "name": "Jörg Weller",
+ "email": "weller@flagbit.de"
+ },
+ {
+ "name": "Karl Spies",
+ "email": "karl.spies@gmx.net"
+ },
+ {
+ "name": "Tobias Vogt",
+ "email": "tobi@webguys.de"
+ },
+ {
+ "name": "David Fuhr",
+ "email": "fuhr@flagbit.de"
+ }
+ ],
+ "description": "Composer installer for Magento modules",
+ "homepage": "https://github.com/magento-hackathon/magento-composer-installer",
+ "keywords": [
+ "composer-installer",
+ "magento"
+ ],
+ "time": "2015-03-28 19:40:14"
+ },
+ {
+ "name": "symfony/console",
+ "version": "v2.6.6",
+ "target-dir": "Symfony/Component/Console",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Console.git",
+ "reference": "5b91dc4ed5eb08553f57f6df04c4730a73992667"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Console/zipball/5b91dc4ed5eb08553f57f6df04c4730a73992667",
+ "reference": "5b91dc4ed5eb08553f57f6df04c4730a73992667",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/event-dispatcher": "~2.1",
+ "symfony/phpunit-bridge": "~2.7",
+ "symfony/process": "~2.1"
+ },
+ "suggest": {
+ "psr/log": "For using the console logger",
+ "symfony/event-dispatcher": "",
+ "symfony/process": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.6-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Console\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Symfony Console Component",
+ "homepage": "http://symfony.com",
+ "time": "2015-03-30 15:54:10"
+ }
+ ],
+ "packages-dev": [],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": []
+}
diff --git a/src/app/code/community/Zendesk/Zendesk/Helper/Data.php b/src/app/code/community/Zendesk/Zendesk/Helper/Data.php
index a13ec7d3..d3b60050 100644
--- a/src/app/code/community/Zendesk/Zendesk/Helper/Data.php
+++ b/src/app/code/community/Zendesk/Zendesk/Helper/Data.php
@@ -364,16 +364,16 @@ public function getFormatedDateTime($dateToFormat) {
public function getConnectionStatus() {
try {
$user = Mage::getModel('zendesk/api_users')->me();
-
- if($user['id']) {
+
+ if(isset($user['id'])) {
return array(
'success' => true,
'msg' => Mage::helper('zendesk')->__('Connection to Zendesk API successful'),
);
}
-
+
$error = Mage::helper('zendesk')->__('Connection to Zendesk API failed') .
- '
' . Mage::helper('zendesk')->__('Troubleshooting tips can be found at %s', 'https://support.zendesk.com/entries/26579987', 'https://support.zendesk.com/entries/26579987');
+ '
' . Mage::helper('zendesk')->__("Click 'Save Config' and try again. If the issue persist, check if the entered Agent Email Address and Agent Token combination is correct.");
return array(
'success' => false,
@@ -383,7 +383,7 @@ public function getConnectionStatus() {
} catch (Exception $ex) {
$error = Mage::helper('zendesk')->__('Connection to Zendesk API failed') .
'
' . $ex->getCode() . ': ' . $ex->getMessage() .
- '
' . Mage::helper('zendesk')->__('Troubleshooting tips can be found at %s', 'https://support.zendesk.com/entries/26579987', 'https://support.zendesk.com/entries/26579987');
+ '
' . Mage::helper('zendesk')->__("Click 'Save Config' and try again. If the issue persist, check if the entered Agent Email Address and Agent Token combination is correct.");
return array(
'success' => false,
diff --git a/src/app/code/community/Zendesk/Zendesk/Model/Api/Abstract.php b/src/app/code/community/Zendesk/Zendesk/Model/Api/Abstract.php
index 9a9698c3..2d02b6e2 100644
--- a/src/app/code/community/Zendesk/Zendesk/Model/Api/Abstract.php
+++ b/src/app/code/community/Zendesk/Zendesk/Model/Api/Abstract.php
@@ -33,7 +33,7 @@ protected function _call($endpoint, $params = null, $method = 'GET', $data = nul
}
$endpoint .= '?' . implode('&', $args);
}
-
+
$url = $this->_getUrl($endpoint);
$method = strtoupper($method);
@@ -68,16 +68,20 @@ protected function _call($endpoint, $params = null, $method = 'GET', $data = nul
null,
'zendesk.log'
);
-
+
try {
$response = $client->request();
- } catch ( Exception $ex ) {
+ } catch ( Zend_Http_Client_Exception $ex ) {
+ Mage::log('Call to ' . $url . ' resulted in: ' . $ex->getMessage(), Zend_Log::ERR, 'zendesk.log');
+ Mage::log('--Last Request: ' . $client->getLastRequest(), Zend_Log::ERR, 'zendesk.log');
+ Mage::log('--Last Response: ' . $client->getLastResponse(), Zend_Log::ERR, 'zendesk.log');
+
return array();
}
-
+
$body = json_decode($response->getBody(), true);
- Mage::log(var_export($body, true), null, 'zendesk.log');
+ Mage::log(var_export($body, true), Zend_Log::DEBUG, 'zendesk.log');
if($response->isError()) {
if(is_array($body) && isset($body['error'])) {
diff --git a/src/app/code/community/Zendesk/Zendesk/Model/Api/Views.php b/src/app/code/community/Zendesk/Zendesk/Model/Api/Views.php
index 9ba478ec..bb0cad4e 100644
--- a/src/app/code/community/Zendesk/Zendesk/Model/Api/Views.php
+++ b/src/app/code/community/Zendesk/Zendesk/Model/Api/Views.php
@@ -49,7 +49,7 @@ public function execute($id, array $params = array())
public function countByIds(array $ids) {
if(empty($ids)) {
throw new InvalidArgumentException('View ID not provided');
-}
+ }
$response = $this->_call('views/count_many.json?ids=' . implode(',', $ids));
diff --git a/src/app/locale/en_US/Zendesk_Zendesk.csv b/src/app/locale/en_US/Zendesk_Zendesk.csv
index 536b6c1a..28328fa7 100644
--- a/src/app/locale/en_US/Zendesk_Zendesk.csv
+++ b/src/app/locale/en_US/Zendesk_Zendesk.csv
@@ -76,7 +76,7 @@
"The Zendesk log file has not been created. Check to see if logging has been enabled.","The Zendesk log file has not been created. Check to see if logging has been enabled."
"Ticket #%s Created","Ticket #%s Created"
"To generate a token, log in to Zendesk then select Manage > Channels > API > Token","To generate a token, log in to Zendesk then select Manage > Channels > API > Token"
-"Troubleshooting tips can be found at %s","Troubleshooting tips can be found at %s"
+"Click 'Save Config' and try again. If the issue persist, check if the entered Agent Email Address and Agent Token combination is correct.","Click 'Save Config' and try again. If the issue persist, check if the entered Agent Email Address and Agent Token combination is correct."
"Twitter","Twitter"
"Type","Type"
"Updated","Updated"
diff --git a/src/app/locale/en_US/Zendesk_Zendesk.yml b/src/app/locale/en_US/Zendesk_Zendesk.yml
index 918d5a96..b577cbbb 100644
--- a/src/app/locale/en_US/Zendesk_Zendesk.yml
+++ b/src/app/locale/en_US/Zendesk_Zendesk.yml
@@ -225,11 +225,15 @@ parts:
key: "text.integrations.magento.config.test_connection.tips"
title: "Configuration message: suggestion to look at provided URL for troubleshooting"
value: 'Troubleshooting tips can be found at %s'
+ obsolete: "2015-09-17"
- translation:
key: "text.integrations.magento.config.test_connection.outbound.failure"
title: "Configuration message: connection to the Zendesk API failed"
value: "Connection to Zendesk API failed"
-
+ - translation:
+ key: "text.integrations.magento.config.test_connection.troubleshooting"
+ title: "Configuration message: suggestion to look at configured email and token for troubleshooting"
+ value: "Click 'Save Config' and try again. If the issue persist, check if the entered Agent Email Address and Agent Token combination is correct."
# Tickets
- translation:
@@ -411,4 +415,4 @@ parts:
- translation:
key: "txt.integrations.magento.general.support_tickets"
title: "Title for a section display support tickets"
- value: "Support Tickets"
\ No newline at end of file
+ value: "Support Tickets"