Skip to content

Commit

Permalink
Merge pull request #14 from zoho/beta
Browse files Browse the repository at this point in the history
Modified oauth expiry_time from int to double
  • Loading branch information
raja-7453 authored Apr 16, 2021
2 parents 5684317 + 8f84e05 commit 36f62cb
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ You can include the SDK to your project using:
- Run the command below:

```sh
composer require zohocrm/php-sdk:3.0.2
composer require zohocrm/php-sdk:3.0.3
```

- The PHP SDK will be installed and a package named vendor will be created in the workspace of your client app.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "zohocrm/php-sdk",
"description" : "Zoho CRM API SDK for PHP",
"type" : "SDK",
"type" : "sdk",
"homepage": "https://github.com/zoho/zohocrm-php-sdk",
"authors" : [
{
Expand Down
2 changes: 1 addition & 1 deletion src/com/zoho/api/authenticator/OAuthToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public function getCurrentTimeInMillis()

public function isAccessTokenExpired($expiry_time)
{
return ((((int)$expiry_time) - $this->getCurrentTimeInMillis()) < 5000);
return ((((double)$expiry_time) - $this->getCurrentTimeInMillis()) < 5000);
}

public function getUrlParamsAsString($urlParams)
Expand Down
2 changes: 1 addition & 1 deletion src/com/zoho/crm/api/record/RecordOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public function uploadPhoto(string $id, string $moduleAPIName, FileBodyWrapper
$handlerInstance->setContentType('multipart/form-data');
$handlerInstance->setRequest($request);
$handlerInstance->setMandatoryChecker(true);
Utility::getModules();
Utility::verifyPhotoSupport($moduleAPIName);
return $handlerInstance->apiCall(FileHandler::class, 'application/json');

}
Expand Down
2 changes: 1 addition & 1 deletion src/com/zoho/crm/api/util/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ class Constants

const FORM_REQUEST_EXCEPTION = "Exception in forming request body : ";

const SDK_VERSION = "3.0.2";
const SDK_VERSION = "3.0.3";

const API_CALL_EXCEPTION = "Exception in current API call execution : ";

Expand Down
8 changes: 4 additions & 4 deletions src/com/zoho/crm/api/util/Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public static function getFieldDetails($moduleAPIName)
$fieldsDetails[$field->getAPIName()] = $fieldDetail;
}

if(in_array($moduleAPIName, Constants::INVENTORY_MODULES))
if(strtolower($moduleAPIName) == strtolower(Constants::NOTES))
{
$fieldDetail = array();

Expand All @@ -522,7 +522,7 @@ public static function getFieldDetails($moduleAPIName)

$fieldsDetails[Constants::ATTACHMENTS] = $fieldDetail;
}
if(strtolower($moduleAPIName) === strtolower(Constants::NOTES))
if(in_array(strtolower($moduleAPIName), Constants::INVENTORY_MODULES))
{
$fieldDetail = array();

Expand Down Expand Up @@ -583,9 +583,9 @@ public static function searchJSONDetails($key)
return null;
}

public static function getModules()
public static function verifyPhotoSupport($moduleAPIName)
{
// self::$apiSupportedModule = count(self::$apiSupportedModule) > 0 ? self::$apiSupportedModule : self::getAllModules(null);
return;
}

private static function getAllModules($header)
Expand Down
2 changes: 1 addition & 1 deletion src/resources/JSONDetails.json

Large diffs are not rendered by default.

0 comments on commit 36f62cb

Please sign in to comment.