[SOLVED] Fiat onramp CORS block

Hey, I added the fiat onramp plugin per Ivan’s tutorial, but when I try running it I get the following errors:

Since I’m not writing the fetch request manually I can’t specify ‘no-corse’ in the request.
What should I do?

Here is my code:

(function () {
    Moralis.initPlugins();
  })();

  async function buyCrypto() {
    const response = await Moralis.Plugins.fiat.buy({}, {disableTriggers: true});
    iframeRef.current.src = await response.data;
    setShowIframe(true);
  }

Thank you.

It cloud be a different issue. There is also a message with wrong api key.

You can look in network tab in browser to see if you can find out more info about those errors.

I went to their website and found a react component example there. And it worked that way.

1 Like

Can you give more info about how you did that?

I just used this widget and it worked.

https://docs.onramper.com/widget/#react-component

1 Like