fix(open91): 履约未就绪时保持轮询等待
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
verifyOpen91Signature,
|
||||
} from './crypto.js'
|
||||
import { buildOpen91CardItem, formatOpen91ExpireTime, resolveOpen91QueryState } from './response.js'
|
||||
import { shouldWaitForOpen91Fulfillment } from './order-create-service.js'
|
||||
|
||||
test('signOpen91Payload signs only request body fields', () => {
|
||||
const config = {
|
||||
@@ -114,6 +115,12 @@ test('resolveOpen91QueryState returns success only when every task is ready', ()
|
||||
)
|
||||
})
|
||||
|
||||
test('内部订单已落库但履约任务未生成时,91 下单响应必须进入轮询', () => {
|
||||
assert.equal(shouldWaitForOpen91Fulfillment([]), true)
|
||||
assert.equal(shouldWaitForOpen91Fulfillment(undefined), true)
|
||||
assert.equal(shouldWaitForOpen91Fulfillment([{ id: 1 }]), false)
|
||||
})
|
||||
|
||||
test('buildOpen91CardItem mirrors claim link into jumpLink and leaves password empty', () => {
|
||||
assert.deepEqual(
|
||||
buildOpen91CardItem({
|
||||
|
||||
Reference in New Issue
Block a user