/** * @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()); }
/** * Creates an unclaimed draft using the provided request draft object * * @param EmbeddedSignatureRequest $request * @return UnclaimedDraft The created draft * @throws BaseException */ public function createUnclaimedDraftEmbeddedWithTemplate(EmbeddedSignatureRequest $request) { $url = static::UNCLAIMED_DRAFT_CREATE_EMBEDDED_WITH_TEMPLATE_PATH; $response = $this->rest->post($url, $request->toParams()); $this->checkResponse($response); $draft = new UnclaimedDraft(); return $draft->fromResponse($response); }