Account


Earned badges

Achievement: Latest Unlocked

Topic Started

Topics

Hi, 

Hi, I have download code from onespan "esignlive", i already replaced my sandbox key but code not work now. i can't understand what is issue with that. can you help me

Replies Created

Reply to: Unhandled Server Error

0 votes

i was checked in in linux and window but same issue with both, please check screenshoot

I have uploaded new code, can you let me know what is wrong with that.


Attachments

Reply to: Unhandled Server Error

0 votes

'PACKAGE', 'status' => 'DRAFT', 'roles' => array( array( 'id' => 'Signer1', 'type' => 'SIGNER', 'signers' => array( array( 'email' => $email, 'firstName' => $firstName, 'lastName' => $lastName, 'id' => 'Signer1', ) ) , ) , array( 'id' => 'Sender1', 'type' => 'SENDER', 'signers' => array( array( 'email' => '[email protected]', 'firstName' => 'Haris', 'lastName' => 'Haidary', 'id' => 'Sender1', ) ) , ) , ) , 'name' => 'PHP Application Example', ); $packageJSON = json_encode($build); $packageId = json_decode($this->sendRequest($this->packageAppend, $packageJSON, NULL, NULL), true); return $packageId; } //Upload document public function buildDocument($packageId) { $build = array( 'extract' => true, 'name' => 'Sample Contract', 'id' => 'contract' ); $doc = file_get_contents("documents/purchase_order.pdf"); $documentJSON = json_encode($build); $status = $this->sendRequest($this->packageAppend . $packageId['id'] . '/documents', $documentJSON, $doc, 'multipart/form-data'); return $status; } //Send Package public function buildSend($packageId) { $build = array( 'status' => 'SENT' ); $sendJSON = json_encode($build); $this->sendRequest($this->packageAppend . $packageId['id'], $sendJSON, NULL, 'application/json'); return NULL; } //Sender signs consent and contract documents public function buildSign($packageId) { $build = array( 'documents' => array( array( 'id' => 'default-consent', 'name' => 'Electronic Disclosures and Signatures Consent' ) , array( 'id' => 'contract', 'name' => 'Sample Contract' ) ) ); $signJSON = json_encode($build); $signatureAppend = $this->packageAppend . $packageId['id'] . '/documents/signed_documents'; $see = $this->sendRequest($signatureAppend, $signJSON, NULL, 'application/json'); return NULL; } //Get a session token public function buildToken($packageId) { $build = array( 'packageId' => $packageId['id'], 'signerId' => 'Signer1' ); $tokenJSON = json_encode($build); $token = json_decode($this->sendRequest($this->tokenAppend, $tokenJSON, NULL, 'application/json'), true); return $token; } //cURL function to send requests to eSignLive private function sendRequest($type, $json, $document, $contentType) { if (is_null($document) && is_null($contentType)) { $postfields = array( "payload" => $json ); } else if (is_null($document) && !is_null($contentType)) { $postfields = $json; } else if (!is_null($document) && $contentType == 'multipart/form-data') { $postfields = array( "file" => $document, "payload" => $json ); } $headerOptions = array( 'Authorization: Basic ' . $this->key ); if (!is_null($contentType)) { $headerOptions[] = "Content-Type: $contentType"; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->url . $type); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,0); curl_setopt($ch, CURLOPT_TIMEOUT, 400); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); if (!is_null($postfields)) { curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); if (!is_array($postfields)) { $headerOptions[] = 'Content-Length: ' . strlen($postfields); } } curl_setopt($ch, CURLOPT_HTTPHEADER, $headerOptions); $response = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { return $err; } else { return $response; }; } } ?>


Subscriptions

Topics Replies Freshness Views Users

Hi, 

Hi, I have download code from onespan "esignlive", i already replaced my sandbox key but code not work now. i can't understand what is issue with that. can you help me

7 2 years 11 months ago 474
Profile picture for user Duo_Liang

Code Share

This user has not submitted any code shares.

Subscriptions Release Notes

This user is not subscribed to any release notes.