예제 #1
0
        public void SendSignatureRequestForTemplateTest()
        {
            // build signature request
            SignatureRequest signatureRequest = new SignatureRequest();

            signatureRequest.SendEmails = false;

            Document document = new Document();

            document.ID = idOfTheTemplate;

            Signer signer = new Signer(signers["signer1"]["email"]);

            document.Signers.Add(signer);
            signatureRequest.Documents.Add(document);

            // execute signature request
            DigiSignerClient client = new DigiSignerClient(apiId);
            SignatureRequest signatureRequestResponse = client.SendSignatureRequest(signatureRequest);

            // validate signature request response
            ValidateResponse(signatureRequest, signatureRequestResponse, false);

            // get and validate signature request from database
            String           signatureRequestId      = signatureRequestResponse.SignatureRequestId;
            SignatureRequest createdSignatureRequest = client.GetSignatureRequest(signatureRequestId);

            ValidateSignatureRequest(signatureRequest, createdSignatureRequest, false);
        }
예제 #2
0
        public void SendSignatureRequestWithBrandingTest()
        {
            // build signature request
            SignatureRequest signatureRequest = new SignatureRequest();

            signatureRequest.SendEmails = false;

            // add document from file and one signer
            Document document = new Document(relativePathToFileOfTheDocument);

            document.Signers.Add(new Signer(signers["signer1"]["email"]));
            signatureRequest.Documents.Add(document);

            // add branding info
            signatureRequest.Branding.EmailFromField = "Your company";
            signatureRequest.Branding.ReplyToEmail   = "*****@*****.**";

            // execute signature request
            DigiSignerClient client = new DigiSignerClient(apiId);
            SignatureRequest signatureRequestResponse = client.SendSignatureRequest(signatureRequest);

            // validate signature request response
            ValidateResponse(signatureRequest, signatureRequestResponse, true);

            // get and validate signature request from database
            string           signatureRequestId      = signatureRequestResponse.SignatureRequestId;
            SignatureRequest createdSignatureRequest = client.GetSignatureRequest(signatureRequestId);

            ValidateSignatureRequest(signatureRequest, createdSignatureRequest, true);
        }
예제 #3
0
        public void SendSignatureRequestTest()
        {
            // build signature request
            SignatureRequest signatureRequest = new SignatureRequest();

            signatureRequest.SendEmails = false;

            // add document from file and one signer
            Document document = new Document(relativePathToFileOfTheDocument);

            document.Signers.Add(new Signer(signers["signer1"]["email"]));
            signatureRequest.Documents.Add(document);

            // execute signature request
            DigiSignerClient client = new DigiSignerClient(apiId);
            SignatureRequest signatureRequestResponse = client.SendSignatureRequest(signatureRequest);

            // validate signature request response
            ValidateResponse(signatureRequest, signatureRequestResponse, true);

            // get and validate signature request from database
            string           signatureRequestId      = signatureRequestResponse.SignatureRequestId;
            SignatureRequest createdSignatureRequest = client.GetSignatureRequest(signatureRequestId);

            ValidateSignatureRequest(signatureRequest, createdSignatureRequest, true);
        }
예제 #4
0
        public void SendSignatureRequestWithExistingFieldsForTemplateTest()
        {
            // build signature request
            SignatureRequest signatureRequest = new SignatureRequest();

            signatureRequest.SendEmails = false;

            Document document = new Document(relativePathToFileOfTheDocument);

            document.ID = idOfTheDocumentWithFileds;

            // add first signer
            Signer signer = new Signer(signers["signer1"]["email"]);

            signer.Role  = "Employee";
            signer.Order = 1;

            // add field for first signer
            ExistingField field1 = new ExistingField((string)existingField1["fieldId"]);

            field1.Content  = (string)existingField1["content"];
            field1.Label    = (string)existingField1["label"];
            field1.Required = (bool)existingField1["required"];
            field1.ReadOnly = (bool)existingField1["readonly"];
            signer.ExistingFields.Add(field1);

            // add second field to first signer
            ExistingField field2 = new ExistingField((string)existingField2["fieldId"]);

            field2.Content  = (string)existingField2["content"];
            field2.Label    = (string)existingField2["label"];
            field2.Required = (bool)existingField2["required"];
            field2.ReadOnly = (bool)existingField2["readonly"];
            signer.ExistingFields.Add(field2);

            document.Signers.Add(signer);
            signatureRequest.Documents.Add(document);

            // execute signature request
            DigiSignerClient client = new DigiSignerClient(apiId);
            SignatureRequest signatureRequestResponse = client.SendSignatureRequest(signatureRequest);

            // validate signature request response
            ValidateResponse(signatureRequest, signatureRequestResponse, false);

            // get and validate signature request from database
            SignatureRequest createdSignatureRequest = client.GetSignatureRequest(
                signatureRequestResponse.SignatureRequestId);

            ValidateSignatureRequest(signatureRequest, createdSignatureRequest, false);

            // get and validate fields from database
            Document       expectedDocument = signatureRequest.Documents[0];
            DocumentFields documentFields   = client.GetDocumentFields(createdSignatureRequest.Documents[0].ID);

            ValidateDocumentFields(expectedDocument, documentFields);
        }
