COD Verifier for WooCommerce
OTP + Token verification for WooCommerce COD orders
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/jawwad-masteeee/productionotp/archive/refs/heads/master.zipA comprehensive WordPress plugin that adds OTP and token payment verification for Cash on Delivery (COD) orders in WooCommerce.
🚀 Features
- OTP Verification: Phone number verification via SMS
- Token Payment: ₹1 payment verification to prevent fake orders
- Test & Production Modes: Easy testing before going live
- Fast2SMS Integration: SMS delivery for OTP
- Razorpay Integration: Secure payment processing
- Mobile Responsive: Works on all devices
- Easy Configuration: Simple admin settings
📁 File Structure
/cod-verifier
├── cod-verifier.php ← Main plugin file
├── /includes
│ ├── settings-page.php ← Admin settings
│ ├── otp-handler.php ← Handles OTP AJAX logic
│ └── razorpay-handler.php ← ₹1 UPI token logic
├── /assets
│ ├── script.js ← Frontend JavaScript
│ └── style.css ← Plugin styles
├── /templates
│ └── otp-box.php ← Verification UI template
├── /languages
│ └── cod-verifier.pot ← Translation file
└── readme.txt ← WordPress plugin readme
📦 Installation
Step 1: Upload Plugin
- Download/create the
cod-verifierfolder with all files - Zip the entire
cod-verifierfolder - Go to WordPress Admin → Plugins → Add New → Upload Plugin
- Upload the zip file and activate the plugin
Step 2: Configure Settings
- Go to WooCommerce → COD Verifier in admin menu
- Enable Test Mode (recommended for initial setup)
- Choose verification options:
- ✅ Enable OTP Verification
- ✅ Enable Token Payment
- Save settings
Step 3: Test the Plugin
- Go to your WooCommerce checkout page
- Add any product to cart and proceed to checkout
- Select "Cash on Delivery" as payment method
- Verification box should appear below payment methods
- Test OTP:
- Enter a 10-digit phone number
- Click "Send OTP"
- In test mode, OTP will be shown in alert popup
- Enter the OTP and verify
- Test Token Payment:
- Click "Pay ₹1 Token"
- In test mode, payment is simulated
- Check the confirmation checkbox
- Place order - should complete successfully
🔧 Production Setup
SMS Configuration (Fast2SMS)
- Sign up at Fast2SMS
- Get your API key from dashboard
- Add API key in plugin settings
- Test SMS delivery
Payment Configuration (Razorpay)
- Sign up at Razorpay
- Get your Key ID and Key Secret
- Add keys in plugin settings
- Test payment flow
Switch to Production
- Add all API keys in settings
- Disable Test Mode
- Save settings
- Test complete flow with real SMS and payment
🧪 Testing Guide
Test Mode Features
- OTP Display: OTP shown in JavaScript alert
- SMS Simulation: No real SMS sent
- Payment Simulation: No real money charged
- All Functionality: Complete verification flow
Testing Steps
- Enable Test Mode in settings
- Go to checkout and select COD
- Verify UI appears - verification box should show
- Test OTP Flow:
- Enter phone:
9876543210 - Click "Send OTP"
- Check alert for OTP code
- Enter OTP and verify
- Should show "✓ Verified"
- Enter phone:
- Test Token Payment:
- Click "Pay ₹1 Token"
- Should show "✓ Payment Complete"
- Check confirmation checkbox
- Complete Order:
- Click "Place Order"
- Order should complete successfully
Troubleshooting
Verification Box Not Showing
- Check if Cash on Delivery is enabled in WooCommerce
- Ensure plugin is activated
- Check browser console for JavaScript errors
- Clear cache if using caching plugins
OTP Not Working
- Verify Fast2SMS API key in production
- Check phone number format (10 digits starting with 6-9)
- In test mode, check JavaScript alert for OTP
Token Payment Issues
- Verify Razorpay keys in production
- Check if payment gateway is properly configured
- In test mode, payment should be simulated
Order Not Completing
- Check if both verifications are completed
- Look for validation errors on checkout page
- Check WordPress error logs
🔒 Security Features
- Nonce Verification: All AJAX requests secured
- Session Management: Secure session handling
- Input Sanitization: All inputs properly sanitized
- OTP Expiration: OTP expires after 5 minutes
- Rate Limiting: Prevents spam requests
🎨 Customization
Styling
Edit assets/style.css to customize appearance:
- Colors and themes
- Layout and spacing
- Mobile responsiveness
- Button styles
Text/Language
Use WordPress translation functions to customize text:
- All strings are translatable
- Create
.pofiles for different languages - Modify text in template files
📞 Support
Common Issues
- Plugin not working: Check WooCommerce compatibility
- UI not showing: Clear cache and check for conflicts
- API errors: Verify API keys and test connectivity
- Session issues: Check PHP session configuration
Debug Mode
Enable WordPress debug mode in wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
Check /wp-content/debug.log for errors.
📝 Changelog
Version 1.0.0
- Initial release
- OTP verification via Fast2SMS
- Token payment via Razorpay
- Test and production modes
- Mobile responsive design
- WordPress security standards
📄 License
This plugin is licensed under GPL v2 or later.
🤝 Contributing
- Fork the repository
- Create feature branch
- Make changes
- Test thoroughly
- Submit pull request
Ready to sell fake-order-free COD products? 🚀
Test the plugin thoroughly in Test Mode, then switch to Production Mode with your API keys for real customers!