parent
49f8b66de0
commit
9fc79f1bb4
4 changed files with 11 additions and 9 deletions
|
|
@ -59,16 +59,17 @@ function matchOfac (deviceId, customer) {
|
|||
})
|
||||
}
|
||||
|
||||
function validateOfac (deviceId, customer) {
|
||||
if (customer.sanctionsOverride === 'blocked') return false
|
||||
if (customer.sanctionsOverride === 'verified') return true
|
||||
function validateOfac (deviceId, config, customer) {
|
||||
if (!config.sanctionsVerificationActive) return Promise.resolve(true)
|
||||
if (customer.sanctionsOverride === 'blocked') return Promise.resolve(false)
|
||||
if (customer.sanctionsOverride === 'verified') return Promise.resolve(true)
|
||||
|
||||
return matchOfac(deviceId, customer)
|
||||
.then(didMatch => !didMatch)
|
||||
}
|
||||
|
||||
function validationPatch (deviceId, config, customer) {
|
||||
return validateOfac(deviceId, customer)
|
||||
return validateOfac(deviceId, config, customer)
|
||||
.then(ofacValidation => {
|
||||
if (_.isNil(customer.sanctions) || customer.sanctions !== ofacValidation) {
|
||||
return {sanctions: ofacValidation}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue