Closed Kimmydoray closed 2 years ago
This is a CORS error not an SDK issue. Please read up on CORS, the Xendit API doesn't allow requests from browser like environments.
Here's a similar issue you can read up on: Stackoverflow Issue
Good day,
Thank you for your response, I would like to know what is the best solution for this issue, cause the idea is once the user click the "Pay" button the api request will fire.
Thank you, Edzel
On Sun, Apr 3, 2022, 01:41 Maahir Ur Rahman @.***> wrote:
This is a CORS error not an SDK issue. Please read up on CORS, the Xendit API doesn't allow requests from browser like environments.
Here's a similar issue you can read up on: Stackoverflow Issue https://stackoverflow.com/questions/53684484/posting-to-external-api-throws-cors-but-it-works-from-postman
— Reply to this email directly, view it on GitHub https://github.com/xendit/xendit-node/issues/152#issuecomment-1086687571, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKQVJYX2IAXYLVVIHRQMQ7LVDCBDFANCNFSM5SLBOXAQ . You are receiving this because you authored the thread.Message ID: @.***>
Cause it is so weird that they created api for it then they don't allow browser to send request?
On Sun, Apr 3, 2022, 01:48 edzel abliter @.***> wrote:
Good day,
Thank you for your response, I would like to know what is the best solution for this issue, cause the idea is once the user click the "Pay" button the api request will fire.
Thank you, Edzel
On Sun, Apr 3, 2022, 01:41 Maahir Ur Rahman @.***> wrote:
This is a CORS error not an SDK issue. Please read up on CORS, the Xendit API doesn't allow requests from browser like environments.
Here's a similar issue you can read up on: Stackoverflow Issue https://stackoverflow.com/questions/53684484/posting-to-external-api-throws-cors-but-it-works-from-postman
— Reply to this email directly, view it on GitHub https://github.com/xendit/xendit-node/issues/152#issuecomment-1086687571, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKQVJYX2IAXYLVVIHRQMQ7LVDCBDFANCNFSM5SLBOXAQ . You are receiving this because you authored the thread.Message ID: @.***>
You'll have to do more research to figure this out, but it looks like this is a vue frontend. You can try routing this request through a server you've created. vue frontend -> node backend -> api request to Xendit
There might be a better way to go about it, CORS is standard, it's not just for the Xendit API.
Good day Maahir,
Yeah, what I did instead of triggering the request thru front end I just trigger it on my backend laravel. Thank you for your response.
On Sun, Apr 3, 2022 at 11:03 AM Maahir Ur Rahman @.***> wrote:
You'll have to do more research to figure this out, but it looks like this is a vue frontend. You can try routing this request through a server you've created. vue frontend -> node backend -> api request to Xendit
There might be a better way to go about it, CORS is standard, it's not just for the Xendit API.
— Reply to this email directly, view it on GitHub https://github.com/xendit/xendit-node/issues/152#issuecomment-1086766317, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKQVJYSV3LR4QVDGH47ZG53VDEC75ANCNFSM5SLBOXAQ . You are receiving this because you authored the thread.Message ID: @.***>
Glad to hear that, I'll be closing the issue now.
Thanks I also follow you on linked, your the best <3
Here's my code:
but it always showing this error once I fire the function at the top, need answers please and thank you.