Skip to content

Instantly share code, notes, and snippets.

@ichtrojan
Created April 27, 2021 14:25
Show Gist options
  • Save ichtrojan/0c35872b06ddf6eedf14cf82c3162498 to your computer and use it in GitHub Desktop.
Save ichtrojan/0c35872b06ddf6eedf14cf82c3162498 to your computer and use it in GitHub Desktop.
theater demo
<!DOCTYPE html>
<html lang="en">
<head>
<title>Thepeer test</title>
<style>
.p-5 {
padding: 5em;
}
</style>
<script type="application/javascript" src="https://money.thepeer.co/send.js"></script>
</head>
<body>
<div class="p-5">
<button id="launch-btn">Send Money with Thepeer</button>
</div>
<script type="application/javascript">
let send = new ThePeer({
publicKey: "{{your_public_key}}",
amount: {{amount_in_kobo}},
userReference: "{{user_reference}}",
firstName: "{{user_first_name}}",
receiptUrl: "{{receipt_url}}",
onSuccess: function (response) {
console.log(response.event);
},
onClose: function () {
console.log('user closed the widget.')
}
});
send.setup();
const launch = document.getElementById('launch-btn');
launch.onclick = function (e) {
send.open();
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment