-
Notifications
You must be signed in to change notification settings - Fork 661
Closed
Description
From another ticket (apart from the user reporting this)
Embedded Checkout Button Stuck Loading After Successful Purchase - No Redirect Handling
Description
When using Polar's embedded checkout, after completing a purchase successfully (email confirmation received), the checkout button remains stuck on "Waiting confirmation from Kenzi" and never redirects the user. The issue occurs despite the purchase and subscription being processed successfully.
Related documentation: https://docs.polar.sh/features/checkout/embed
Current Behavior
- User clicks purchase button and embedded checkout opens
- User completes purchase process
- Email confirmation is received confirming successful purchase and subscription
- Checkout remains stuck on "Waiting confirmation from Kenzi" loading state
- No redirect occurs automatically
- User is left in limbo state despite successful transaction
Expected Behavior
After successful purchase completion:
- Checkout should automatically detect the successful payment
- User should be redirected to success page or checkout should close
- Clear indication that purchase was successful within the embed
- No manual redirect handling should be required for basic functionality
Screenshots
See attached screenshot showing the checkout stuck on "Waiting confirmation from Kenzi" state while developer console shows the successful transaction.
Environment:
- Operating System: Windows 10
- Browser (if applicable): Chrome
- Framework: Next.js (React)
- Polar Checkout Package: @polar-sh/checkout
Code Sample
"use client"
import { useEffect, useState } from 'react'
import { PolarEmbedCheckout } from "@polar-sh/checkout/embed";
import { Button } from '../ui/button'
import { createCheckoutSession } from '@/app/actions/polar/polar-actions';
const PurchaseButton = ({ children }: { children: React.ReactNode }) => {
const [checkoutEmbedInstance, setCheckoutEmbedInstance] = useState<PolarEmbedCheckout | null>(null)
useEffect(() => {
return () => {
if (checkoutEmbedInstance) {
checkoutEmbedInstance.close()
}
}
}, [checkoutEmbedInstance])
const openCheckout = async () => {
const session = await createCheckoutSession()
const checkout = await PolarEmbedCheckout.create(session.url);
setCheckoutEmbedInstance(checkout);
}
return (
<Button onClick={openCheckout}>
{children}
</Button>
)
}
export default PurchaseButtonQuestions
- Is manual redirect handling required for embedded checkout success flows?
- Should event listeners be implemented to detect successful purchases?
- Is there a callback or promise resolution that should be handled?
- Are there additional configuration options needed for proper redirect behavior?
Additional Context
- Purchase processing works correctly (email confirmations received)
- Issue appears to be with the embedded checkout UI state management
- No clear documentation on handling post-purchase flow in embedded mode
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels