Files
PowderCoatingLogix/src/PowderCoating.Core/Enums/InvoiceEnums.cs
T
spouliot f671f7e62e Add WisePOS E in-person card payments (Stripe Terminal)
Server-driven Stripe Terminal integration for taking in-person card payments
against an invoice, running on the same Stripe Connect connected account used
for online payments. No native app or Terminal SDK — the WisePOS E is driven
from the web backend via Stripe's REST API.

- Domain: TerminalReader entity + status enum, PaymentMethod.CardReader,
  Company.StripeTerminalLocationId / TerminalSurchargeEnabled, DbSet + tenant
  filter + indexes, IUnitOfWork repo, migration AddTerminalReaders (additive).
- StripeConnectService: location/reader registration, list, delete, process
  payment on reader, status poll, cancel, and a test-mode simulated tap. All
  routed to the connected account like the existing online-payment methods.
- TerminalController: admin reader management + per-invoice ProcessPayment,
  PaymentStatus (poll), CancelPayment, SimulateTap (test mode only). Stores the
  PaymentIntent id on the invoice; the webhook remains the authoritative writer.
- PaymentController webhook: HandlePaymentSucceededAsync records source=terminal
  payments as CardReader (online path unchanged — no source key means no change);
  new terminal.reader.action_failed handler for declines/timeouts (notification
  only, no ledger mutation). Refund path reused unchanged.
- UI: Card Readers settings tab (register/list/deactivate + in-person surcharge
  toggle, default off with a compliance warning) and an invoice "Take Card
  Payment" modal with live status polling. External JS per project convention.
- Feature bundled with the existing online-payments entitlement (no new plan
  flag); additionally requires StripeConnectStatus == Active.
- Help: HelpKnowledgeBase + Invoices help article updated.
- Tests: TerminalController validation + surcharge-routing tests (241 pass).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 18:57:58 -04:00

91 lines
2.1 KiB
C#

namespace PowderCoating.Core.Enums;
public enum RefundStatus
{
Pending = 0, // Recorded — shop has not yet physically issued the refund
Issued = 1, // Refund has been sent to the customer
Cancelled = 2
}
public enum CreditMemoStatus
{
Active = 0,
PartiallyApplied = 1,
FullyApplied = 2,
Voided = 3
}
public enum InvoiceStatus
{
Draft = 0,
Sent = 1,
PartiallyPaid = 2,
Paid = 3,
Overdue = 4,
Voided = 5,
WrittenOff = 6
}
public enum PaymentMethod
{
Cash = 0,
Check = 1,
CreditDebitCard = 2,
BankTransferACH = 3,
DigitalPayment = 4,
StoreCredit = 5, // Refund issued as store credit (creates a CreditMemo)
CardReader = 6 // In-person card payment via a Stripe Terminal reader (WisePOS E)
}
/// <summary>
/// Local lifecycle state for a registered Stripe Terminal card reader. Distinct from Stripe's
/// network status (online/offline) — this tracks whether the shop still uses the reader.
/// </summary>
public enum TerminalReaderStatus
{
Active = 0,
Deactivated = 1 // Unregistered from Stripe and hidden from the shop's reader list
}
public enum GiftCertificateStatus
{
Active = 0,
PartiallyRedeemed = 1,
FullyRedeemed = 2,
Expired = 3,
Voided = 4
}
public enum OnlinePaymentStatus
{
NotApplicable = 0, // Online payments not enabled for this company
Pending = 1, // Link generated, not yet paid
PartiallyPaid = 2, // Customer has made one or more partial payments
Paid = 3, // Fully paid via online payment
Refunded = 4 // Online payment was refunded via Stripe
}
public enum OnlinePaymentSurchargeType
{
None = 0,
Percent = 1, // e.g. 2.9% of transaction
Flat = 2 // e.g. $1.50 flat fee
}
public enum StripeConnectStatus
{
NotConnected = 0,
Pending = 1, // OAuth started, not yet completed
Active = 2, // Connected and ready to accept payments
Disabled = 3 // Manually disabled or deauthorized by the company
}
public enum GiftCertificateIssuedReason
{
Sold = 0,
Prize = 1,
Promotional = 2,
Goodwill = 3,
Other = 4
}