Overview
Palbase Payments is the provider-agnostic payment processing, closed-loop double-entry wallet, and recurring billing module. Every project gets a single canonical PaymentIntent model, 1:N attempt history, deterministic multi-provider routing across Stripe and iyzico, plus double-entry closed-loop wallets with QR spend tokens and zero-drift accounting verification.
Payments vs In-App Purchases
Palbase separates direct payment rails from app-store entitlements into two clean modules:
| Module | What it owns | SDK surface |
|---|---|---|
Payments (/payments/*) | Direct card checkout (Stripe and iyzico), deterministic routing, 1:N attempts, closed-loop double-entry wallets, two-phase holds, QR spend tokens, recurring subscriptions, payers your server names with their saved cards and taxed Stripe invoices, refunds (original card or instant wallet), disputes and audit ledger. | pb.payments, palbase/web/payments-ui, PalbasePayments/PalbasePaymentsUI, palbase-payments/palbase-payments-ui, createServer().payments, Palbase.payments |
In-App Purchases (/iap/*) | App Store StoreKit 2, Google Play Billing, unified product catalog, paywalls, placements, A/B experiments, offers, coupons, customer entitlements, credits and quotas. | pb.iap, palbase/web/paywall, PalbaseIAP/PalbaseIAPUI, palbase-iap, createServer().iap, Palbase.iap |
When a customer buys a catalog product on the web through In-App Purchases, the iap module delegates payment collection cleanly to your connected Payments channels over internal RPC — so you connect Stripe or iyzico once under Payments › Channels and use it everywhere.
Core concepts
- PaymentIntent: Server-authoritative record of an intent to collect money (
amountin minor units,currency,capture_method, optional splitwallet_amount+card_amount, canonicalstatus). By default only your server (palbase/serverorpalbase/backend) may callPOST /payments/intents. - 1:N Attempts: Every card charge, 3DS redirect, or OTP challenge appends an immutable attempt row (
GET /payments/intents/{intent_id}/attempts) recording the provider, round-trip latency, fees, canonicaldecline_code, andretryableflag. - Canonical NextAction: Whether a payment routes to Stripe Checkout, iyzico 3DS iframe, or an OTP challenge, the backend returns one unified
next_action(none,redirect,embed, orotp).pb.payments.present()andopenPaymentSheet()handle all of them automatically with zero polling. - Closed-loop Wallets & Double-Entry Ledger: Every wallet top-up, spend, two-phase hold, P2P transfer, instant wallet refund, and chargeback debit writes balanced debit and credit legs. Run
palbase payments:audit:driftat any time to verify zero drift across every account and transaction.
Quick start
- Connect a channel in Studio (Payments › Channels) or via CLI (
palbase payments:stripe:installorpalbase payments:iyzico:connect). See Channels & Routing. - Create a PaymentIntent on your server with
createServer().payments.createIntentorPalbase.payments.createIntent. See Server & Backend SDK. - Present checkout in your web app using
openPaymentSheetfrompalbase/web/payments-uiorpb.payments.present(). See Checkout & PaymentSheet. - React to settlement in your backend with
@On("payments.payment.succeeded")or verified webhooks. See Webhooks.