Skip to content

Commit 08b7394

Browse files
authored
31770 - Prevent /makepayment when invoice deleted (#3597)
1 parent d3248ae commit 08b7394

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

auth-web/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

auth-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "auth-web",
3-
"version": "2.10.38",
3+
"version": "2.10.39",
44
"appName": "Auth Web",
55
"sbcName": "SBC Common Components",
66
"private": true,

auth-web/src/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"labelHoursOfOperation": "Hours of Operation:",
1717
"hoursOfOperation": "Monday to Friday, 8:30am - 4:30pm Pacific Time",
1818
"payFailedMessage": "Payment Failed due to technical reasons. Please try again.",
19+
"invoiceDeletedMessage": "Invoice has been deleted, cannot be processed.",
1920
"downloadFailedMessage": "Download Invoice Failed due to technical reasons. Please try again.",
2021
"payFailedMessagePayBcDown": "Payment Failed due to technical reasons. Please use the below contacts.",
2122
"payNoParams": "Incorrect configuration",

auth-web/src/views/pay/PaymentView.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
<script lang="ts">
8282
import { Component, Prop, Vue } from 'vue-property-decorator'
83-
import { PaymentTypes, SessionStorageKeys } from '@/util/constants'
83+
import { InvoiceStatus, PaymentTypes, SessionStorageKeys } from '@/util/constants'
8484
import { isErrorType, normalizeError } from '@/util/error-util'
8585
import { AccountSettings } from '@/models/account-settings'
8686
import CommonUtils from '@/util/common-util'
@@ -123,6 +123,7 @@ export default class PaymentView extends Vue {
123123
returnUrl: string = ''
124124
paymentCardData: any
125125
showPayWithOnlyCC: boolean = false
126+
invoiceDeleted: boolean = false
126127
async mounted () {
127128
this.showLoading = true
128129
if (!this.paymentId || !this.redirectUrl) {
@@ -137,6 +138,13 @@ export default class PaymentView extends Vue {
137138
// get the invoice and check for OB
138139
try {
139140
const invoice = await this.getInvoice({ invoiceId: this.paymentId, accountId: accountSettings?.id })
141+
if ([InvoiceStatus.DELETE_ACCEPTED, InvoiceStatus.DELETED].includes(invoice?.statusCode as InvoiceStatus)) {
142+
this.errorMessage = this.$t('invoiceDeletedMessage').toString()
143+
this.showErrorModal = true
144+
this.showLoading = false
145+
this.invoiceDeleted = true
146+
return
147+
}
140148
if (invoice?.paymentMethod === PaymentTypes.ONLINE_BANKING) {
141149
// get account data to show in the UI
142150
const paymentDetails: OrgPaymentDetails = await this.getOrgPayments(accountSettings?.id)
@@ -159,7 +167,7 @@ export default class PaymentView extends Vue {
159167
console.error('error in accessing the invoice.Defaulting to CC flow')
160168
}
161169
}
162-
if (!this.showOnlineBanking) {
170+
if (!this.showOnlineBanking && !this.invoiceDeleted) {
163171
await this.doCreateTransaction()
164172
}
165173
} catch (error) {

0 commit comments

Comments
 (0)