Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Payhere embed SDK example
<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Embed Test Site</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
.container {
margin: 4rem auto;
max-width: 32rem;
text-align: center;
<div class="container">
<button id="payhere-custom">Pay now</button>
<script src=""></script>
document.getElementById("payhere-custom").addEventListener("click", () => {
console.log("launch payhere embed")
embedURL: "",
amountInCents: 4000,
hideAmount: "yes",
onSuccess: function({ customerName, customerEmail }) {
console.log("onSuccess", customerName, customerEmail)
onFailure: function(error) {
console.log("onFailure", error)
onClose: function() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment