afterApproval (lib/approval-outcome.ts)

rekey · apps/portal/src/lib/approval-outcome.ts · typescript · MIT
payments

Helper functions for handling payment approval outcomes and user messaging in checkout flows.

// Source: https://github.com/rekey-dev/rekey | License: MIT | Copyright 2026 Rekey
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * What the checkout page does after the provider has said yes in its window.
 *
 * Once the provider has approved, the subscription or order exists there and
 * completes from the provider's webhook whatever Rekey's confirmation call
 * answers. Telling the buyer "you have not been charged" at that point invites
 * a second attempt and a second purchase. So only one answer stops the page
 * from waiting for the webhook: Rekey checked with the provider and the
 * provider does not confirm this approval for this checkout. Everything else (a timeout, a 5xx,
 * a refusal limit, a network error) waits and then returns the buyer to the
 * app, 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key