Created
October 30, 2023 13:21
-
-
Save bjoerntx/1774ebe77e2e7089e2ead2605059ed59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost] | |
public IActionResult ProcessSignature([FromBody] TXTextControl.Web.MVC.DocumentViewer.Models.SignatureData data) | |
{ | |
if (data == null) | |
{ | |
return BadRequest(); | |
} | |
string signatureDataJson = JsonConvert.SerializeObject(data.SignatureLines); | |
string hash = CreateHash(signatureDataJson); | |
Envelope envelope = new Envelope | |
{ | |
DocumentId = data.UniqueId, | |
SignatureHash = hash, | |
SignatureData = signatureDataJson | |
}; | |
AddEnvelope(envelope); | |
if (SaveSignedPDF(data, envelope)) | |
{ | |
return Ok(true); | |
} | |
else | |
{ | |
return StatusCode(500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment