refactor amazon payments and add one time purchases once again

This commit is contained in:
Matteo Pagliazzi
2015-07-15 16:15:00 +02:00
parent bade139b4b
commit ecc98411c7
4 changed files with 75 additions and 49 deletions
+9 -1
View File
@@ -103,7 +103,15 @@ exports.checkout = function(req, res, next){
SellerAuthorizationNote: 'HabitRPG Payment',
TransactionTimeout: 0,
CaptureNow: true
}, cb);
}, function(err, res){
if(err) return cb(err);
if(res.AuthorizationDetails.AuthorizationStatus.State === 'Declined'){
return cb(new Error('The payment was not successfull.'));
}
return cb();
});
},
closeOrderReference: function(cb){