/** * @group create */ public function testCreateEmbeddedUnclaimedDraft() { $account = $this->client->getAccount(); $request = new SignatureRequest(); $request->enableTestMode(); $request->setRequesterEmail($account->getEmail()); $request->setTitle('NDA with Acme Co.'); $request->setSubject('The NDA we talked about'); $request->setMessage('Please sign this NDA and let\'s discuss.'); $request->addSigner('*****@*****.**', 'Bale'); $request->addSigner('*****@*****.**', 'Beck'); $request->addCC('*****@*****.**'); $request->addFile(__DIR__ . '/nda.docx'); $client_id = $_ENV['CLIENT_ID']; $draft = new UnclaimedDraft($request, $client_id); $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 testCreateEmbeddedSignatureRequest() { // Create the signature request $request = new SignatureRequest(); $request->enableTestMode(); $request->setTitle('Embedded NDA'); $request->addSigner('*****@*****.**', 'Jack'); $request->addFile(__DIR__ . '/nda.docx'); // Turn it into an embedded request $client_id = $_ENV['CLIENT_ID']; $embedded_request = new EmbeddedSignatureRequest($request, $client_id); // Send it to HelloSign $response = $this->client->createEmbeddedSignatureRequest($embedded_request); $this->assertInstanceOf('HelloSign\\SignatureRequest', $response); $this->assertNotNull($response->getId()); $signatures = $response->getSignatures(); return $signatures[0]->getId(); }
/** * @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(); }