Fiat Onramp cors policy issue

I just span a server and installed the fiat on-ramp plugin but I am running into a CORS policy error when interacting with the button.

<button  class="btn btn-primary col-3"  id="btn-login" onclick="iframefiat()">Buy/Sell crypto & Fiat</button>
              <iframe id="myIframe" src="" width="350" height="650" style="display:none"></iframe> 
<br><script>
Moralis.start({ serverUrl: 'https://cablkji81xn6.usemoralis.com:2053/server', appId: 'JdzvjWbMMN3gkrqTeddEgUxT7b3lN0yR2RhCtnsr' });

                (async function(){

                    Moralis.initPlugins();

                })();

                function buycrypto(){

                  Moralis.Plugins.fiat.buy();

                }

                async function iframefiat(){

                  let response = await Moralis.Plugins.fiat.buy({}, {disableTriggers: true});

                  console.log(response)

                  document.getElementById('myIframe').style.display = 'block';

                  document.getElementById('myIframe').src = response.data;

                }

              </script>```

how did you start that server? was on localhost?

yh, i am using line server

It was working fine before and I didn’t change the code or anything

http://127.0.0.1:8000 that is what I am using

and you still get that error now?

yes, I keep getting:error3

did you set a valid API key for the plugin?

Do I have to set up an api key with onRamp?
Because I have installed the Fiat onRamp plugin to the moralis server, and I am pasing the correct server url and appId on my htm and js files

if you go in admin interface on your server, at plugins, for onRamp plugin on edit, you will see: ConfigureFiat Plugin, Api Key

Where do I get the API key

https://onramper.com/, click on get started, then Get API key for testing

1 Like

thanks, i must have skipped that step somehow