DevelopersPayment GatewaySDK Checkout Integration
SDK Checkout Integration
Add the KongaPay SDK script and initialize checkout with KPG.setup.
Add SDK Script
html
<script src="{{pg_sdk_base_url}}/js/v1/production/pg.js"></script>Initialize Payment
html
<button onclick="payWithKongaPay()">Pay Now</button>
<script>
function payWithKongaPay() {
KPG.setup({
publicKey: "{{merchant-public-key}}",
amount: 500000,
hash: "{{server-generated-hash}}",
reference: "ORDER-100001",
description: "Payment for ORDER-100001",
callback: "handleKongaPayResponse",
mode: "test",
email: "[email protected]",
phone: "08000000000",
firstname: "Ada",
lastname: "Lovelace",
customerId: "[email protected]",
enableFrame: true,
showSuccessPage: 1
});
}
</script>