Let clients cancel Pay at Close or change payment method from the portal

Objective

  • Allow clients who have selected Pay at Close (Flex Fund) to cancel that choice or change to another payment method (e.g. credit card) from the client portal, before they complete the ISN agreement.
  • Reduce the need for clients to contact support when they change their mind, and avoid client care having to use ISN directly for cancellations.

Background

  • Today, if a client starts the Pay at Close flow and then wants to pay by credit card instead, they often must contact support; changing payment method can involve multiple steps and delays.
  • Product feedback is that it would be ideal for the client to cancel or change payment method in the portal (e.g. “Never mind, I want to pay by credit card”) so support can say “go into your portal and change the payment method.”
  • The backend already supports cancelling a PAC order: DELETE /isn/cancel-order/:paymentId in attik-backend/src/routes/isnPayments.ts calls cancelISNOrder, updates the payment to canceled, and clears the PAC payment so the client can choose another method. That route is currently used with company context (res.locals.company via getPaymentSettings). The portal needs a way for the client to trigger this (or an equivalent client-scoped endpoint) and a clear UI so they can cancel or change payment before completing the ISN form.

Scope

Backend

  • Cancel logic lives in attik-backend/src/routes/isnPayments.ts (DELETE /cancel-order/:paymentId; expects inspectionId in body for ownership). attik-backend/src/util/functions/isn/isnApi.ts exposes cancelISNOrder. In scope: ensure the portal can call cancel in a secure way—either by exposing the existing route to client-portal auth (e.g. JWT scoped to the inspection/client) or by adding a client-portal–specific route that validates the requesting user can act on that inspection and then performs the same cancel flow.

Frontend

  • Client portal (report/work order view where the client sees Pay at Close and the “complete agreement” banner) needs a visible control (e.g. button: “Cancel Pay at Close” or “Change payment method”) that appears when the client has a pending PAC order and has not yet completed the ISN agreement. Clicking it should call the cancel endpoint and then allow the client to choose another payment method. In scope: placement, copy, and flow so the client can cancel or switch payment without leaving the portal or calling support.
  • Consider the state after cancel: the work order should show that Pay at Close was canceled and allow selecting credit card or another option; any “complete your agreement” banner should be updated or removed once canceled.

References

  • attik-backend/src/routes/isnPayments.ts (cancel-order route, getPaymentSettings).
  • attik-backend/src/util/functions/isn/isnApi.js (cancelISNOrder).
  • Client portal payment/agreement UI (where PAC and “complete agreement” are shown).

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board
🏠

Main App

Date

3 months ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.