Exemplo n.º 1
0
        public void UpdateStatus(EnvelopesInformation info)
        {
            foreach (var item in info.Envelopes)
            {
                if (item.Status == "Completed")
                {
                    EnvelopesApi obj = new EnvelopesApi();
                    item.PurgeState = "documents_and_metadata_queued";
                    EnvelopeUpdateSummary envelopeUpdateSummary = obj.Update(_accountId, item.EnvelopeId, null, null);
                }
            }
            string directorypath = Server.MapPath("~/App_Data/" + "Files/");

            if (!Directory.Exists(directorypath))
            {
                Directory.CreateDirectory(directorypath);
            }
            //Pass the filepath and filename to the StreamWriter Constructor
            StreamWriter sw = new StreamWriter(directorypath);

            //Write a line of text
            sw.WriteLine("This is a webHook call from DocuSign");
            //Close the file
            sw.Close();
        }
        public void PutEnvelope_CorrectAccountIdEnvelopeIdAndEnvelope_ReturnEnvelopeUpdateSummary()
        {
            CreateEnvelopeMethod.CreateEnvelope_CorrectAccountIdAndEnvelopeDefinition_ReturnEnvelopeSummary(
                ref _testConfig);

            var envelope = new Envelope()
            {
                EnvelopeId   = _testConfig.EnvelopeId,
                EmailSubject = "new email subject",
                EmailBlurb   = "new email message",
                Status       = "sent"
            };

            EnvelopeUpdateSummary envelopeUpdateSummary = _envelopesApi.Update(_testConfig.AccountId, _testConfig.EnvelopeId, envelope);

            Assert.IsNotNull(envelopeUpdateSummary?.EnvelopeId);

            Envelope renewedEnvelope = _envelopesApi.GetEnvelope(_testConfig.AccountId, _testConfig.EnvelopeId);

            Assert.AreEqual(envelope.EmailSubject, renewedEnvelope.EmailSubject);
            Assert.AreEqual(envelope.EmailBlurb, renewedEnvelope.EmailBlurb);
            Assert.AreEqual(envelope.Status, renewedEnvelope.Status);
        }