You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a weird issue. I'm calling payments.remove to delete a payment. The payment id is correct, the payment is removed (checking with the Merchant Centre website) as it should but the promise is rejected. Error callback is called with the error:
PMError: API Error:{"data":null,"mode":"test"}
I'm using "paymill-wrapper": "^2.2.0"
This is my code:
functioncreateOrUpdatePaymentForClient(clientId,token,paymentId){vardeferred=when.defer();varpromise=deferred.promise;varremoveResult=pm.payments.remove(paymentId).then(function(payment){///this is never called, WHY ?console.log('Payment with id removed {'+payment.id+'} for client {'+clientId+'}');pm.payments.create(token,clientId).then(function(payment){deferred.resolve(payment);},function(error){deferred.reject(error);});},function(err){//this is always called and payment got deleted, BUG ? console.log(arguments);console.log('........\n')console.log('Could not delete payment :');console.log(err);pm.payments.create(token,clientId).then(function(payment){deferred.resolve(payment);},function(error){deferred.reject(error);});});console.log('Remove result: ');console.log(removeResult);returnpromise;}
The text was updated successfully, but these errors were encountered:
bogdanmarin
changed the title
Cannot remove payment successfully
Error callback always called when removing payment
Feb 27, 2016
I have a weird issue. I'm calling payments.remove to delete a payment. The payment id is correct, the payment is removed (checking with the Merchant Centre website) as it should but the promise is rejected. Error callback is called with the error:
I'm using "paymill-wrapper": "^2.2.0"
This is my code:
The text was updated successfully, but these errors were encountered: