I have been trying to write a relatively simple payment capture application in .net and react. My problem is that I keep getting this exception:
Square.SquareApiException: ‘Error with status code 401
Status code: 401
Body: {
“errors”: [
{
“category”: “AUTHENTICATION_ERROR”,
“code”: “UNAUTHORIZED”,
“detail”: “This request could not be authorized.”
}
]
}’
I have double checked my credentials. I even used the same credential and source id in POST /v2/payments - Square API Explorer and it worked fine. The core of my code is pretty much the same as the code provided in the sample in the create payment page.
At this point, I am spinning my wheels getting no where.
Any thoughts would be helpful.