Examples
Automatic Payment Buttons
React upsell example using FloPayAutomaticPaymentButton to keep purchases on the current page.
Automatic Payment Buttons Example
This example shows a same-page upsell on a success screen. The user keeps their original purchase details in view, clicks a single saved-payment button, and successful upsells are appended back into the page state.
Why This Pattern Works
- the page stays on the original success route instead of redirecting to a separate checkout screen
- the button gets FloPay's shared processing, success, and decline modal states automatically
- if authentication is required, the SDK opens the fallback checkout modal on the same page
- successful upsells can update your local React state immediately
Reusing A Session Created On Your Backend
If your backend creates the upsell session first, switch the button to sessionId mode: