const { MercadoPagoConfig, Payment } = require('mercadopago'); // Teste simples do PIX async function testePix() { try { console.log('๐Ÿงช Testando PIX com credenciais...'); const client = new MercadoPagoConfig({ accessToken: process.env.MERCADOPAGO_ACCESS_TOKEN, options: { timeout: 5000 } }); const payment = new Payment(client); const payment_data = { transaction_amount: 1.00, description: 'Teste PIX - Liberi Kids', payment_method_id: 'pix', payer: { email: 'test@test.com', first_name: 'Test', last_name: 'User', identification: { type: 'CPF', number: '12345678909' } } }; console.log('๐Ÿ“ค Dados enviados:', JSON.stringify(payment_data, null, 2)); const result = await payment.create({ body: payment_data }); console.log('โœ… Sucesso! PIX criado:', { id: result.id, status: result.status, qr_code: result.point_of_interaction?.transaction_data?.qr_code ? 'Gerado' : 'Nรฃo gerado' }); } catch (error) { console.error('โŒ Erro:', error); if (error.cause) { console.error('๐Ÿ“‹ Detalhes:', error.cause); } } } // Executar teste testePix();