/**
  * The difference is that you don't set a client id here
  * @group create
  */
 public function testCreateUnclaimedDraft()
 {
     $request = new SignatureRequest();
     $request->enableTestMode();
     $request->addFile(__DIR__ . '/nda.docx');
     $draft = new UnclaimedDraft($request);
     $response = $this->client->createUnclaimedDraft($draft);
     $sign_url = $response->getClaimUrl();
     $this->assertInstanceOf('HelloSign\\UnclaimedDraft', $response);
     $this->assertNotNull($response);
     $this->assertEquals($draft, $response);
     $this->assertNotEmpty($sign_url);
 }
 /**
  * @group create
  */
 public function testCreateEmbeddedRequestingWithEmbeddedSigning()
 {
     // Create the signature request
     $request = new SignatureRequest();
     $request->enableTestMode();
     $request->setRequesterEmail('*****@*****.**');
     $request->addFile(__DIR__ . '/nda.docx');
     // Turn it into an embedded request
     $client_id = $_ENV['CLIENT_ID'];
     $draft_request = new UnclaimedDraft($request, $client_id);
     $draft_request->setIsForEmbeddedSigning(true);
     // Send it to HelloSign
     $response = $this->client->createUnclaimedDraft($draft_request);
     $this->assertInstanceOf('HelloSign\\UnclaimedDraft', $response);
     $this->assertNotNull($response->getClaimUrl());
 }
Ejemplo n.º 3
0
 /**
  * Send a new SignatureRequest with the submitted documents
  *
  * @param  SignatureRequest $request
  * @return SignatureRequest
  * @throws BaseException
  */
 public function sendSignatureRequest(SignatureRequest $request)
 {
     $response = $this->rest->post(static::SIGNATURE_REQUEST_SEND_PATH, $request->toParams());
     $this->checkResponse($response);
     return $request->fromResponse($response);
 }
Ejemplo n.º 4
0
 /**
  * @param  stdClass $signature_request
  * @return Event
  * @ignore
  */
 protected function setSignatureRequest($signature_request)
 {
     $this->signature_request = new SignatureRequest();
     $this->signature_request->fromObject($signature_request);
     return $this;
 }
 /**
  * @group create
  */
 public function testSendSignatureRequestWithMetadata()
 {
     // Enable Test Mode
     $request = new SignatureRequest();
     $request->enableTestMode();
     // Set Request Param Signature Request
     $request->setTitle("Document with Metadata");
     $request->setSubject("Metadata");
     $request->setMessage("This signature request contains metadata.");
     $request->addSigner("*****@*****.**", "Jack");
     $request->addSigner(new Signer(array('name' => "Jill", 'email_address' => "*****@*****.**")));
     $request->addCC("*****@*****.**");
     $request->addFile(__DIR__ . '/omega-multi.pdf');
     $request->addMetadata('custom_id', '1234');
     $request->addMetadata('custom_text', 'oranges, apples, and bananas');
     // Send Signature Request
     $response = $this->client->sendSignatureRequest($request);
     $this->assertObjectHasAttribute('metadata', $response);
     $this->assertObjectHasAttribute('custom_id', $response->metadata);
     $this->assertEquals($response->metadata->custom_id, '1234');
     $this->assertObjectHasAttribute('custom_text', $response->metadata);
     $this->assertEquals($response->metadata->custom_text, 'oranges, apples, and bananas');
     return $response->getId();
 }