usePaymentStatus polls the TapRails backend for payment confirmation. Use this after initiating a payment to know when it’s been confirmed on-chain.
Import
Usage
Options
The payment ID to poll. Can also be passed to
startPolling() instead.Interval between status checks in milliseconds. Default:
2000 (2 seconds).If
true, polling starts immediately on mount using the provided paymentId. Default: false.Return Value
Starts polling. Optionally accepts a
paymentId to override the one from options.Stops the polling interval.
One-shot status fetch without starting continuous polling.
true while the polling interval is active.The latest status response from the backend.
true when status.status === 'confirmed'.true when status.status === 'failed'.On-chain transaction hash once confirmed.
Unix timestamp (ms) of confirmation.
Error from the most recent poll.
Clears the
error state.Stops polling and clears all state.

