n8n-nodes-mercadopago-pix-assinatura 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1135,10 +1135,12 @@ class PixPayment {
|
|
|
1135
1135
|
throw new Error("Dia de cobrança deve estar entre 1 e 28");
|
|
1136
1136
|
}
|
|
1137
1137
|
// Construir auto_recurring
|
|
1138
|
+
// NOTA: Para planos, a API do Mercado Pago espera transaction_amount em formato decimal (não centavos)
|
|
1139
|
+
// Exemplo: 10.9 (não 1090)
|
|
1138
1140
|
const autoRecurring = {
|
|
1139
1141
|
frequency,
|
|
1140
1142
|
frequency_type: frequencyType,
|
|
1141
|
-
transaction_amount:
|
|
1143
|
+
transaction_amount: amount, // Valor já está em formato decimal após normalizeNumericValue
|
|
1142
1144
|
currency_id: currencyId,
|
|
1143
1145
|
};
|
|
1144
1146
|
if (repetitions && repetitions > 0) {
|
|
@@ -1222,8 +1224,9 @@ class PixPayment {
|
|
|
1222
1224
|
body.reason = reason;
|
|
1223
1225
|
}
|
|
1224
1226
|
if (amount && amount > 0) {
|
|
1227
|
+
// NOTA: Para planos, a API do Mercado Pago espera transaction_amount em formato decimal (não centavos)
|
|
1225
1228
|
body.auto_recurring = {
|
|
1226
|
-
transaction_amount:
|
|
1229
|
+
transaction_amount: amount, // Valor já está em formato decimal após normalizeNumericValue
|
|
1227
1230
|
};
|
|
1228
1231
|
}
|
|
1229
1232
|
if (Object.keys(body).length === 0) {
|
|
@@ -1546,9 +1549,9 @@ class PixPayment {
|
|
|
1546
1549
|
break;
|
|
1547
1550
|
case "plans":
|
|
1548
1551
|
normalized.planId = data.id;
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
+
// NOTA: Para planos, a API retorna transaction_amount em formato decimal (não centavos)
|
|
1553
|
+
// Exemplo: 10.9 (não 1090), então não precisa dividir por 100
|
|
1554
|
+
normalized.amount = data.auto_recurring?.transaction_amount;
|
|
1552
1555
|
normalized.description = data.reason;
|
|
1553
1556
|
break;
|
|
1554
1557
|
case "subscriptions":
|