Use this method to fetch a single transaction by its ID, including its stage breakdown. Call it after a payment flow completes (for example, when client.setupApplePay(), client.setupGooglePay(), or client.setupBuy() emits complete) to poll for the final transaction status.For request and response details, see the Get a transaction API.
After a payment flow emits complete, poll client.getTransaction() until the transaction reaches a terminal status. The set of terminal statuses depends on the flow — check the Transaction object reference for the values that apply.
Poll for final status
const TERMINAL_STATUSES = new Set(["completed", "failed"]);async function pollTransaction(transactionId: string) { while (true) { const result = await client.getTransaction(transactionId); if (!result.ok) { throw new Error(result.error.message); } const transaction = result.value.data; if (TERMINAL_STATUSES.has(transaction.status)) { return transaction; } await new Promise((resolve) => setTimeout(resolve, 3000)); }}
Webhook support is coming soon. Until then, use polling to track transaction
status.