@@ -14,7 +14,6 @@ import { PayoutAudit } from '../models/PayoutAudit'
1414import ApiResponse from '../models/ApiResponse'
1515
1616const baseUrl = `${ EnvironmentConfig . TC_FINANCE_API } `
17- const baseUrl_old = `${ EnvironmentConfig . API . V5 } /payments`
1817const memberApiBaseUrl = `${ EnvironmentConfig . API . V5 } /members`
1918
2019export async function getWalletDetails ( ) : Promise < WalletDetails > {
@@ -38,7 +37,7 @@ export async function getUserPaymentProviders(): Promise<PaymentProvider[]> {
3837}
3938
4039export async function getUserTaxFormDetails ( ) : Promise < TaxForm [ ] > {
41- const response = await xhrGetAsync < ApiResponse < TaxForm [ ] > > ( `${ baseUrl_old } /user/tax-forms` )
40+ const response = await xhrGetAsync < ApiResponse < TaxForm [ ] > > ( `${ baseUrl } /user/tax-forms` )
4241 if ( response . status === 'error' ) {
4342 throw new Error ( 'Error fetching user tax form details' )
4443 }
@@ -105,7 +104,7 @@ export async function getTaxForms(limit: number, offset: number, userIds: string
105104 userIds,
106105 } )
107106
108- const url = `${ baseUrl_old } /admin/tax-forms`
107+ const url = `${ baseUrl } /admin/tax-forms`
109108 const response = await xhrPostAsync < string , ApiResponse < {
110109 forms : TaxForm [ ] ,
111110 pagination : PaginationInfo
@@ -132,7 +131,7 @@ export async function getPaymentMethods(limit: number, offset: number, userIds:
132131 userIds,
133132 } )
134133
135- const url = `${ baseUrl_old } /admin/payment-methods`
134+ const url = `${ baseUrl } /admin/payment-methods`
136135 const response = await xhrPostAsync < string , ApiResponse < {
137136 paymentMethods : PaymentProvider [ ] ,
138137 pagination : PaginationInfo
@@ -183,7 +182,7 @@ export async function exportSearchResults(filters: Record<string, string[]>): Pr
183182}
184183
185184export async function downloadTaxForm ( userId : string , taxFormId : string ) : Promise < Blob > {
186- const url = `${ baseUrl_old } /admin/tax-forms/${ userId } /${ taxFormId } /download`
185+ const url = `${ baseUrl } /admin/tax-forms/${ userId } /${ taxFormId } /download`
187186 try {
188187 return await getAsyncWithBlobHandling < Blob > ( url )
189188 } catch ( err ) {
@@ -192,7 +191,7 @@ export async function downloadTaxForm(userId: string, taxFormId: string): Promis
192191}
193192
194193export async function deleteTaxForm ( userId : string , taxFormId : string ) : Promise < void > {
195- const url = `${ baseUrl_old } /admin/tax-forms/${ userId } /${ taxFormId } `
194+ const url = `${ baseUrl } /admin/tax-forms/${ userId } /${ taxFormId } `
196195 try {
197196 return await xhrDeleteAsync ( url )
198197 } catch ( err ) {
@@ -201,7 +200,7 @@ export async function deleteTaxForm(userId: string, taxFormId: string): Promise<
201200}
202201
203202export async function deletePaymentProvider ( userId : string , providerId : number ) : Promise < void > {
204- const url = `${ baseUrl_old } /admin/payment-methods/${ userId } /${ providerId } `
203+ const url = `${ baseUrl } /admin/payment-methods/${ userId } /${ providerId } `
205204 try {
206205 return await xhrDeleteAsync ( url )
207206 } catch ( err ) {
@@ -262,7 +261,7 @@ export async function setPaymentProvider(
262261 type,
263262 } )
264263
265- const url = `${ baseUrl_old } /user/payment-method`
264+ const url = `${ baseUrl } /user/payment-method`
266265 const response = await xhrPostAsync < string , ApiResponse < TransactionResponse > > ( url , body )
267266
268267 if ( response . status === 'error' ) {
@@ -279,7 +278,7 @@ export async function confirmPaymentProvider(provider: string, code: string, tra
279278 transactionId,
280279 } )
281280
282- const url = `${ baseUrl_old } /payment-provider/paypal/confirm`
281+ const url = `${ baseUrl } /payment-provider/paypal/confirm`
283282 const response = await xhrPostAsync < string , ApiResponse < string > > ( url , body )
284283
285284 if ( response . status === 'error' ) {
@@ -290,7 +289,7 @@ export async function confirmPaymentProvider(provider: string, code: string, tra
290289}
291290
292291export async function getPaymentProviderRegistrationLink ( type : string ) : Promise < TransactionResponse > {
293- const url = `${ baseUrl_old } /user/payment-method/${ type } /registration-link`
292+ const url = `${ baseUrl } /user/payment-method/${ type } /registration-link`
294293 const response = await xhrGetAsync < ApiResponse < TransactionResponse > > ( url )
295294
296295 if ( response . status === 'error' ) {
@@ -301,7 +300,7 @@ export async function getPaymentProviderRegistrationLink(type: string): Promise<
301300}
302301
303302export async function removePaymentProvider ( type : string ) : Promise < TransactionResponse > {
304- const url = `${ baseUrl_old } /user/payment-method/${ type } `
303+ const url = `${ baseUrl } /user/payment-method/${ type } `
305304 const response = await xhrDeleteAsync < ApiResponse < TransactionResponse > > ( url )
306305
307306 if ( response . status === 'error' ) {
@@ -317,7 +316,7 @@ export async function setupTaxForm(userId: string, taxForm: string): Promise<Tra
317316 userId,
318317 } )
319318
320- const url = `${ baseUrl_old } /user/tax-form`
319+ const url = `${ baseUrl } /user/tax-form`
321320 const response = await xhrPostAsync < string , ApiResponse < TransactionResponse > > ( url , body )
322321
323322 if ( response . status === 'error' ) {
@@ -328,7 +327,7 @@ export async function setupTaxForm(userId: string, taxForm: string): Promise<Tra
328327}
329328
330329export async function removeTaxForm ( taxFormId : string ) : Promise < TransactionResponse > {
331- const url = `${ baseUrl_old } /user/tax-forms/${ taxFormId } `
330+ const url = `${ baseUrl } /user/tax-forms/${ taxFormId } `
332331 const response = await xhrDeleteAsync < ApiResponse < TransactionResponse > > ( url )
333332
334333 if ( response . status === 'error' ) {
@@ -339,7 +338,7 @@ export async function removeTaxForm(taxFormId: string): Promise<TransactionRespo
339338}
340339
341340export async function getRecipientViewURL ( ) : Promise < TransactionResponse > {
342- const url = `${ baseUrl_old } /user/tax-form/view`
341+ const url = `${ baseUrl } /user/tax-form/view`
343342 const response = await xhrGetAsync < ApiResponse < TransactionResponse > > ( url )
344343
345344 if ( response . status === 'error' ) {
0 commit comments