Refunds
Reverse a charge fully or partially with payments.refund() — a single API across every provider that supports refunds.
payments.refund() reverses a charge. Pass just the charge id for a full
refund, or an amount for a partial one. The call returns a normalized
RefundResult and fires your onRefundIssued hook.
Full refund
const refund = await payments.refund({
chargeId: charge.id,
});
refund.status; // "succeeded" | "pending" | "failed"Partial refund
Supply an amount in the same currency as the original charge (integer
minor units, as always).
import { money } from "@radonsdk/payments";
await payments.refund({
chargeId: charge.id,
amount: money(500, "USD"),
});The input
chargeIdstringrequiredThe id from the original ChargeResult.
amountMoneyOmit for a full refund. When present, must match the charge's currency.
reasonstringOptional note forwarded to providers that accept one.
Route to the same provider
If you configured several providers, pass { provider } so the refund hits the
processor that took the payment:
await payments.refund({ chargeId }, { provider: "stripe" });Idempotency on retries
Network hiccup during a refund? Pass an idempotencyKey (where supported, e.g.
Stripe) so a retry reverses the charge once, not twice.
Not every provider refunds the same way
Refund support and timing vary by processor — card refunds may settle instantly
or over days; some crypto and BNPL providers have restrictions. If a provider
can't perform a refund, Radon throws a typed
UnsupportedOperationError naming the provider and
operation — never a silent no-op. Check provider.capabilities when in doubt.