ben-willis / grey-jcr

Grey College JCR Website
6 stars 8 forks source link

Prevent PayPal payment debts being duplicated #94

Closed d-nagy closed 5 years ago

d-nagy commented 5 years ago

Fix to prevent the following situation, shown to me by FACSO:

image

Not sure what the cause of the problem was, it was supposedly not a one-off. The fix checks whether a debt with the same payment ID has already been added and only adds the debt if not.

The fix passes the tests, but I haven't been able to reproduce the problem to check whether it works.

ben-willis commented 5 years ago

LGTM. Can you maybe put some kind of logging if there is duplicate? Could help us work out how often it's happening.

d-nagy commented 5 years ago

Yeah no problem - with regards to logging though, I see that we have morgan but don't use it anywhere (unless I am mistaken) - should I use that?

ben-willis commented 5 years ago

Morgan is used for logging HTTP requests. You can just use console.log for now.

d-nagy commented 5 years ago

Goddammit sorry I didn't mean to add package-lock.json