diff --git a/src/main/java/com/docusign/controller/eSignature/examples/EG041ControllerCfrEmbeddedSigning.java b/src/main/java/com/docusign/controller/eSignature/examples/EG041ControllerCfrEmbeddedSigning.java index 23cb464..0c66ab1 100644 --- a/src/main/java/com/docusign/controller/eSignature/examples/EG041ControllerCfrEmbeddedSigning.java +++ b/src/main/java/com/docusign/controller/eSignature/examples/EG041ControllerCfrEmbeddedSigning.java @@ -59,11 +59,9 @@ protected Object doWork(WorkArguments args, ModelMap model, String phoneNumber = args.getPhoneNumber(); String accountId = session.getAccountId(); - // Step 2 start + //ds-snippet-start:eSign41Step2 ApiClient apiClient = createApiClient(session.getBasePath(), user.getAccessToken()); - // Step 2 end - // Step 3 start AccountsApi workflowDetails = new AccountsApi(apiClient); AccountIdentityVerificationResponse workflowRes = workflowDetails.getAccountIdentityVerification(session.getAccountId()); List identityVerification = workflowRes.getIdentityVerification(); @@ -75,15 +73,16 @@ protected Object doWork(WorkArguments args, ModelMap model, workflowId = identityVerification.get(i).getWorkflowId(); } } - // Step 3 end + //ds-snippet-end:eSign41Step2 + logger.info("workflowId = " + workflowId); if (workflowId.equals("")) { throw new ApiException(0, getTextForCodeExample().CustomErrorTexts.get(0).ErrorMessage); } - - // Step 1. Create the envelope definition + // Create the envelope definition + //ds-snippet-start:eSign41Step4 EnvelopeDefinition envelope = CfrEmbeddedSigningService.makeEnvelope( signerName, signerEmail, @@ -96,26 +95,33 @@ protected Object doWork(WorkArguments args, ModelMap model, DOCUMENT_FILE_NAME, DOCUMENT_NAME); - // Step 2. Call DocuSign to create the envelope + // Call DocuSign to create the envelope EnvelopesApi envelopesApi = new EnvelopesApi(apiClient); EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envelope); String envelopeId = envelopeSummary.getEnvelopeId(); + //ds-snippet-end:eSign41Step4 + session.setEnvelopeId(envelopeId); - // Step 3. create the recipient view, the embedded signing + // create the recipient view, the embedded signing + //ds-snippet-start:eSign41Step5 RecipientViewRequest viewRequest = CfrEmbeddedSigningService.makeRecipientViewRequest( signerEmail, signerName, config, signerClientId); + //ds-snippet-end:eSign41Step5 + + //ds-snippet-start:eSign41Step6 ViewUrl viewUrl = CfrEmbeddedSigningService.embeddedSigning( envelopesApi, accountId, envelopeId, viewRequest ); + //ds-snippet-end:eSign41Step6 // Step 4. Redirect the user to the embedded signing // Don't use an iFrame! diff --git a/src/main/java/com/docusign/controller/eSignature/services/CfrEmbeddedSigningService.java b/src/main/java/com/docusign/controller/eSignature/services/CfrEmbeddedSigningService.java index 485a142..5f81582 100644 --- a/src/main/java/com/docusign/controller/eSignature/services/CfrEmbeddedSigningService.java +++ b/src/main/java/com/docusign/controller/eSignature/services/CfrEmbeddedSigningService.java @@ -11,6 +11,7 @@ import java.util.Collections; public final class CfrEmbeddedSigningService { + //ds-snippet-start:eSign41Step6 public static ViewUrl embeddedSigning( EnvelopesApi envelopesApi, String accountId, @@ -19,7 +20,9 @@ public static ViewUrl embeddedSigning( ) throws ApiException { return envelopesApi.createRecipientView(accountId, envelopeId, viewRequest); } + //ds-snippet-end:eSign41Step6 + //ds-snippet-start:eSign41Step5 public static RecipientViewRequest makeRecipientViewRequest( String signerEmail, String signerName, @@ -61,7 +64,9 @@ public static RecipientViewRequest makeRecipientViewRequest( return viewRequest; } + //ds-snippet-end:eSign41Step5 + //ds-snippet-start:eSign41Step3 public static EnvelopeDefinition makeEnvelope( String signerName, String signerEmail, @@ -115,4 +120,5 @@ public static EnvelopeDefinition makeEnvelope( return envelopeDefinition; } + //ds-snippet-end:eSign41Step3 }