I keep getting Uncaught ReferenceError: require is not defined
<script type="text/javascript">
var reference = '1070'
function verifypayment() {
const https = require('https')
const options = {
hostname: 'api.paystack.co',
port: 443,
path: '/transaction/verify/:' + reference,
method: 'GET',
headers: {
Authorization: ''
}
}
https.request(options, res => {
let data = ''
res.on('data', (chunk) => {
data += chunk
});
res.on('end', () => {
console.log(JSON.parse(data))
})
}).on('error', error => {
console.error(error)
})
};
</script>