【发布时间】:2020-08-15 10:31:21
【问题描述】:
我制作了一个 firebase 可调用函数来调用条带 api 来获取条带客户对象
exports.getDefaultPayment = functions.https.onCall(async (data, context) => {
await stripe.customers.retrieve("cus_H5UarU16gpUbqM", (customer) => {
// asynchronously called
return customer;
});
});
然后我尝试简单地记录该对象
onPress={() => {
const getDefaultPayment = functions().httpsCallable(
'getDefaultPayment'
);
getDefaultPayment().then((result) => {
console.log(JSON.parse(result.data));
});
}}
但结果为空
【问题讨论】:
标签: javascript firebase react-native google-cloud-functions stripe-payments