Created
February 17, 2016 20:02
-
-
Save matthewarkin/ef55dbbababf70e2cbb0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stripe = require("cloud/stripe.js")("XXXXXX") | |
function createRefund(data){ | |
var promise = new Parse.Promise(); | |
stripe.refunds.create({ | |
amount: 400, | |
charge: "ch_17fSCXGR6JAGMQRJn0KJL7p5", // obtained with Stripe.js | |
}, function(err, charge) { | |
if (err){ | |
promise.reject(err) | |
} | |
else{ | |
promise.resolve(charge) | |
} | |
}); | |
return promise | |
} | |
Parse.Cloud.define("hello", function(request, response) { | |
createRefund({ | |
amount: 400, | |
charge: "ch_17fSCXGR6JAGMQRJn0KJL7p5", // obtained with Stripe.js | |
}).then(...) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment