- src/payments: provider registry and PaymentProvider interface (createCheckout, verifyWebhook/parseWebhook, getTransaction, refund, listTransactions as capabilities), Yoco as the first provider. All four direct Yoco checkout calls go through payments.createCheckout. - Webhook split into the provider part (signature, parsing) and shared processing; same URL (/api/webhooks/yoco), same behaviour. - YocoTransaction renamed in place to ProviderTransaction (+ provider, unique per provider + externalId); Payment.provider added and backfilled to "yoco". Payment.method stays the wallet type so cashups are unchanged. - Site settings → Payments: Enabled toggle and order per provider; Yoco's settings shown while it's enabled. R15 minimum for all online payments. - New endpoint names (/api/payments/checkout, /api/provider-transactions); the old /yoco-checkout and /yoco-transactions paths still work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
49 lines
2.6 KiB
TypeScript
49 lines
2.6 KiB
TypeScript
import React from "react";
|
|
import { Wallet, RotateCcw, HandHeart, ScanLine, Link2 } from "lucide-react";
|
|
import { GuideItem } from "@/components/shared/GuideItem";
|
|
import type { HelpContent } from "./types";
|
|
|
|
/** Help content for /dashboard/supervisor/payments. */
|
|
export const supervisorPaymentsHelpContent: HelpContent = {
|
|
title: "Payments help",
|
|
subtitle: "Record payments, refunds, donations, and reconcile card transactions.",
|
|
tabs: [
|
|
{
|
|
key: "modes",
|
|
label: "The five modes",
|
|
icon: Wallet,
|
|
content: (
|
|
<div className="space-y-4">
|
|
<div className="space-y-4">
|
|
<GuideItem icon={Wallet} title="Payment" tone="brand">
|
|
Record a manual payment against a registration or a donation, with amount, method, and an optional backdated time.
|
|
</GuideItem>
|
|
<GuideItem icon={RotateCcw} title="Refund" tone="rose">
|
|
Refund a specific payment or a registration — pick the user, target, amount and method, and a reason.
|
|
</GuideItem>
|
|
<GuideItem icon={HandHeart} title="Donations" tone="rose">
|
|
Assign an unassigned donation to a registration with an outstanding balance. Donations can be partially allocated, leaving the remainder available for another registration. Money from "Sponsor a spot" is marked as a sponsorship. Tick "Only the sponsorship pool" to assign just those, and you'll see the sponsor's message. The Donations breakdown report shows each event's pool: received, assigned and remaining.
|
|
</GuideItem>
|
|
<GuideItem icon={ScanLine} title="Reconcile" tone="green">
|
|
Match unreconciled online payments (from Yoco, or another payment provider) to a registration, log them as a donation, or ignore them.
|
|
</GuideItem>
|
|
<GuideItem icon={Link2} title="Payment Link" tone="violet">
|
|
Generate an online payment link for a user — copy it or send by email/WhatsApp. It uses the default payment provider (Site settings → Payments). Online payments must be at least R15. Generating a new link invalidates the previous one.
|
|
</GuideItem>
|
|
</div>
|
|
</div>
|
|
),
|
|
},
|
|
{
|
|
key: "sidebar",
|
|
label: "Today panel",
|
|
icon: Wallet,
|
|
content: (
|
|
<div className="space-y-4">
|
|
<p>The sidebar shows today's payment count, revenue, and donation count, plus a recent-payments feed. Internal donation-allocation entries are excluded there to avoid double-counting.</p>
|
|
</div>
|
|
),
|
|
},
|
|
],
|
|
};
|