Example #1
0
        private static void RemindAdobeEnvelope(ESignAccount account, ESignEnvelopeInfo actualEnvelope)
        {
            var adobeSignClient = AdobeSignClientBuilder.Build(account);
            var reminderModel   = GetReminderCreationInfoModel(actualEnvelope);

            ESignApiExecutor.TryExecute(() => adobeSignClient.DocumentsService.SendReminder(reminderModel), adobeSignClient);
        }
Example #2
0
        private static void RedirectToAdobeSign(ESignAccount account, ESignEnvelopeInfo envelope)
        {
            var adobeSignClient = AdobeSignClientBuilder.Build(account);
            var url             = ESignApiExecutor.TryExecute(() => adobeSignClient.DocumentsService
                                                              .GetAgreementAssets(envelope.EnvelopeID), adobeSignClient).viewURL;

            throw new PXRedirectToUrlException(url, string.Empty);
        }
Example #3
0
        public static void CancelAdobeSignEnvelope(ESignAccount account, ESignEnvelopeInfo actualEnvelope,
                                                   string voidReason)
        {
            var adobeSignClient = AdobeSignClientBuilder.Build(account);

            ESignApiExecutor.TryExecute(
                () => adobeSignClient.DocumentsService.CancelAgreement(actualEnvelope.EnvelopeID, voidReason),
                adobeSignClient);
        }
Example #4
0
 public static void VoidAdobeSignEnvelope(ESignEnvelopeInfo envelope, ESignAccount account)
 {
     if (envelope.EnvelopeInfoID.HasValue)
     {
         var adobeSignClient = AdobeSignClientBuilder.Build(account);
         ESignApiExecutor.TryExecute(() => adobeSignClient.DocumentsService.DeleteAgreement(envelope.EnvelopeID),
                                     adobeSignClient);
     }
 }
Example #5
0
        private void AuthenticateAdobeSignAccount(ESignAccount account)
        {
            var companyId = PXAccess.GetCompanyName();
            var client    = AdobeSignClientBuilder.BuildUnauthorized(account, companyId);

            PXLongOperation.StartOperation(this, () =>
            {
                var loginUrl = client.Authentication.GetLoginPageUrl();
                throw new PXRedirectToUrlException(loginUrl, PXBaseRedirectException.WindowMode.InlineWindow,
                                                   string.Empty, false);
            });
        }
        private void GetAdobeAccessToken(string code, ESignAccount account)
        {
            var adobeSignClient = AdobeSignClientBuilder.BuildUnauthorized(Accounts.Current);
            var accessToken     = ESignApiExecutor.TryExecute(adobeSignClient.Authentication.CreateAccessToken, code, adobeSignClient);

            account.AccessToken  = accessToken.access_token;
            account.RefreshToken = accessToken.refresh_token;
            account.Status       = Messages.ESignIntegrationStatus.Connected;

            Accounts.Update(account);
            Actions.PressSave();
        }