问题描述
我正在尝试从本地主机调用Stripe API stripe.subscriptions.retrieve,没有响应,没有错误
我在下面尝试过:
const stripe = new Stripe('sk_testkey');
stripe.subscriptions.retrieve('subscriptionid')
.then(subscription=> {
console.log("complete")
console.log(subscription.data())
})
.catch(error => {
console.log("error")
console.error(error)}
);
和
try {
console.log("try")
vm.mysubscription = await stripe.subscriptions.retrieve('subscriptionid');
} catch (error) {
console.error("error")
}
在下面与Axios一起使用:
var token = "sk_testkey"
const config = {
headers: { Authorization: `Bearer ${token}` }
};
// Make a request for a user with a given ID
axios.get('https://api.stripe.com/v1/subscriptions/subscriptionid',config).then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.then(function () {
// always executed
});
有什么想法吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)