This page provides solutions for common issues you might encounter when integrating or using the TwoCoin widget. If you're experiencing problems, refer to the troubleshooting steps below.
If the widget fails to load on your website, check these common causes:
Check that the widget iframe is correctly configured with the right URL:
<iframe src="https://your-widget-domain.com/widget" width="100%" height="800px"></iframe>Solution: Verify that the iframe src URL is correct and accessible. Check the browser console for any loading errors or CSP violations.
The iframe may not display properly due to sizing or CSS issues.
Solution: Ensure the iframe has proper width and height attributes, and that the parent container has sufficient space. Set frameBorder="0" for a clean appearance.
Your website's Content Security Policy may be blocking the widget from loading.
Solution: Update your CSP to allow iframes from your-widget-domain.com.
The widget may not reflect URL parameters or display incorrectly configured options.
Solution: Verify your URL parameters are correctly formatted:
<!-- Check parameter format -->
<iframe
src="https://your-widget-domain.com/widget?fromCurrency=USD&toCurrency=BTC&country=US"
width="100%"
height="800px">
</iframe>Common error messages and their solutions:
| Error Message | Possible Cause | Solution |
|---|---|---|
| Invalid merchant ID | The merchant ID provided is incorrect or inactive | Verify your merchant ID in the TwoCoin dashboard and ensure it is active |
| API request failed | Network connectivity issues or API endpoint problems | Check your internet connection and confirm the TwoCoin API status |
| Unsupported currency | The specified currency is not supported | Check the list of supported currencies and update your configuration |
| Invalid wallet address | The cryptocurrency wallet address format is invalid | Validate the wallet address format for the specific cryptocurrency |
| Rate limit exceeded | Too many API requests in a short time | Implement request throttling and exponential backoff in your code |
Troubleshoot problems related to payments and transactions:
If payments are not being processed after the user submits payment details:
If an order remains in the "processing" state for an extended period:
If you're not receiving webhook notifications for order status updates:
// Example webhook debugging code
app.post('/webhooks/twocoin', express.raw({type: 'application/json'}), (req, res) => {
// Log incoming webhook data
console.log('Webhook received:', {
headers: req.headers,
body: req.body.toString(),
timestamp: new Date().toISOString()
});
try {
// Process webhook normally
// ...
// Respond with success
res.status(200).send('Webhook received');
} catch (error) {
// Log errors but still return 200 to acknowledge receipt
console.error('Webhook processing error:', error);
res.status(200).send('Webhook received with processing error');
}
});The TwoCoin widget is designed to work in all modern browsers, but you may encounter issues in older browsers:
| Browser | Minimum Version | Known Issues |
|---|---|---|
| Chrome | 60+ | None |
| Firefox | 60+ | None |
| Safari | 11+ | May have issues with certain animations |
| Edge | 16+ | None |
| Internet Explorer | Not supported | Widget will not function in Internet Explorer |
If you're encountering problems with the widget on mobile devices:
Use browser developer tools to debug iframe integration issues:
// Check if iframe is loading correctly
const iframe = document.querySelector('iframe');
console.log('Iframe src:', iframe.src);
console.log('Iframe dimensions:', iframe.width, 'x', iframe.height);
// Listen for iframe load events
iframe.addEventListener('load', function() {
console.log('Widget iframe loaded successfully');
});
iframe.addEventListener('error', function() {
console.error('Widget iframe failed to load');
});
// Check for console errors from the iframe
// (Note: Cross-origin restrictions may limit visibility)If you've tried the troubleshooting steps above and are still experiencing issues, you can:
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).