Skip to content

Commit

Permalink
chore(pagarme): Log debugging Pagar.me webhook signature valitation
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Aug 1, 2024
1 parent bac8889 commit b71a4e2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/apps/pagarme/src/pagarme-webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const pagarme = {
if (typeof orderId === 'string' && /^[a-f0-9]{24}$/.test(orderId)) {
logger.info(`Order ${orderId}`);
if (`${process.env.PAGARME_WEBHOOK_SKIP_SIG}`.toLowerCase() !== 'true') {
logger.info(`Validating ${orderId} webhook signature`);
const urlSig = req.query.sig;
if (urlSig && typeof urlSig === 'string') {
const notificationSig = createHmac('sha256', process.env.PAGARME_TOKEN)
Expand Down

0 comments on commit b71a4e2

Please sign in to comment.