Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createCharge: function (options) {
var defer = Q.defer();
stripe.charges.create(options, function (error, charge) {
if (error) {
defer.reject(error);
} else {
defer.resolve(charge);
}
});
return defer.promise;
},
retrieveCharge: function (options) {
var defer = Q.defer();
stripe.charges.retrieve(options.id, function (error, charge) {
if (error) {
defer.reject(error);
} else {
defer.resolve(charge);
}
});
return defer.promise;
},