test(phase4): provision overseas lifecycle fixtures
This commit is contained in:
@@ -61,6 +61,10 @@ export function normalizeModuleOrder(modules) {
|
||||
normalized.splice(normalized.indexOf('phase3-loading-finalize') + 1, 0, 'phase3-order-splitting')
|
||||
}
|
||||
}
|
||||
if (normalized.includes('phase4-overseas-business')
|
||||
&& !normalized.includes('merchant-qualification-fixture')) {
|
||||
normalized.splice(normalized.indexOf('phase4-overseas-business'), 0, 'merchant-qualification-fixture')
|
||||
}
|
||||
const financeChain = ['finance-full-fixtures', 'finance-reconciliation-full', 'finance-settlement-full']
|
||||
const firstFinanceIndex = normalized.findIndex((name) => financeChain.includes(name))
|
||||
if (firstFinanceIndex >= 0) {
|
||||
@@ -229,9 +233,9 @@ export class AcceptanceRun {
|
||||
return { method, path, http: 0, body: null, raw: error instanceof Error ? error.message : String(error), requestId: null, traceId: null }
|
||||
}
|
||||
}
|
||||
async requestOverseas(method, path, body = undefined, extraHeaders = {}) {
|
||||
async requestOverseas(method, path, body = undefined, extraHeaders = {}, token = this.overseasToken) {
|
||||
const headers = { Accept: 'application/json', ...extraHeaders }
|
||||
if (this.overseasToken) headers.Authorization = `Bearer ${this.overseasToken}`
|
||||
if (token) headers.Authorization = `Bearer ${token}`
|
||||
if (body !== undefined) headers['Content-Type'] = 'application/json; charset=utf-8'
|
||||
try {
|
||||
const response = await fetch(`${this.options.overseasGateway}${path}`, {
|
||||
|
||||
Reference in New Issue
Block a user