@xuda.io/account_module 1.2.93 → 1.2.94
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.
- package/index.js +8 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1454,13 +1454,20 @@ exports.validate_account_topup = async function (uid, items = []) {
|
|
|
1454
1454
|
throw new Error("no card on file");
|
|
1455
1455
|
}
|
|
1456
1456
|
|
|
1457
|
-
if (data?.
|
|
1457
|
+
if (data?.open_invoices?.length) {
|
|
1458
1458
|
let err = new Error(`past_due ${data?.balance?.past_due}`);
|
|
1459
1459
|
err.code = -91;
|
|
1460
1460
|
err.billing_problem = true;
|
|
1461
1461
|
err.topup = topup;
|
|
1462
1462
|
throw err;
|
|
1463
1463
|
}
|
|
1464
|
+
// if (data?.balance?.past_due) {
|
|
1465
|
+
// let err = new Error(`past_due ${data?.balance?.past_due}`);
|
|
1466
|
+
// err.code = -91;
|
|
1467
|
+
// err.billing_problem = true;
|
|
1468
|
+
// err.topup = topup;
|
|
1469
|
+
// throw err;
|
|
1470
|
+
// }
|
|
1464
1471
|
|
|
1465
1472
|
const balance = data?.balance?.account || 0; // minus balance represents positive balance
|
|
1466
1473
|
|