我遇到云代码功能问题。该函数是从用Swift编写的iOS应用程序调用的。我正在尝试将“customer.id”发送给Parse。但是,我收到错误:
发生错误(代码:141,版本:1.12.0)
Cloud Code
function stripeCreateP(params) {
var p = new Parse.Promise();
stripe.customers.create(params, function(err, customer) {
if (err) {
p.resolve(customer);
} else {
p.reject(err);
}
});
return p;
}
Parse.Cloud.define("customer", function(request, response) {
// Parse.Cloud.useMasterKey();
var user = request.user;
stripeCreateP({ email: request.params.useremail}).then(function(customer) {
user.set("cusToken", customer.id);
return user.save();
}).then(function(result) {
console.log(customer);
console.log(customer.id);
response.success(customer);
}, function(err) {
console.log(err);
response.error(err);
});
});
夫特
PFCloud.callFunctionInBackground("customer", withParameters: ["useremail": self.userEmailAdressTextField.text ?? ""], block: { (success: AnyObject?, error: NSError?) -> Void in