IPWorks EDI 2020 Node.js Edition

Questions / Feedback?

VerifyReceipt Method

Verifies an asynchronous MDN receipt.

Syntax

as2sender.verifyReceipt([callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

VerifyReceipt verifies the receipt in MDNReceipt against OriginalContentMIC, MessageId and the preferences specified in MDNOptions. The method operates similarly to Post: After the method finishes, the MDNReceipt, ReceiptSigningProtocol, and ReceiptSignerCert properties will be populated with the appropriate values.

The method operates synchronously, and will throw an exception if any errors or warnings occur. Errors might include a failure to decrypt or authenticate the receipt, the absence of an MDN when one was requested, TCP/IP errors, or any errors reported by the server in the MDN. Warnings might include the return of an unsigned receipt when a signed receipt was requested, or other warnings reported by the server in the MDN.

If an exception is thrown the error code will correspond to the severity of the warning or error, allowing client software to determine whether or not to accept the reply. If multiple errors occur, the exception will return a special error code, and the error message will contain a line for each error's code and description; i.e. "423: Failed to authenticate sender". If the error(s) is/are not fatal processing will not be interrupted, and the relevant properties will be populated as normal.

This method should be used to verify receipts received asynchronously; i.e., not in the HTTP reply to a POST. When posting, asynchronous MDN delivery may be requested by setting MDNDeliveryOption.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Node.js Edition - Version 20.0 [Build 8203]