From f33710bd79ac45aa080f41893b8f6d8e9b279320 Mon Sep 17 00:00:00 2001 From: Odysseus Chiu Date: Tue, 21 Jan 2025 14:59:55 -0800 Subject: [PATCH] EFT - NSF / Outstanding balance flow fixes --- auth-web/package-lock.json | 4 ++-- auth-web/package.json | 2 +- auth-web/src/components/pay/OutstandingBalances.vue | 2 +- auth-web/src/services/payment.services.ts | 8 ++++++-- auth-web/src/stores/org.ts | 4 ++-- .../views/auth/account-freeze/AccountFreezeUnlockView.vue | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/auth-web/package-lock.json b/auth-web/package-lock.json index 2990cdb75a..6c184bb0d8 100644 --- a/auth-web/package-lock.json +++ b/auth-web/package-lock.json @@ -1,12 +1,12 @@ { "name": "auth-web", - "version": "2.7.4", + "version": "2.7.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "auth-web", - "version": "2.7.4", + "version": "2.7.7", "dependencies": { "@bcrs-shared-components/base-address": "2.0.3", "@bcrs-shared-components/bread-crumb": "1.0.8", diff --git a/auth-web/package.json b/auth-web/package.json index d92f2045c9..8670ec5658 100644 --- a/auth-web/package.json +++ b/auth-web/package.json @@ -1,6 +1,6 @@ { "name": "auth-web", - "version": "2.7.6", + "version": "2.7.7", "appName": "Auth Web", "sbcName": "SBC Common Components", "private": true, diff --git a/auth-web/src/components/pay/OutstandingBalances.vue b/auth-web/src/components/pay/OutstandingBalances.vue index cb1c206f7f..2be14e325e 100644 --- a/auth-web/src/components/pay/OutstandingBalances.vue +++ b/auth-web/src/components/pay/OutstandingBalances.vue @@ -252,7 +252,7 @@ export default defineComponent({ const handlePayment = async () => { state.handlingPayment = true - const payment: Payment = await orgStore.createOutstandingAccountPayment() + const payment: Payment = await orgStore.createOutstandingAccountPayment(true) const baseUrl = ConfigHelper.getAuthContextPath() const queryParams = `?paymentId=${payment?.id}&changePaymentType=${props.changePaymentType}` const returnUrl = `${baseUrl}/${Pages.MAIN}/${props.orgId}/${Pages.PAY_OUTSTANDING_BALANCE}${queryParams}` diff --git a/auth-web/src/services/payment.services.ts b/auth-web/src/services/payment.services.ts index 22e48a00bb..38d83570ac 100644 --- a/auth-web/src/services/payment.services.ts +++ b/auth-web/src/services/payment.services.ts @@ -204,8 +204,12 @@ export default class PaymentService { return axios.post(`${ConfigHelper.getPayAPIURL()}/accounts/${accountId}/payments?retryFailedPayment=true`, {}) } - static createOutstandingAccountPayment (accountId: string | number) :AxiosPromise { - return axios.post(`${ConfigHelper.getPayAPIURL()}/accounts/${accountId}/payments?retryFailedPayment=true&payOutstandingBalance=true`, {}) + static createOutstandingAccountPayment (accountId: string | number, allInvoiceStatuses: boolean) :AxiosPromise { + let url = `${ConfigHelper.getPayAPIURL()}/accounts/${accountId}/payments?retryFailedPayment=true&payOutstandingBalance=true` + if (allInvoiceStatuses) { + url = `${url}&allInvoiceStatuses=true` + } + return axios.post(url, {}) } static getRevenueAccountDetails (accountId: number): AxiosPromise { diff --git a/auth-web/src/stores/org.ts b/auth-web/src/stores/org.ts index aa26b6c554..736f8bf2b8 100644 --- a/auth-web/src/stores/org.ts +++ b/auth-web/src/stores/org.ts @@ -824,8 +824,8 @@ export const useOrgStore = defineStore('org', () => { setCurrentOrganizationPADInfo(undefined) } - async function createOutstandingAccountPayment () { - const response = await PaymentService.createOutstandingAccountPayment(state.currentOrganization.id) + async function createOutstandingAccountPayment (allInvoiceStatuses: boolean) { + const response = await PaymentService.createOutstandingAccountPayment(state.currentOrganization.id, allInvoiceStatuses) return response?.data || {} } diff --git a/auth-web/src/views/auth/account-freeze/AccountFreezeUnlockView.vue b/auth-web/src/views/auth/account-freeze/AccountFreezeUnlockView.vue index 63176b7e84..0d367708dc 100644 --- a/auth-web/src/views/auth/account-freeze/AccountFreezeUnlockView.vue +++ b/auth-web/src/views/auth/account-freeze/AccountFreezeUnlockView.vue @@ -191,7 +191,7 @@ export default defineComponent({ let payment try { if (state.hasEFTPaymentMethod) { - payment = await createOutstandingAccountPayment() + payment = await createOutstandingAccountPayment(false) } else { payment = await createAccountPayment() }