-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bcb460f
commit 22e65c0
Showing
7 changed files
with
123 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
namespace Dfe\ZohoCRM\API; | ||
use Dfe\ZohoCRM\Settings; | ||
// 2017-07-08 | ||
/** @method Settings ss() */ | ||
final class Client extends \Df\Zoho\API\Client { | ||
/** | ||
* 2017-07-08 | ||
* https://www.zoho.eu/crm/help/api/getmodules.html#Request_URL | ||
* @override | ||
* @see \Df\API\Client::commonParams() | ||
* @used-by \Df\API\Client::__construct() | ||
* @param string $path | ||
* @return array(string => mixed) | ||
*/ | ||
final protected function commonParams($path) {return [ | ||
// 2017-07-08 «Encrypted alphanumeric string to authenticate your Zoho credentials» | ||
'authtoken' => $this->ss()->token() | ||
// 2017-07-08 «Specify the value as `crmapi`» | ||
,'scope' => 'crmapi' | ||
];} | ||
|
||
/** | ||
* 2017-07-08 | ||
* @override | ||
* @see \Df\API\Client::uriBase() | ||
* @used-by \Df\API\Client::__construct() | ||
* @used-by \Df\API\Client::p() | ||
* @return string | ||
*/ | ||
protected function uriBase() {return "https://{$this->ss()->domain()}/crm/private/json";} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
namespace Dfe\ZohoCRM\API; | ||
use Df\Core\Exception as DFE; | ||
use Dfe\ZohoCRM\API\Client as C; | ||
// 2017-07-08 | ||
final class Facade { | ||
/** | ||
* 2017-07-08 https://www.zoho.eu/crm/help/api/getmodules.html | ||
* @return array(array(string => mixed)) | ||
*/ | ||
final function getModules() {return $this->p(__FUNCTION__, 'Info');} | ||
|
||
/** | ||
* 2017-07-08 | ||
* @param string $path | ||
* @param string $ns [optional] | ||
* @param array(string => mixed) $p [optional] | ||
* @param string|null $method [optional] | ||
* @return array(string => mixed) | ||
* @throws DFE | ||
*/ | ||
final function p($path, $ns = '', array $p = [], $method = null) {return C::i( | ||
$this, df_cc_path($ns, $path), $p, $method | ||
)->p();} | ||
|
||
/** 2017-07-08 @return self */ | ||
public static function s() {static $r; return $r ? $r : $r = new self;} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
namespace Dfe\ZohoCRM\Source; | ||
// 2017-07-08 | ||
final class Domain extends \Df\Config\Source { | ||
/** | ||
* 2017-07-08 | ||
* https://mage2.pro/t/4150 | ||
* https://www.quora.com/Where-are-ZOHO-Data-Centers-Cloud-Servers-located/answer/Neel-Gupta-3 | ||
* https://www.zoho.eu/crm/help/api/using-api-url.html | ||
* @override | ||
* @see \Df\Config\Source::map() | ||
* @used-by \Df\Config\Source::toOptionArray() | ||
* @return array(string => string) | ||
*/ | ||
protected function map() {return | ||
[0 => '-- select a value --'] | ||
+ dfa_combine_self(['crm.zoho.com', 'crm.zoho.eu', 'crm.zoho.com.cn', 'crm.zoho.co.jp']) | ||
+ [self::OTHER => 'Other'] | ||
;} | ||
|
||
const OTHER = 'other'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters