Skip to content

Commit

Permalink
EFT - NSF / Outstanding balance flow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ochiu committed Jan 21, 2025
1 parent 0decdb9 commit f33710b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions auth-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auth-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth-web",
"version": "2.7.6",
"version": "2.7.7",
"appName": "Auth Web",
"sbcName": "SBC Common Components",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion auth-web/src/components/pay/OutstandingBalances.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand Down
8 changes: 6 additions & 2 deletions auth-web/src/services/payment.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,12 @@ export default class PaymentService {
return axios.post(`${ConfigHelper.getPayAPIURL()}/accounts/${accountId}/payments?retryFailedPayment=true`, {})
}

static createOutstandingAccountPayment (accountId: string | number) :AxiosPromise<Payment> {
return axios.post(`${ConfigHelper.getPayAPIURL()}/accounts/${accountId}/payments?retryFailedPayment=true&payOutstandingBalance=true`, {})
static createOutstandingAccountPayment (accountId: string | number, allInvoiceStatuses: boolean) :AxiosPromise<Payment> {
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<any> {
Expand Down
4 changes: 2 additions & 2 deletions auth-web/src/stores/org.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default defineComponent({
let payment
try {
if (state.hasEFTPaymentMethod) {
payment = await createOutstandingAccountPayment()
payment = await createOutstandingAccountPayment(false)
} else {
payment = await createAccountPayment()
}
Expand Down

0 comments on commit f33710b

Please sign in to comment.