Skip to content

Commit

Permalink
Update error message (#749)
Browse files Browse the repository at this point in the history
* Update error message when Payer FSP and Payee FSP are the same and on-us is not enabled.. (Added text "FSP" to specify)

* Updated unit test
  • Loading branch information
elnyry-sam-k authored Jun 22, 2020
1 parent 784e4d6 commit 3d81c45
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/central-ledger",
"version": "10.4.5",
"version": "10.5.0",
"description": "Central ledger hosted by a scheme to record and settle transfers",
"license": "Apache-2.0",
"author": "ModusBox",
Expand All @@ -12,6 +12,7 @@
"Lewis Daly <lewisd@crosslaketech.com>",
"Miguel de Barros <miguel.debarros@modusbox.com>",
"Rajiv Mothilal <rajiv.mothilal@modusbox.com>",
"Sam Kummary <sam@modusbox.com>",
"Steven Oderayi <steven.oderayi@modusbox.com>",
"Valentin Genev <valentin.genev@modusbox.com>"
],
Expand Down
4 changes: 3 additions & 1 deletion src/handlers/transfers/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* Georgi Logodazhki <georgi.logodazhki@modusbox.com>
* Rajiv Mothilal <rajiv.mothilal@modusbox.com>
* Miguel de Barros <miguel.debarros@modusbox.com>
* Sam Kummary <sam@modusbox.com>
* Vijaya Kumar Guthi <vijay.guthi@modusbox.com>
--------------
******/
Expand Down Expand Up @@ -89,7 +91,7 @@ const validateDifferentDfsp = (payload) => {
if (!Config.ENABLE_ON_US_TRANSFERS) {
const isPayerAndPayeeDifferent = (payload.payerFsp.toLowerCase() !== payload.payeeFsp.toLowerCase())
if (!isPayerAndPayeeDifferent) {
reasons.push('Payer and Payee should be different')
reasons.push('Payer FSP and Payee FSP should be different, unless on-us tranfers are allowed by the Scheme')
return false
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/handlers/transfers/validator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Test('transfer validator', validatorTest => {

const { validationPassed, reasons } = await Validator.validatePrepare(payload, headers)
test.equal(validationPassed, false)
test.deepEqual(reasons, ['Payer and Payee should be different'])
test.deepEqual(reasons, ['Payer FSP and Payee FSP should be different, unless on-us tranfers are allowed by the Scheme'])
test.end()
})

Expand Down

0 comments on commit 3d81c45

Please sign in to comment.