Skip to content
Better Payment Examples
Official Examples

Better Payment Examples

Runnable, end-to-end storefronts and applications demonstrating Turkish payment providers, 3D Secure, verified callbacks and server-side safety in real-world frameworks.

Featured Example

Next.js + Prisma Storefront

examples/next-shop

A complete e-commerce shop with cookie cart, server-calculated totals, 3D Secure with verified callback redirection, payment event listeners, and an admin refund portal.

Next.js App RouterPrisma ORMSQLite3D SecureMockProviderPlaywright
Run locally in 2 commands
corepack pnpm@10.33.0 install
corepack pnpm@10.33.0 --filter next-shop dev

Architectural Highlights

Server-side Price Authority

The browser never sends payment amounts. The order total is freshly recalculated from the database on the server.

Unified 3D Secure Flow

The HTTP handler automatically verifies bank signatures, handles duplicate callbacks idempotently and redirects to the order status.

Zero-credential Testing

Runs instantly with MockProvider. Test successful payments, 3D failures, bank declines and timeouts using magic card numbers.

More examples in the repository

BackendAvailable

Express API & Webhook Service

Mount the Better Payment HTTP handler in an Express 4/5 backend with idempotency and webhook forwarding.

FullstackAvailable

React Router v7 / Remix

Serve payment actions and 3D Secure return endpoints directly from React Router resource routes.

EdgeAvailable

Cloudflare Workers Edge Checkout

Zero-cold-start payment gateway on the edge with toFetchHandler and KV / D1 storage.