HTML Checkout

Collect payments from your customers using Klasha inline in your HTML file.

Sample implementation:

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript" src="https://js.klasha.com/pay.js">
</script>
</head>
<body>
<form>  
 <input type="button"  onclick="payWithKlasha()" value="Pay With Klasha" />
</form>
<script>  
  function payWithKlasha() {
        var kit = {
            currency: billingCurrency,
            phone_number: '{{phoneNumber}}',
            email:'{{email}}',
            fullname: '{{firstname}}' + " " + '{{lastname}}',
            tx_ref: '{{reference}}',
            callBack: callWhenDone
		}
            var client = new KlashaClient('{{key}}', 1, {{amount}}, "ktest", "callback", '{{billingCurrency}}', '{{currency}}', kit);
			client.init();
    }
    function callWhenDone(data) {
	console.log(data);
    }
</script>
</body>
</html>

Last updated