docusign / docusign-esign-php-client

The Official Docusign PHP Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
198 stars 124 forks source link

Class 'Number' not found on Object Serializer #48

Closed PrakashInfiniti closed 4 years ago

PrakashInfiniti commented 7 years ago

On line 276 while calling listTabs in envelopeapi

PrakashInfiniti commented 7 years ago

Namespace Path( \DocuSign\eSign\Model) is not included while deserializing happening

northern commented 7 years ago

I'm running into a similar problem. However, the message I receive is:

PHP Fatal error:  Class 'Number' not found in vendor/docusign/esign-client/src/ObjectSerializer.php on line 274

I believe that there might be an issue/conflict with the Laravel framework.

To replicate the problem. I'm using PHP 5.6.31. I have the following in my composer.json:

{
    "require": {
        "laravel/framework": "5.1.*",
        "docusign/esign-client": "^3.0"
    }
}

This will get an older version of Laravel (which I currently believe is an LTS version) and the lastest version of the DocoSign PHP client (3.0.1).

This is my test script:

<?php

require("vendor/autoload.php");

$accountId = '123';

$auth = [
    'Username' => 'test',
    'Password' => 'secret',
    'IntegratorKey' => 'secret',
];

$config = new \DocuSign\eSign\Configuration();
$config->setHost("https://demo.docusign.net/restapi");
$config->addDefaultHeader("X-DocuSign-Authentication", json_encode($auth));

$apiClient = new \DocuSign\eSign\ApiClient($config);

$templatesApi = new \DocuSign\eSign\Api\TemplatesApi($apiClient);

$response = $templatesApi->get($accountId, 'abc');

The above will produce the error.

However, if I remove the Laravel dependency from composer.json and update, when I now run the sample, I don't get the error.

This same error was raised a few weeks ago as well and I had been using a patch to work around this problem. When I use the ObjectSerializer presented at the following location, I do not get the error:

https://raw.githubusercontent.com/trickeyone/docusign-php-client/cc3483c44c301ad7c0d42e41094e70dfde5f68ef/src/ObjectSerializer.php

Looking forward to see this problem smashed once and for all.

lpeterke commented 6 years ago

+1

Exception in ObjectSerializer.php (line 274)

Using Laravel 5.5 and latest DocuSign API

gitspider commented 6 years ago

I am experiencing the same problem. I use PHP 7.0, Laravel 5.5 and the latest version of docusign-php sdk.

gitspider commented 6 years ago
[2017-11-28 19:07:12] local.ERROR: Class 'Number' not found {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Class 'Number' not found at ...\vendor\docusign\esign-client\src\ObjectSerializer.php:274)
[stacktrace]
#0 ...\vendor\docusign\esign-client\src\ObjectSerializer.php(291): DocuSign\eSign\ObjectSerializer::deserialize(1, 'Number', NULL)
#1 ...\vendor\docusign\esign-client\src\ObjectSerializer.php(236): DocuSign\eSign\ObjectSerializer::deserialize(Object(stdClass), '\\DocuSign\\eSign...', NULL)
#2 ...\vendor\docusign\esign-client\src\ObjectSerializer.php(291): DocuSign\eSign\ObjectSerializer::deserialize(Array, '\\DocuSign\\eSign...', NULL)
#3 ...\vendor\docusign\esign-client\src\Api\EnvelopesApi.php(8113): DocuSign\eSign\ObjectSerializer::deserialize(Object(stdClass), '\\DocuSign\\eSign...', Array)
#4 ...\vendor\docusign\esign-client\src\Api\EnvelopesApi.php(8012): DocuSign\eSign\Api\EnvelopesApi->listTabsWithHttpInfo('310...', '37a21de1-1382-4...', '1', NULL)
#5 ...\app\Support\DocusignHelper.php(679): DocuSign\eSign\Api\EnvelopesApi->listTabs('310...', '37a21de1-1382-4...', '1')

This is error stacktrace.

newtek-bneff commented 6 years ago

See ticket #41 and if you swap out this ObjectSerializer.php for the default one - https://github.com/trickeyone/docusign-php-client/blob/cc3483c44c301ad7c0d42e41094e70dfde5f68ef/src/ObjectSerializer.php

Worked for me

LarryKlugerDS commented 5 years ago

Thank you for the problem report. And please accept my apologies for the very slow DocuSign staff replies on this issue. We have reorganized so we can provide faster response.

This issue now has internal bug report # DCM-3210

We are working on it.

astroanu commented 5 years ago

is this fixed now? will updating the api client work ?

Muspi commented 5 years ago

Hello, is this fixed? I have same problem.

Replacing 'Number' with '\DocuSign\eSign\Model\Number' seems to fix problem.

LarryKlugerDS commented 4 years ago

I'm told this is fixed in v5.1. Please respond and we'll re-open the issue if there is still a bug. Thank you.