Amélioré Affiliates

Affiliate commissions now follow refunds and disputes

When Magpie refunds part of a plan payment, the same share of its affiliate commission is reversed. A payment refunded in full or disputed reverses all of it, and a dispute Magpie wins gives it back. Your affiliate links page shows what each payment still earns.

BillingService handles charge.refunded and charge.dispute.created, .updated and .closed on /billing/webhook: it reads the charge again from Stripe, finds the plan invoice from its PaymentIntent (GET /v1/invoice_payments) and calls AffiliateCommissionService::followPayment() with Stripe's totals, so a repeated or late event changes nothing twice. affiliate_commissions gains reversedCents and reversalSource (migration 10968); a website admin's reversal stands whatever the payment does.