invoice-and-dispute
v1.1.7
Published
Reusable React invoice and dispute flow, exported as the InvoiceAndDisputePage component
Maintainers
Readme
Invoice and Dispute Library
A reusable React invoice and dispute flow component library with a local playground app for previewing the UI.
Requirements
- Node.js 18+ (or compatible LTS)
- npm 10+ (or yarn/pnpm if preferred)
Install dependencies
npm installRun the local playground app
The project ships with a playground app under playground/.
npm run devThen open the local URL printed by Vite, usually:
http://localhost:5173Preview the production build locally
npm run build
npm run previewThen open the preview URL printed by Vite.
Configuration (runtime props)
Consumers configure the backends and Stripe key at runtime by passing a
config prop to InvoiceAndDisputePage — no rebuild required per environment:
import { InvoiceAndDisputePage } from "invoice-and-dispute";
<InvoiceAndDisputePage
config={{
enforcementBaseUrl: "https://compliance.staging.premiumparking.com",
complianceBaseUrl: "https://compliance.staging.premiumparking.com",
paymentsBaseUrl: "https://compliance.staging.premiumparking.com",
stripePublishableKey: "pk_test_xxx",
source: "glideparcs",
mpsBaseUrl: "https://premiumneworleans.mpspark.com", // optional; MPS invoices pay in-app as Premium
disputeMaxFileMb: 10,
}}
/>;Point enforcementBaseUrl at glideparcs-enforcement.
- Invoice lookup and dispute use existing
/v1/admiralAPIs (/violations.json,/violations/citations.json,/customer_appeal_forms.json). - TextPay snapshot and SPA card pay use
/enforcement-web(/textpay_payments,/payment_intents,/payments).
paymentsBaseUrl is only a fallback for the same /enforcement-web payment host.
All keys are optional. Resolution precedence for each value is:
- The
configprop above. - A build-time
VITE_*env var (see.env.example) — mainly for the playground. - The Vite dev-proxy path (
/pp-enforcement,/pp-compliance,/pp-payments), which only works while runningnpm run dev.
Package contents
src/– library source codeplayground/– local demo app for the component librarydist/– build output after runningnpm run buildscripts/– build utilities (for examplescripts/scope-css.mjs)
Available npm scripts
npm run dev/npm run playground- start the Vite development server usingplayground/vite.config.jsnpm run build- build the library and run the CSS scoping scriptnpm run preview- preview the built playground app locallynpm test- run payment/MPS client contract tests
