caelum0x e8ec94cf9c feat: Solana Pay checkout routes and wallet UI
- POST solana/pay-url saves buyer fields, returns transfer-request QR
  payload + transaction-request link bound to the session reference
- GET/POST solana/tx: Solana Pay transaction request; server builds the
  unsigned USDC tx (ATA create-idempotent + TransferChecked + reference)
- GET solana/status: finds the payment by reference, verifies, confirms
  and delivers once (idempotent, safe to poll)
- SolanaPay component: uqr QR, Wallet Standard connect +
  solana:signAndSendTransaction, 2s polling, paid state with Solscan link
- checkout page renders SolanaPay for Solana sessions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 14:59:16 +03:00

11 lines
418 B
TypeScript

/**
* Public origin of this checkout deployment, for absolute links handed to
* wallets (Solana Pay transaction requests, icons). `CHECKOUT_PUBLIC_URL`
* wins; otherwise the request's own origin.
*/
export function publicOrigin(request: Request): string {
const configured = process.env.CHECKOUT_PUBLIC_URL?.trim();
if (configured) return configured.replace(/\/$/, "");
return new URL(request.url).origin;
}