예제 #5
0
        public void SendSignatureRequestWithFieldsTest()
        {
            // build signature request
            SignatureRequest signatureRequest = new SignatureRequest();

            signatureRequest.SendEmails = false;

            // add document from file and one signer
            Document document = new Document(relativePathToFileOfTheDocument);
            Signer   signer   = new Signer(signers["signer1"]["email"]);
            // add field with API ID to be able find it latter
            Field field1 = new Field(0, new int[] { 100, 100, 300, 200 }, FieldType.SIGNATURE);

            field1.ApiId = "Fild1ApiId";

            signer.Fields.Add(field1);
            Field field2 = new Field(0, new int[] { 350, 100, 400, 220 }, FieldType.TEXT);

            field2.ApiId = "Fild2ApiId";
            signer.Fields.Add(field2);

            document.Signers.Add(signer);
            signatureRequest.Documents.Add(document);

            // execute signature request
            DigiSignerClient client = new DigiSignerClient(apiId);
            SignatureRequest signatureRequestResponse = client.SendSignatureRequest(signatureRequest);

            // validate signature request response
            ValidateResponse(signatureRequest, signatureRequestResponse, true);

            // get and validate signature request from database
            string           signatureRequestId      = signatureRequestResponse.SignatureRequestId;
            SignatureRequest createdSignatureRequest = client.GetSignatureRequest(signatureRequestId);

            ValidateSignatureRequest(signatureRequest, createdSignatureRequest, true);

            // get and validate fields from database
            Document       expectedDocument = signatureRequest.Documents[0];
            DocumentFields documentFields   = client.GetDocumentFields(createdSignatureRequest.Documents[0].ID);

            ValidateDocumentFields(expectedDocument, documentFields);
        }
예제 #6
0
        public void SendSignatureRequestTestAsBundle()
        {
            // build signature request
            SignatureRequest signatureRequest = new SignatureRequest();

            signatureRequest.SendEmails            = false;
            signatureRequest.SendDocumentsAsBundle = true;
            signatureRequest.BundleTitle           = "Bundle title";
            signatureRequest.BundleSubject         = "My subject";
            signatureRequest.BundleMessage         = "My message";

            // add document with possible attributes
            Document document = new Document(relativePathToFileOfTheDocument);

            Signer signer1 = new Signer(signers["signer1"]["email"]);

            signer1.Order = 1;

            Signer signer2 = new Signer(signers["signer2"]["email"]);

            signer2.Order = 2;

            document.Signers.Add(signer1);
            document.Signers.Add(signer2);

            signatureRequest.Documents.Add(document);

            // execute signature request
            DigiSignerClient client = new DigiSignerClient(apiId);
            SignatureRequest signatureRequestResponse = client.SendSignatureRequest(signatureRequest);

            // validate signature request response
            ValidateResponse(signatureRequest, signatureRequestResponse, false);

            // get and validate signature request from database
            String           signatureRequestId      = signatureRequestResponse.SignatureRequestId;
            SignatureRequest createdSignatureRequest = client.GetSignatureRequest(signatureRequestId);

            Assert.Equal(2, createdSignatureRequest.Documents[0].Signers.Count);
            ValidateSignatureRequest(signatureRequest, createdSignatureRequest, false);
        }
예제 #7
0
        public void SendSignatureRequestForTemplateTest()
        {
            // build signature request
            SignatureRequest signatureRequest = new SignatureRequest();

            signatureRequest.SendEmails = false;

            Document document = new Document();

            document.ID      = idOfTheTemplate;
            document.Title   = documentValues["title"];
            document.Subject = documentValues["subject"];
            document.Message = documentValues["message"];

            Signer signer1 = new Signer(signers["signer1"]["email"]);

            signer1.Order = 1;

            Signer signer2 = new Signer(signers["signer2"]["email"]);

            signer2.Order = 2;

            document.Signers.Add(signer1);
            document.Signers.Add(signer2);
            signatureRequest.Documents.Add(document);

            // execute signature request
            DigiSignerClient client = new DigiSignerClient(apiId);
            SignatureRequest signatureRequestResponse = client.SendSignatureRequest(signatureRequest);

            // validate signature request response
            ValidateResponse(signatureRequest, signatureRequestResponse, false);

            // get and validate signature request from database
            String           signatureRequestId      = signatureRequestResponse.SignatureRequestId;
            SignatureRequest createdSignatureRequest = client.GetSignatureRequest(signatureRequestId);

            ValidateSignatureRequest(signatureRequest, createdSignatureRequest, false);
        }