-
Notifications
You must be signed in to change notification settings - Fork 0
Sfi 2199 subscribe to submitted payment requests #4
Sfi 2199 subscribe to submitted payment requests #4
Conversation
@@ -0,0 +1,4 @@ | |||
module.exports = { | |||
FIRST_PAYMENT: 1, | |||
POST_PAYMENT_ADJUSTMENT: 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably fine for now but may be a limitation if we have tests that cover three payment requests as 3
is still a post payment adjustment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, recognised this myself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
const processSubmitPaymentRequest = async (paymentRequest) => { | ||
const transaction = await db.sequelize.transaction() | ||
try { | ||
const existingPaymentRequest = await getPaymentRequestByReferenceId(paymentRequest.referenceId, transaction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is still an issue because the reference
number will mostly be the same for both the processing and submit messages so whichever got there first would prevent the other being saved.
It's only changed if we need to reprocess a payment request from processing again. ie DAX has rejected it.
What if we included the status of the payment request in the paymentRequest
table and used that in the duplicate check?
eg rather than "if this reference exists, it's a duplicate" we have "if this reference exists and it's a submitted payment request" it's a duplicate?
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.