chore: fix external compliance mock
This commit is contained in:
parent
a16abfb709
commit
144e2c4616
2 changed files with 11 additions and 5 deletions
|
|
@ -7,6 +7,12 @@ const ph = require('./plugin-helper')
|
|||
const getPlugin = (settings, pluginCode) => {
|
||||
const account = settings.accounts[pluginCode]
|
||||
const plugin = ph.load(ph.COMPLIANCE, pluginCode)
|
||||
if (pluginCode === 'mock-compliance') {
|
||||
return {
|
||||
plugin,
|
||||
account: { applicantLevel: 'basic' },
|
||||
}
|
||||
}
|
||||
|
||||
return { plugin, account }
|
||||
}
|
||||
|
|
@ -58,15 +64,13 @@ const getStatusMap = (settings, customerExternalCompliance) => {
|
|||
}
|
||||
|
||||
const createApplicant = (settings, externalService, customerId) => {
|
||||
const account = settings.accounts[externalService]
|
||||
const { plugin } = getPlugin(settings, externalService)
|
||||
const { plugin, account } = getPlugin(settings, externalService)
|
||||
|
||||
return plugin.createApplicant(account, customerId, account.applicantLevel)
|
||||
}
|
||||
|
||||
const createLink = (settings, externalService, customerId) => {
|
||||
const account = settings.accounts[externalService]
|
||||
const { plugin } = getPlugin(settings, externalService)
|
||||
const { plugin, account } = getPlugin(settings, externalService)
|
||||
|
||||
return plugin.createLink(account, customerId, account.applicantLevel)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ const { APPROVED } = require('../consts')
|
|||
const CODE = 'mock-compliance'
|
||||
|
||||
const createLink = (settings, userId, level) => {
|
||||
return `this is a mock external link, ${userId}, ${level}`
|
||||
return Promise.resolve({
|
||||
url: `this is a mock external link, ${userId}, ${level}`,
|
||||
})
|
||||
}
|
||||
|
||||
const getApplicantStatus = account => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue