internal_error (500) when creating credit card payment with Payments API - Authorization header conflict #403
Unanswered
Everton Fernandes (vertocode)
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
SDK Version:
"mercadopago": "^2.0.9"
Environment:
Problem
When creating credit card payments using the Payments API with a
seller access token, we encounter different errors depending on
Authorization header handling:
PA_UNAUTHORIZED_RESULT_FROM_POLICIES (403)
(500)
Code Sample
Response / Error
Attempt 1 (without Authorization header in requestOptions, letting
SDK handle it):
{ "blocked_by": "PolicyAgent", "code": "PA_UNAUTHORIZED_RESULT_FROM_POLICIES", "status": 403, "message": "At least one policy returned UNAUTHORIZED." }Attempt 2 (with manual Authorization header):
{ "message": "internal_error", "error": null, "status": 500, "cause": [] }Expected Behavior
The payment should be created successfully when:
sellerToken })
payment_method_id, payer info)
Additional Context
API
PA_UNAUTHORIZED_RESULT_FROM_POLICIES occurs when "Authorization
header is removed during request or Access Token not sent"
Questions
when the SDK is already initialized with an access token via
MercadoPagoConfig?
using seller tokens (non-OAuth)?
manual integration that aren't documented?
Workaround Attempted
support card tokens properly)
handling
Any guidance would be greatly appreciated!
Environment Details:
Beta Was this translation helpful? Give feedback.
All reactions