Not working for google order with loop
mkgareja opened this issue · 3 comments
for (i=0.....){
var payment.receipt = receipt(i);
iap.verifyPayment('google', payment, function (error, response) {
if(!error && response){
callback(response);
}
});
}
i m passing diffrant receipt each time but it return same responce for every recipt.
note: all responce consist copy of first itration.
@mkgareja It depends on what the payment object looks like. I would verify that the package name is the same for each receipt. And the product ID is also the same for each receipt.
When in doubt, console log it out.
@mkgareja You seem to be running a synchronous for-loop over an asynchronous operation. While technically possible, this is almost always not what you want to do. So before even diving into what may be going wrong with node-iap
, I would suggest reading up asynchronous code (usually recognizable as function calls that include a callback) in JavaScript, and perhaps consider using a library like async to help with iteration.
I think this issue can be closed.