英文:
Did I write the string for "Authorization" in headers correctly?
问题
I am writing code to add a paypal button to a page. There is this js code:
On the page: https://developer.paypal.com/docs/api/orders/v2/
The following is written:
Authorization string required
To make REST API calls, include the bearer token in this header with the Bearer authentication scheme. The value is Bearer <Access-Token> or Basic <client_id:secret>.
I seem to have written everything like that, but I get a 401 error that says about problems with authorization.
Did I write the string for "Authorization" in headers correctly?
英文:
I am writing code to add a paypal button to a page. There is this js code:
On the page: https://developer.paypal.com/docs/api/orders/v2/
The following is written:
Authorizationstringrequired
To make REST API calls, include the bearer token in this header with the Bearer authentication scheme. The value is Bearer <Access-Token> or Basic <client_id:secret>.
I seem to have written everything like that, but I get a 401 error that says about problems with authorization.
Did I write the string for "Authorization" in headers correctly?
答案1
得分: 0
Client-side/browser code (paypal.Buttons) should never directly call PayPal API endpoints; not under any circumstances. The code in this question should be removed.
Calls to the PayPal API should only be done through a backend/server. See the standard checkout integration guide for an example in node.js, but it can of course be implemented similarly in any other server environment/language.
英文:
Client-side/browser code (paypal.Buttons) should never directly call PayPal API endpoints; not under any circumstances. The code in this question should be removed.
Calls to the PayPal API should only be done through a backend/server. See the standard checkout integration guide for an example in node.js , but it can of course be implemented similarly in any other server environment/language.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论