303响应代码不工作(Stripe Connect with Angular.js)
303 response code not working (Stripe Connect with Angular.js)
我该如何处理这段代码?据我所知,它应该重定向我的请求,但我只得到一个错误。
Error I get
: 8100/#/stripeCallback吗?scope=read_write&code=ac_9JHtmTB7Y5cJQprWgaKPm1A6QLCbceQ8:1 XMLHttpRequest无法加载https://connect.stripe.com/oauth/token。预飞行响应无效(重定向)
这里是角http请求我得到用户的条纹代码后。现在使用这个请求,我应该验证它。
$http({
method: 'POST',
url: "https://connect.stripe.com/oauth/token",
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json;charset=UTF-8'
},
data: {
grant_type: "authorization_code",
code: stripeCode,
client_secret: "client_secret"
}
}).then(function (response) {
console.log(response);
}, function (response) {
console.log("Error -> ");
console.log(response);
});
这里的问题是我做错了什么吗?
对https://connect.stripe.com/oauth/token
的POST调用必须在服务器端进行,因为它在client_secret
参数中使用您的秘密API密钥。您的秘密API密钥永远不能与客户端应用程序共享或嵌入。
相关文章:
- Fighting with FRP
- issue with FB.Event.subscribe
- 为什么grunt contrib connect的中间件选项的第三个参数是未定义的
- geolocation-marker.js conflict with markerclusterer.js
- Angular 2.0 with JavaScript or TypeScript?
- 为什么不推荐使用“with”?是否有更好或其他方法可以“下降”到对象的命名空间
- WebComponentsJS with IE10
- Grunt-connect在根目录之外提供静态文件
- mongoose.connect undefined不是一个函数
- 指令的模板必须只有一个根元素:With restrict E&替换true
- timeago.js with datatable and PHP
- Ajax and Json with Rails
- errors with Javascript try catch
- how to split a string with ','
- Understanding Javascript scope with "var that = this&qu
- Architecture for CPU intensive tasks with NodeJS & Socke
- How to declare a Map containing certain properties with flow
- 设置'这'在React with Inverse Data Flow中
- Unit-testing multiple use cases with Karma & Mocha.js
- 303响应代码不工作(Stripe Connect with Angular.js)