Widget Integration
You can also use the Zoksh payment script to trigger the ramp flow.
Embed script
Include the script hosted at https://pay.zoksh.com/public/embed.js
to your site to enable ramp on the site.
Trigger widget
<body>
<button id="buy_now">Buy now</button>
</body>
<script src="https://pay.zoksh.com/public/embed.js" ></script>
<script>
document.querySelector('#buy_now').addEventListener('click', async () => {
const mp = new Zoksh({
mode: 'ramp',
apiKey: '63a003db4b7c475b2fb782e6', // REQUIRED
environment: 'prod', // sand , prod
prefill: {
name: 'Demo user',
email: 'demo@demo.com'
},
rampConfig: {
wallets: {
ethereum: '0xf2ccabfb643a44d9c7b775a60b2c26dce9895fed655f',
polygon: '0xf2ccabfb643a44d9c7b775a60b2c26dce9895fed655f'
},
networks: ['ethereum', 'polygon'],
cryptos: ['ETH','MATIC']
}
});
mp.init();
})
</script>