Web SDK
Initiate the payment sdk from a view
Embed this script from the application button action.
<script src="https://kongapay-pg.kongapay.com/js/v1/production/pg.js"></script>This script allows you reference the javascript setup file for the sdk.
Request Data
Name
Type
Description
amount
string
Total transaction amount in kobo
reference
string
Unique transaction identifier
publicKey
string
Merchant integration Identifier
hash
string
The hash data from amount, reference and public key
description
string
Short information on the transaction
callback
string
Merchant server callback, for transaction notification.
HASH DATA
THE HASH IS GOTTEN FROM CONCATINATING THE AMOUNT|PUBLIC_KEY|REFERENCEkpay_setup.js
KPG.setup({
amount,
reference,
publicKey: 'XXXXXXXXXXX',
hash: response.hash,
description: 'okay',
callback: 'http://127.0.0.1:5050',
metadata: [
{
name: 'mobile_number',
value: '+2348012345678',
},
{
name: 'referrer',
value: 'YAKATA-BONUS',
},
],
enableFrame: true,
customer_id: 'adebayodavidhysk67@gmail.com',
phone: '09023929888',
mode: 'live',
email: 'adebayodavidhysk67@gmail.com',
showSuccessPage: 1,
})HASH SNIPPET (.JS)
function hashData(data) {
const hash = crypto.createHash('sha512')
hash.update(data)
const digest = hash.digest('hex')
return digest
}Checking for hash validity
console.log(
hashData(${amount}|${'XXXXXXXXXXXXXX'}|${reference}),Last updated