🚀 Conduit Checkout Integration Example

This page demonstrates how to integrate Conduit's secure escrow payment system into your website. Click the buttons below to see different integration modes.

Live Examples

Basic Product - $10.00

Simple one-time payment with popup checkout

Enterprise Plan - $200.00

Full page redirect checkout with USDT option

Custom Amount

Let users choose their own amount

Integration Code

1. Include the Script

<script src="https://app.instantescrow.nz/conduit-checkout.js"></script>

2. Initialize with Your Config

<script> ConduitCheckout.init({ // REQUIRED: Your wallet address to receive payments sellerAddress: '0x4f118f99a4e8bb384061bcfe081e3bbdec28482d', // REQUIRED: Base URL of Conduit checkout page baseUrl: 'https://app.instantescrow.nz', // RECOMMENDED: Auto-send verified payments to your backend webhookUrl: 'https://yoursite.com/api/conduit-webhook', webhookSecret: 'your-secret-key', // Store securely! // Optional: Default token (USDC or USDT) tokenSymbol: 'USDC', // Optional: Days until auto-release to seller (default: 7) expiryDays: 7, // Optional: Display mode ('popup' or 'redirect') mode: 'popup', // Success callback (webhook already sent!) onSuccess: function(data) { console.log('Payment verified!', data); // Webhook already sent to your backend! // Just show UI confirmation alert('Thank you! Order confirmed!'); }, // Error callback onError: function(error) { console.error('Payment failed:', error); alert('Payment failed: ' + error); }, // Cancel callback onCancel: function() { console.log('Payment cancelled'); alert('Payment cancelled'); } }); </script>

3. Add Payment Buttons

<!-- Simple button --> <button onclick="ConduitCheckout.open({ amount: '50.00', description: 'Premium Product' })"> Pay $50 with USDC </button> <!-- Button with more options --> <button onclick="ConduitCheckout.open({ amount: '100.00', description: 'Order #1234 - Widget Bundle', orderId: '1234', email: 'customer@example.com', tokenSymbol: 'USDT', expiryDays: 14, webhookUrl: 'https://yoursite.com/webhook', metadata: { sku: 'WIDGET-001', quantity: 2 } })"> Pay $100 with USDT </button>

API Reference

ConduitCheckout.init(options)

Initialize the checkout widget with your configuration:

ConduitCheckout.open(params)

Open a checkout for a specific payment:

ConduitCheckout.close()

Programmatically close any open checkout.

🔐 Webhook Integration (RECOMMENDED)

Configure webhookUrl and the SDK will automatically POST verified payment data to your backend:

Webhook Payload:

POST /api/conduit-webhook Headers: Content-Type: application/json X-Conduit-Signature: hmac-sha256-signature Body: { "contractId": "abc123", "chainAddress": "0x123abc...", "seller": "0x4f118f...", "amount": 50.0, "currencySymbol": "USDC", "state": "ACTIVE", "verified": true, "verifiedAt": "2025-12-30T14:30:00Z", "orderId": "YOUR-ORDER-123", "email": "customer@example.com", "metadata": { "sku": "WIDGET-001" }, "timestamp": 1735568400 }

Verification Example (Node.js):

const crypto = require('crypto'); app.post('/api/conduit-webhook', async (req, res) => { // 1. Verify HMAC signature const signature = req.headers['x-conduit-signature']; const payload = JSON.stringify(req.body); const expectedSig = crypto .createHmac('sha256', process.env.WEBHOOK_SECRET) .update(payload) .digest('hex'); if (signature !== expectedSig) { return res.status(401).json({ error: 'Invalid signature' }); } // 2. Process verified payment const { contractId, amount, orderId } = req.body; await db.orders.update(orderId, { status: 'PAID' }); await fulfillment.ship(orderId); res.json({ received: true }); });