Files
zeekay 09c5e16c5c feat: rebrand all packages to @hanzo/cms scope (Payload v3.85.2 fork)
- payload -> @hanzo/cms (core), bin payload -> hanzo-cms
- create-payload-app -> @hanzo/create-cms-app
- @payloadcms/<x> -> @hanzo/cms-<x> across the whole dependency graph
- 3545 files, 72 package.json, 4419 scoped refs, 3852 core import specifiers, 82 scss imports
- MIT attribution to Payload CMS Inc. preserved (LICENSE.md, author emails)

Upstream: github.com/payloadcms/payload @ v3.85.2 (MIT)
2026-07-01 17:56:00 -07:00

47 lines
1.1 KiB
TypeScript

'use client'
import { useCart, usePayments } from '@hanzo/cms-plugin-ecommerce/react'
import React, { useEffect, useRef } from 'react'
import { useRouter, useSearchParams } from 'next/navigation.js'
export const ConfirmOrder: React.FC = () => {
const { confirmOrder } = usePayments()
const { cart } = useCart()
const confirmedOrder = useRef(false)
const searchParams = useSearchParams()
const router = useRouter()
useEffect(() => {
if (!cart || cart.size === 0) {
return
}
const paymentIntentID = searchParams.get('payment_intent')
if (paymentIntentID) {
confirmOrder('stripe', {
additionalData: {
paymentIntentID,
},
}).then((result) => {
if (result && typeof result === 'object' && 'orderID' in result && result.orderID) {
// Redirect to order confirmation page
confirmedOrder.current = true
router.push(`/shop/order/${result.orderID}`)
}
})
}
}, [cart, searchParams])
return (
<div>
<h2>Confirm Order</h2>
<div>
<strong>Order Summary:</strong>
LOADING
</div>
</div>
)
}