fix(payment): restore public resume and result flows
This commit is contained in:
@@ -22,8 +22,12 @@ describe('payment api', () => {
|
||||
post.mockResolvedValue({ data: {} })
|
||||
})
|
||||
|
||||
it('does not expose anonymous public out_trade_no verification', () => {
|
||||
expect(Object.prototype.hasOwnProperty.call(paymentAPI, 'verifyOrderPublic')).toBe(false)
|
||||
it('keeps legacy public out_trade_no verification for upgrade compatibility', async () => {
|
||||
await paymentAPI.verifyOrderPublic('legacy-order-no')
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/payment/public/orders/verify', {
|
||||
out_trade_no: 'legacy-order-no',
|
||||
})
|
||||
})
|
||||
|
||||
it('keeps signed public resume-token resolve endpoint', async () => {
|
||||
|
||||
@@ -67,6 +67,11 @@ export const paymentAPI = {
|
||||
return apiClient.post<PaymentOrder>('/payment/orders/verify', { out_trade_no: outTradeNo })
|
||||
},
|
||||
|
||||
/** Legacy-compatible public order lookup by out_trade_no */
|
||||
verifyOrderPublic(outTradeNo: string) {
|
||||
return apiClient.post<PaymentOrder>('/payment/public/orders/verify', { out_trade_no: outTradeNo })
|
||||
},
|
||||
|
||||
/** Resolve an order from a signed resume token without auth */
|
||||
resolveOrderPublicByResumeToken(resumeToken: string) {
|
||||
return apiClient.post<PaymentOrder>('/payment/public/orders/resolve', { resume_token: resumeToken })
|
||||
|
||||
Reference in New Issue
Block a user