Pay by mail¶
Steps¶
- The user selects Pay by mail, a form post with no anti-forgery token (BR-APP-006, BR-APP-007).
PopulateModelruns with the user checks (BR-APP-002, BR-APP-003). No updater role check is made in the handler (TD-APP-003).- The handler gets the statement print XML from
NDReimbursementAPI.Clientand renders a PDF withIDocumentsCoreClient.GeneratePreview. Both are described from the application call site; package internals are unknown**. - The bytes are written to the response as
application/pdf; the last byte is dropped (Preview.Length - 1, TD-APP-009); the download statement handler shares this chain and has the same defect. If the preview payload is not a string, the handler setsIsSuccessfulto false and an "error has occurred while retrieving statement" message and re-renders the page. A caught exception does the same after logging it. The handler only sets the error state; the view renders itsErrorMessageblock only when!IsSuccessful && !HasPolicyNumber, so the message may not be visible when a policy number is in context.
Process flow¶
The diagram shows the PDF response and the two failure paths that set error state and re-render the page; display of the message depends on the view condition.
flowchart TD
A["Pay by mail"] --> B["PopulateModel"]
B --> C["Get print XML via API client"]
C --> D["GeneratePreview via documents client"]
D --> P{"Payload is a string?"}
P -- Yes --> E["Write PDF response"]
P -- No --> F["Set error state,<br>re-render page"]
B -. "Exception caught, logged" .-> F
C -. "Exception caught, logged" .-> F
D -. "Exception caught, logged" .-> F
Note: Statements marked with
**could not be confirmed; treat as unknown until verified.
Related documentation¶
Sources¶
- src/NDReimbursementWebApp/Pages/NDReimbursement.cshtml.cs
- src/NDReimbursementWebApp/Pages/NDReimbursement.cshtml