UNPKG

vibecodingreviewer

Version:

AI-powered code review tool with enhanced analysis

55 lines (45 loc) 1.66 kB
// Script to test Gumroad webhook with correct BYOK Monthly pricing import fetch from 'node-fetch' async function testBYOKMonthlyWebhook() { const webhookUrl = 'https://vibecodingreviewer-license.vercel.app/api/webhook/gumroad' // BYOK Monthly should be $2 (under $20 threshold for monthly) const payload = { sale_id: 'byok-monthly-' + Date.now(), product_id: 'fzsco', email: 'test@example.com', full_name: 'Test User', amount: '2.00', // $2 per month for BYOK currency: 'USD', sale_timestamp: new Date().toISOString(), license_key: 'test-license-key-' + Date.now(), product_name: 'VibeCodingReviewer BYOK Monthly', custom_fields: { license_type: 'BYOK', plan_type: 'monthly' } } try { console.log('🚀 Testing BYOK Monthly webhook...') console.log('📋 Payload:', JSON.stringify(payload, null, 2)) const response = await fetch(webhookUrl, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Gumroad-Webhook/1.0' }, body: new URLSearchParams(payload).toString() }) const responseText = await response.text() console.log('📊 Response Status:', response.status) console.log('📄 Response Body:', responseText) if (response.ok) { console.log('✅ BYOK Monthly webhook test successful!') console.log('🔍 Check your Supabase database for the new license') } else { console.log('❌ Webhook test failed') } } catch (error) { console.error('❌ Error testing webhook:', error) } } testBYOKMonthlyWebhook()