Payment Setup
The payment module is the core of the Headless SDK. It lets you discover which payment methods are configured for a store, tokenize cards, and process payments with automatic 3DS, redirect, and polling handling.Discover Available Payment Methods
Every store has a payment setup config — a map of payment methods (card, Apple Pay, Google Pay, Klarna, etc.) with their enabled/disabled state, processor IDs, and flow IDs.Just the enabled method keys
Express methods with browser availability
ApplePaySession.canMakePayments() in the browser to determine Apple Pay availability.
Card Payment Flow
Recommended: processPayment()
processPayment() is the high-level orchestrator that handles the entire payment lifecycle automatically:
- Submits payment to the processor
- If 3DS / bank auth is required → redirects the user and resumes on return
- If the payment is async → polls until a terminal status
- Returns a typed
ProcessPaymentResult
tokenizeCard() requires @tagadapay/core-js as an optional peer dependency. Install it: npm install @tagadapay/core-js.Return type: ProcessPaymentResult
The return value is a discriminated union — check result.status for exhaustive handling:
3DS Return URL
After a 3DS redirect, the bank sends the user back to your page with query parameters. The SDK auto-detects these and resumes the payment:- React (
usePayment): Handled automatically on mount — detects?paymentAction=...params, polls for result, fires callbacks. - Vanilla JS: Call
tagada.payment.resumeAfterRedirect(paymentId)manually after detecting the return.
Express Checkout
Apple Pay
Google Pay
Redirect APMs (Klarna, iDEAL, etc.)
React Hook
Full Hook API
Low-Level API
For advanced use cases, you can create instruments and process payments separately:Need even more control? For instrument-level management, MIT (merchant-initiated) charges, auth+capture flows, or mobile app integrations, see the Low-Level Payments guide which uses
@tagadapay/core-js + REST directly.