Demo Store

Redirect Checkout Integration Example

Iframe Example Test Harness
💻

Premium Widget Pro

The ultimate widget for all your needs. Features include advanced functionality, premium materials, and a 2-year warranty. Ships within 24 hours.

$10.00

How This Works (Redirect Mode)

When you click "Proceed to Checkout", the merchant server creates a payment session with mode: 'redirect' and redirects you to the hosted checkout page.

After payment, you're redirected back to the merchant's success or cancel page with the session ID and charge ID in the URL.

// 1. Merchant server creates session const response = await fetch('/api/charge/v1/sessions', { method: 'POST', headers: { 'X-API-Key': 'msp_xxx', 'Content-Type': 'application/json' }, body: JSON.stringify({ amount: 1000, schoolUuid: 'school_123', mode: 'redirect', successUrl: 'https://merchant.com/success?charge={CHARGE_ID}', cancelUrl: 'https://merchant.com/cancel' }) }); // 2. Redirect user to checkout const { redirectUrl } = await response.json(); window.location.href = redirectUrl;