Blocks / Commerce

QR Payment (poll)

The non-card checkout the catalogue was missing: issue an invoice, show a QR the user scans in their banking app, poll until the provider confirms.

$pnpm exec shadcn add @intelligo/payment-poll

Run it inside an app made by intelligo create. Anywhere else, name the registry and install the base first.

Loading preview…
about this block

The non-card checkout the catalogue was missing: issue an invoice, show a QR the user scans in their banking app, poll until the provider confirms. Provider-agnostic — QPay, SocialPay, PIX, UPI, PromptPay all fit — with the invoice recorded and a paid one granted on the server; lib/local-payment.ts says what each reference costs and grants. Requires the pricing item for lib/billing-config.ts's CURRENCY. LocalPaymentButton opens the modal for one reference and refreshes the page once paid; bind it in the pricing item's lib/plan-card-config.tsx to offer the QR rail on every plan card, and in the billing-settings item's lib/credit-bundle-config.tsx on every credit bundle.

yours to edit
  • lib/local-payment.ts
  • lib/payment-poll-config.ts

messages/en/payment-poll.json

Everything else is used verbatim; a deployment varies through these files and translations.How seams work →

requires
built from

button, dialog, spinner

npm packages it adds

@intelligo-dev/auth · @intelligo-dev/billing · @intelligo-dev/core · @intelligo-dev/next · lucide-react · server-only · next-intl

what shadcn add writes · 9 files
Components
  • components/billing/local-payment-modal.tsx
  • components/billing/local-payment-button.tsx
Actions, config and messages
  • actions/payment.ts
  • lib/local-payment.ts
  • lib/payment-poll-config.ts
  • lib/local-payment-grant.ts
  • app/api/payments/local/settle/route.ts
  • app/api/webhooks/local-payment/route.ts
  • messages/en/payment-poll.json

Ready to try it? Three commands and the app runs against a stub model.