question

qa-digital-ads avatar image
qa-digital-ads asked lizethbethtzs edited

payment without developer account

Hi, I am a developer for a website builder company and one of my clients request a website to allow customer to pay. I created an web-app with angular wich will be used only for our clients. I created a simple tokenization and then a charge with e-com api keys, but the I am getting CORS error. If We do not want to create a developer account, how do I avoid CORS? or, If is not possible to avoid CORS, do we have to create a developer account for our client??

e-commerce api
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

parquet76 avatar image
parquet76 answered parquet76 commented

You will need to proxy the calls from your front end to a server that will make the calls to the Clover API.

6 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

qa-digital-ads avatar image qa-digital-ads commented ·
Thanks. I am sorry if I sound like dumb, but I already try with CORS Anywhere (with his account) but I am not expert creating the server, and try making my own server on firebase but it has an error width post request. Could you help me guiding me to some solution, besides what I've already try?
0 Likes 0 ·
parquet76 avatar image parquet76 qa-digital-ads commented ·

If you are already hosting the static front-end on firebase you will just need to add a backend. The easiest approach would probably to use express, I think you would need to set-up a cloud function (or cloud run). Do a Google search on deploying an express API on firebase.

0 Likes 0 ·
qa-digital-ads avatar image qa-digital-ads parquet76 commented ·
Thanks for your answer, but I am in the same place hahahaha... I am a developer by totorials, so I think I will lost my job. I don t have front-end app on firebase, I am completely lost, I already try all free options, because I cannot say oto my boss that we have to pay for proxy. I know on heroku I can place CORS anywhere but we do not contemplate to pay for this. Will be better if just accept giving up
0 Likes 0 ·
Show more comments
lizethbethtzs avatar image
lizethbethtzs answered lizethbethtzs edited

Hi there, If you're experiencing CORS (Cross-Origin Resource Sharing) errors while making API requests from your web app, there are a few potential solutions you can explore.

. Proxy Server: You can set up a proxy server on your own server that acts as an intermediary between your web app and the Clover API. Your web app would make requests to your server, which would then forward the requests to the Clover API. This can help bypass CORS restrictions.

2. JSONP: If the Clover API supports JSONP (JSON with Padding), you can use this technique to make cross-origin requests without encountering CORS errors. JSONP works by dynamically adding a `<script>` tag to your web app, which fetches the API response.

3. Server-Side Integration: Instead of making API requests directly from the client-side (Angular), you can make the requests from your server-side code. Your server can act as a middleman and relay the response to the client, avoiding CORS issues. Can You Hit a Pickleball With Your Hand?

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community