refactor: organize service dto contracts
This commit is contained in:
@@ -25,6 +25,14 @@ export const refundPaymentOrder = (data) => service({
|
||||
})
|
||||
|
||||
export const testPaymentProvider = (provider) => service({
|
||||
// The payment test route is registered at /payment/... (without the
|
||||
// frontend /api proxy prefix). When the built UI is opened directly from
|
||||
// the backend port, bypass axios' default /api baseURL for this request
|
||||
// only. Vite/Nginx deployments continue to use the normal proxy path.
|
||||
...(typeof window !== 'undefined' &&
|
||||
String(window.location.port) === String(import.meta.env.VITE_SERVER_PORT || '8000')
|
||||
? { baseURL: `${window.location.origin}/` }
|
||||
: {}),
|
||||
url: `/payment/providers/${encodeURIComponent(provider)}/test`,
|
||||
method: 'post'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user