Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita committed Nov 1, 2021
1 parent 84825ad commit 6cc19d1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/src/Servies/yoomoney.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ class Yoomoney {
}
async RecivePayments(req: FastifyRequest, res: FastifyReply): Promise<void> {
let body = req.body as Yoomoneydata
res.send(200);
if(body.sha1_hash
===
!==
crypto.createHash('sha1')
.update(`${body.notification_type}&${body.operation_id}&${body.amount}&${body.currency}&${body.datetime}&${body.sender}&${body.codepro}&${process.env.YOOMONEY_CALLBACK_SECRET}&${body.label}`
).digest('hex')
Expand Down Expand Up @@ -67,7 +66,7 @@ class Yoomoney {
break;
}
})

res.send(200);
}
async createhash(req: FastifyRequest, res: FastifyReply): Promise<void> {
if(!req.headers.authorization) return res.status(401).send({code: 401, message:"Unauthorized"});
Expand Down

0 comments on commit 6cc19d1

Please sign in to comment.