CMBTrades Stripe Backend

PAYMENT PIPELINE

Stripe Order Sync

V11 has two layers of payment confirmation.

1. Success-page confirmation — Active

After Stripe returns a customer to CMBTrades, the site verifies the Checkout Session directly with Stripe, marks the pending order paid, copies the customer/shipping address into the order, and reduces live inventory.

2. Stripe webhook — Backend deployed

The Supabase webhook function is deployed and the Stripe endpoint has been created. The webhook is the resilience layer for customers who close the browser before returning to CMBTrades.

The Stripe webhook signing secret must be stored as a Supabase Edge Function secret before webhook events can be accepted. Do not place that secret in website files.

Inventory safety

Inventory is reduced only when Stripe reports the Checkout Session as paid. Sandbox TEST orders do not reduce real product inventory. Repeated confirmation calls are idempotent, so refreshing the success page does not subtract inventory twice.