PaymentFlowManager is the top-level component that renders the complete TapRails payment experience. It handles all UI states, NFC operations, and API calls internally.
Import
Usage
Props
Configuration object that controls which flow to render and how to handle events.
Called when the merchant cancels the flow. Used to unmount the component. Required when
config.type === 'merchant'.Called when the customer cancels the flow. Required when
config.type === 'customer'.PaymentFlowConfig
Determines which payment flow to render.
'merchant' shows the amount input + HCE waiting screen. 'customer' shows the tap instruction + processing screens.Called when the payment flow completes successfully. Receives
MerchantFlowData or CustomerFlowData depending on the flow type.Called when the user explicitly cancels the flow.
Called when an unrecoverable error occurs. The component remains mounted with an error screen — call your cancel handler from here to unmount if needed.
Callback Data Types
MerchantFlowData (onComplete for merchant)
CustomerFlowData (onComplete for customer)
Flow State Machines
Merchant
Customer
Examples
PaymentFlowManager renders as a full-screen overlay. Wrap it in a conditional render and toggle visibility via state, rather than using the visible prop pattern.
