torusPlugin.initiateTopup is giving error

Hi,

I had implemented web3auth topup feature using this doc:Topup your Wallet | Documentation

Purpose was to using on-ramp feature for buying matic usdc. Am facing below error.
for moonpay:

Though its working fine for wyre.
Please suggest me how to resolve this. And let me know if any additional information is required.

hi @rohit.yadav! for matic usdc you can use this code

torus.initiateTopup("moonpay", {
          selectedCurrency: "USD",
          selectedCryptoCurrency: "usdc_polygon",
        })

The reason for your error is that different topup providers is using different codes as input.

you can check the list of codes accepted by each provider using this.

const torus = new Torus({
      apiKey: "torus-default",
      buttonPosition: "bottom-left",
    });

    console.log("providers", torus.paymentProviders);

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.