Skip to content

Commit c951a52

Browse files
committed
show event type
1 parent fcc5ec5 commit c951a52

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ app.post('/callback', async (req, res) => {
9898

9999
app.post('/webhook/payment', async (req, res) => {
100100
const { rawBody, headers } = req
101+
const parsed = JSON.parse(rawBody)
101102
const xsignature = headers['x-signature']
102103
const publicKey = webhookPublicKey
103104

104105
const verified = apiInstance.verify(rawBody, Buffer.from(xsignature, 'base64'), publicKey)
106+
console.log('/webhook/payment EVENT: ', parsed.event_type)
105107
console.log('/webhook/payment VERIFIED: ', verified)
106108
res.end("WEBHOOK OK!")
107109
})

0 commit comments

Comments
 (0)