Create a payment intent
Create it on your server after resolving the cart and customer. The API key never crosses this boundary.Confirm and handle action
An intent can require a payment method, customer action, processing time, or no further action. Render the appropriate state, then retrieve the intent or wait for the verified event. Never treat a redirect return as confirmation.payment.confirmed webhook remains the fulfillment authority when the browser flow ends before the server receives confirmation.