Primeiro commit

This commit is contained in:
2025-10-14 14:04:17 -03:00
commit 33d8645eb4
109 changed files with 55424 additions and 0 deletions

49
test-pix-simple.js Normal file
View File

@@ -0,0 +1,49 @@
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();