Fix to make it so payment ID's won't auto-queue, but will error "safely"

master
Alexander Blair 7 years ago
parent bf730fddbe
commit becaf9424a

@ -298,9 +298,11 @@ let paymentQueue = async.queue(function (paymentDetails, callback) {
if (body.hasOwnProperty('error')) {
if (body.error.message === "not enough money"){
console.error("Issue making payments, not enough money, will try later");
setTimeout(function(){
paymentQueue.push(paymentDetails, callback);
}, 1800000);
if (!paymentDetails.hasOwnProperty('payment_id')) {
setTimeout(function(){
paymentQueue.push(paymentDetails, callback);
}, 1800000);
}
return callback(false);
} else {
console.error("Issue making payments" + JSON.stringify(body.error));

Loading…
Cancel
Save