Created
January 31, 2022 15:32
-
-
Save edumaciel10/66e5dd99bc28e5744a254e227d6e11b0 to your computer and use it in GitHub Desktop.
It's a simple openpix plugin implementation
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
<!DOCTYPE html> | |
<html lang="pt-BR"> | |
<head> | |
<title>Demo OpenPix Plugin</title> | |
</head> | |
<body> | |
<div id="root"></div> | |
<script src="https://plugin.openpix.com.br/v1/openpix.js" async></script> | |
<button id="newChargeButton">Click here to create a new charge</button> | |
<script> | |
document.getElementById('newChargeButton').addEventListener('click', function() { | |
window.$openpix = window.$openpix || []; // priorize o objeto já instanciado | |
window.$openpix.push(['config', { appID: 'your-app-id' }]); | |
window.$openpix.push([ | |
'pix', | |
{ | |
value: 1, // R$ 10,00 | |
correlationID: 'test', | |
description: 'test', | |
}, | |
]); | |
}); | |
</script> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment