【发布时间】:2020-10-10 15:39:45
【问题描述】:
我遇到了一个显示 401 (Unauthorized) 的 Paypal Smart 按钮错误
业务解决方案是付费的,所有应该授权的都是。
这是我创建的函数。 [ ] 之间的任何内容都是私人信息的持有者:
cancelSubscription = () => {
axios({
url: `https://api.paypal.com/v1/billing/subscriptions/[USER_SUBSCRIPTION_ID]/cancel`,
method: 'post',
headers: { "Content-Type": "application/json", "Authorization": "Bearer [FACILITATOR_ACCESS_TOKEN]" },
data: { "reason": "test -- Not satisfied with the service" }
})
.then(res => {
console.log(`Axios Call completed: ${res}`)
});
}
【问题讨论】:
标签: reactjs paypal axios paypal-subscriptions