Skip to content
← Public packages

@kentcdodds/stripe

Stripe helpers for customers, payments, invoices, subscriptions, products, payment links, refunds, and balance.

src/payments-default.ts

18 lines · 775 B · TypeScript
import payments from './payments.ts'

/**
 * Stripe payments dispatcher (default `./payments` action). Defaults to list-charges.
 * Use when routing payment-intent, charge, or refund helpers; named helpers remain
 * on the `payments` namespace.
 *
 * @param input.action - list-charges (default), list-payment-intents, get-payment-intent, search-payment-intents, get-charge, search-charges, list-refunds, create-refund
 * @returns Action result for the selected Stripe helper
 *
 * @example
 * import payments from 'kody:@kentcdodds/stripe/payments'
 * const result = await payments({ customerId: 'cus_123' })
 * // => { hasMore: false, charges: [...] }
 */
export default async function paymentsDefault(input: Record<string, unknown> = {}) {
	return await payments(input)
}