Vendy Checkout Demo

Test a demo transaction with Vendy

...
<script src="https://checkout.vendy.money/v1/inline.js" type="text/javascript" charset="utf-8"></script>
...
<script>
    const vendyPay = new VendyPay();
    vendyPay.initTransaction({
        // Replace with your api key.
        key: 'test_api_ky_xxxxxxxx',
        // Replace with a reference you generated.
        txRef: ''+Math.floor((Math.random() * 100000) + 1),
        // Replace with the amount you would like to charge.
        amount: 100,
        currency: "KES",
        phoneNumber: "254709876543", // optional parameter
        onSuccess: (transaction) => {
            /* ... */
        },
        onCancel: _ => {
            /* ... */
        }
    });
</script>
...
 
How much?
100.00 KES
+254
...
let payWithVendy = function(e){
    e.preventDefault();
    const vendyPay = new VendyPay();
    vendyPay.initTransaction({
        // Replace with your api key.
        key: 'test_api_ky_xxxxxxxx',
        // Replace with a reference you generated.
        txRef: ''+Math.floor((Math.random() * 100000) + 1),
        // Replace with the amount you would like to charge.
        amount: 10,
        currency: "KES",
        phoneNumber: "254709876543", // optional parameter
        onSuccess: (transaction) => {
            /* ... */
        },
        onCancel: _ => {
            /* ... */
        }
    });
};

const paymentForm = document.getElementById("pay-with-vendy");
paymentForm.addEventListener("submit", payWithVendy);
...
...
<form class="payment-container" id="pay-with-vendy">
	<div class="payment-label">How much?</div>
	<div class="payment-amount">
		2500.<span class="text-muted">00</span>
		<span class="payment-currency">KES</span>
	</div>
	<div class="payment-phone-no">
		<div class="phone-no-prefix">+232</div>
		<input class="phone-input-field" type="number" placeholder="Phone number (optional)"/>
	</div>
	<input class="button" type="submit" value="Make Payment" />
</form>
...