我正在使用stripe+parse
付款。
我将令牌值传递给Parse
Cloud
Code
并付款。
目前我使用的是test
个密钥。
Parse.Cloud.define("hello", function(request, response) {
var stripe = require('stripe');
stripe.initialize('sk_test_lLGvnjknjknjknjknjknjkn51H3gG ');
var stripeToken = request.params.token;
var charge = stripe.Charges.create({
amount: 1000, // amount in cents, again
currency: "usd",
source: stripeToken,
description: "payinguser@example.com"
}, function(err, charge) {
if (err && err.type === 'StripeCardError') {
// The card has been declined
}
});
response.success(charge);
});
当我调整此代码和 Charge变量时,我得到以下响应:
Cloud Code: {
"_rejected" = 0;
"_rejectedCallbacks" = (
);
"_resolved" = 0;
"_resolvedCallbacks" = (
);
}
我如何知道扣除的金额。