【发布时间】:2019-03-02 11:40:02
【问题描述】:
我正在尝试使用以下 Cloud Function for Firebase 在 Stripe 和我的 iOS 应用程序之间进行通信。然而,尽管console.log(customer) 打印出一个有效的客户 JSON 对象,但我的 iOS 应用程序收到了nil 作为结果。我是否以错误的方式退货?
exports.regCustomer = functions.https.onCall((data,context) => {
const email = data.email;
return stripe.customers.create({
email: email,
}, function(err, customer) {
if (err) {
console.log(err);
throw new functions.https.HttpsError('stripe-error', err);
} else {
console.log("customer successfully created");
console.log(customer);
return customer;
}
});
});
【问题讨论】:
标签: ios node.js firebase stripe-payments google-cloud-functions