-2

I am trying to consume a payment gateway API, with react, I am using useParams() and I get the following cors error how can I solve it?

"Access to XMLHttpRequest at 'https://khipu.com/api/2.0/payments' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status."

I tried to put a proxy in the package.json, but it did not work, I am in a development environment.

Youssouf Oumar
  • 29,373
  • 11
  • 46
  • 65
Tidus
  • 1
  • Welcome to Stack Overflow! Sadly your question does not meet the community guidelines. Please take the [tour](https://stackoverflow.com/tour), visit [how do I ask a good question](https://stackoverflow.com/help/how-to-ask), and make it a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). – Youssouf Oumar Oct 26 '22 at 07:24

1 Answers1

0

Did you check this other answer?

I think you may need to use the

'Access-Control-Allow-Origin': '*',

I hope this helps :D

JOlle11
  • 21
  • 3