This page explains how to validate your TwoCoin widget integration before production rollout. Use this checklist to test core user flows, failure scenarios, and operational monitoring.

Test Environments

Validate the widget in staging first, then run a final smoke test in production after deployment.

EnvironmentPurposeWhat to Verify
StagingFunctional and regression validationAll URL params, event listeners, and end-to-end order lifecycle
ProductionPost-release confirmationReal domain + CSP + analytics + webhook delivery health

Integration Test Checklist

  • Widget iframe loads correctly on desktop and mobile layouts
  • Configured URL parameters are applied correctly (currencies, wallet, region, visibility flags)
  • Normal order flow reaches completion and exposes expected client events
  • Failure paths are handled with clear user messaging and no broken UI states
  • Order status updates are persisted in your backend through verified webhooks

Automated Smoke Example

Add a browser test that confirms the widget is reachable and interactive after each deploy.

// Example Playwright smoke test
import { test, expect } from '@playwright/test';

test('widget page renders and iframe loads', async ({ page }) => {
  await page.goto('https://your-site.com/docs/widget/getting-started');
  const frame = page.locator('iframe[title="TwoCoin Widget"]');
  await expect(frame).toBeVisible();
});

Webhook Validation

Test webhook handling with signature verification and idempotency logic before going live.

// Pseudo-test flow for webhook reliability
1. Create test order in widget
2. Capture webhook payload + signature
3. Verify signature on your server
4. Retry the same payload (duplicate) and ensure it is ignored safely
5. Confirm database status matches latest webhook state

Pre-Launch Readiness

  • HTTPS enforced across all pages hosting the widget
  • CSP allows the widget domain in `frame-src`
  • Monitoring and alerts configured for order failures and webhook errors
  • Support runbook includes troubleshooting steps for common integration issues

Next Steps

Support

If you encounter any issues or have questions not addressed in this documentation, please contact our support team on Telegram at https://t.me/cs_2coin (@cs_2coin).