Skip to content

Pay by mail

Steps

  1. The user selects Pay by mail, a form post with no anti-forgery token (BR-APP-006, BR-APP-007).
  2. PopulateModel runs with the user checks (BR-APP-002, BR-APP-003). No updater role check is made in the handler (TD-APP-003).
  3. The handler gets the statement print XML from NDReimbursementAPI.Client and renders a PDF with IDocumentsCoreClient.GeneratePreview. Both are described from the application call site; package internals are unknown**.
  4. 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 sets IsSuccessful to 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 its ErrorMessage block 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.

Sources

  • src/NDReimbursementWebApp/Pages/NDReimbursement.cshtml.cs
  • src/NDReimbursementWebApp/Pages/NDReimbursement.cshtml