Last active
June 21, 2023 09:20
-
-
Save sverraest/af2f5bf3a118a7b8497dcd1e3b0ac335 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Embed PomeloJS in your website header | |
<script src="https://js.pomelopay.com/pomelo-1.0.0.min.js"></script> | |
// Run the following javascript | |
const pomelo = new PomeloJS('YOUR_PUBLIC_KEY', 'YOUR_TRANSACTION_ID') | |
pomelo.renderForm('containerId') | |
document.getElementById('submit-button').addEventListener('click', async () => { | |
await pomelo.handleTokenization('payment-form') | |
}) | |
pomelo.on('tokenGenerated', (token) => { | |
console.log(`Token: ${token}`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment