Constimport { useRef } from 'react'
import { Checkout, type CheckoutHandle } from '@inttegro/react'
function Payment({ orderId }: { orderId: string }) {
const checkout = useRef<CheckoutHandle>(null)
return (
<dialog open onTransitionEnd={() => checkout.current?.focus()}>
<Checkout
ref={checkout}
orderId={orderId}
appearance={{ theme: 'system' }}
onCompleted={() => location.assign(`/orders/${orderId}/complete`)}
onError={(error) => reportCheckoutError(error)}
/>
</dialog>
)
}
Embeds Inttegro-hosted Checkout in a React application.
The component renders an empty
div, loads the executable runtime from Inttegro's fixed origin after mount, creates a controller fororderId, and destroys it during cleanup. Server rendering is safe because no runtime is loaded until the effect runs in a browser.Changing
orderId,timeout, ortitlestarts a fresh hosted experience. Changingappearanceorlocaleupdates the active experience in place. Keep the component mounted while a payment is pending or confirmation is in progress.