This page demonstrates how to integrate Conduit's secure escrow payment system into your website. Click the buttons below to see different integration modes.
Simple one-time payment with popup checkout
Full page redirect checkout with USDT option
Let users choose their own amount
<script src="https://app.instantescrow.nz/conduit-checkout.js"></script><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><!-- 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>Initialize the checkout widget with your configuration:
sellerAddress (required) - Your wallet address to receive paymentsbaseUrl (required) - Base URL of the Conduit checkout pagewebhookUrl (recommended) - Your backend endpoint to receive verified paymentswebhookSecret (recommended) - Secret key for HMAC signature verificationtokenSymbol (optional) - Default token: 'USDC' or 'USDT' (default: 'USDC')expiryDays (optional) - Days until auto-release (default: 7)mode (optional) - Display mode: 'popup' or 'redirect' (default: 'popup')onSuccess (optional) - Success callback function (webhook already sent!)onError (optional) - Error callback functiononCancel (optional) - Cancel callback functionOpen a checkout for a specific payment:
amount (required) - Payment amount (e.g., '50.00')description (required) - Payment descriptionorderId (optional) - Your order/transaction IDemail (optional) - Customer email addresstokenSymbol (optional) - Override default token for this paymentexpiryDays (optional) - Override default expiry for this paymentexpiryTimestamp (optional) - Custom expiry Unix timestampwebhookUrl (optional) - Webhook URL for payment verificationmetadata (optional) - Custom metadata objectProgrammatically close any open checkout.
Configure webhookUrl and the SDK will automatically POST verified payment data to your backend:
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
}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 });
});