I have this code which that i am trying to make it work but the promises seem very confusing so far. I have done some research and the blubird promises seem to be more flexible. Do you guys have any experience and maybe show a case how you would deal with this code.
Here is the code:
var invoicesList;
var getInvoices = stripe.getInvoiceList('cus_id', function(err, callback){
if (err) {
invoicesList = "An error happened";
}else{
invoicesList = callback.data;
};
});
console.log(invoicesList); //Undefined result
Thanks in advance