fix: retire public payment verify and backfill trade no
This commit is contained in:
36
frontend/src/api/__tests__/payment.spec.ts
Normal file
36
frontend/src/api/__tests__/payment.spec.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
const { get, post } = vi.hoisted(() => ({
|
||||
get: vi.fn(),
|
||||
post: vi.fn(),
|
||||
}))
|
||||
|
||||
vi.mock('@/api/client', () => ({
|
||||
apiClient: {
|
||||
get,
|
||||
post,
|
||||
},
|
||||
}))
|
||||
|
||||
import { paymentAPI } from '@/api/payment'
|
||||
|
||||
describe('payment api', () => {
|
||||
beforeEach(() => {
|
||||
get.mockReset()
|
||||
post.mockReset()
|
||||
get.mockResolvedValue({ data: {} })
|
||||
post.mockResolvedValue({ data: {} })
|
||||
})
|
||||
|
||||
it('does not expose anonymous public out_trade_no verification', () => {
|
||||
expect(Object.prototype.hasOwnProperty.call(paymentAPI, 'verifyOrderPublic')).toBe(false)
|
||||
})
|
||||
|
||||
it('keeps signed public resume-token resolve endpoint', async () => {
|
||||
await paymentAPI.resolveOrderPublicByResumeToken('resume-token-123')
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/payment/public/orders/resolve', {
|
||||
resume_token: 'resume-token-123',
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user