[SOLVED] Fiat Onramp: (Function Moralis.initPlugins not working)

Hey Moralis Team,

i was following Ivans tutorial on the new fiat onramp plugins. was copying the code, unfortunately it throws the following error(s):

after posting the issue in discord/troubleshooting i ran the following commands npm install react, react-dom , moralis , moralis-react & vanillajs. nothing worked unfortunately.

Appreciate your help once again!

code:

<html>
  <head>
    <title>Vanilla Boilerplate</title>
	  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/web3.min.js"></script>
    <script src="https://npmcdn.com/[email protected]/dist/moralis.js"></script>
  </head>
  <body>

    <button id="btn-login" onclick="dumpFiat()">Dump Fiat</button>
    <iframe id="myIframe" src="" width = "350" height="650" style ="display:none"></iframe> <br>




    <script>
      // connect to Moralis server
      Moralis.initialize("9xPG6EnH2JW77pGfdcSZzHZCCP4Yd28csymO4Dcv");
      Moralis.serverURL = "https://qejutygvunvz.moralisweb3.com:2053/server";


      (async function init(){
        await Moralis.initPlugins();
      })();

     function dumpFiat(){
       console.log("dumping");
       Moralis.Plugins.fiat.buy();
     }

     async function iframefiat(){
      let result = await Moralis.Plugins.fiat.buy( undefined, {disableTriggers: true});
      document.getElementById("myIframe").style.display = "block";
      document.getElementById("myIframe").src = result.result.data;
     }
    </script>
  </body>
</html>

I’ve noticed the same thing.
I’m now watching this thread too for a response.

1 Like

Works fine for me with latest Moralis SDK, as in instead of

   <script src="https://npmcdn.com/[email protected]/dist/moralis.js"></script>

I used:

    <script src="https://npmcdn.com/[email protected]/dist/moralis.js"></script>
1 Like