From fa83cab1f0cba2d1e285c75b6120d0ee9cca9c21 Mon Sep 17 00:00:00 2001 From: Rodrigo Barraza Date: Wed, 28 Feb 2024 14:17:34 -0800 Subject: [PATCH] Matching invoiceId for API call (#2745) --- auth-web/package-lock.json | 2 +- auth-web/package.json | 2 +- auth-web/src/views/pay/RefundView.vue | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/auth-web/package-lock.json b/auth-web/package-lock.json index e889d85ccd..43cfc82682 100644 --- a/auth-web/package-lock.json +++ b/auth-web/package-lock.json @@ -1,6 +1,6 @@ { "name": "auth-web", - "version": "2.5.13", + "version": "2.5.14", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/auth-web/package.json b/auth-web/package.json index 9b6937bdee..ad0abea374 100644 --- a/auth-web/package.json +++ b/auth-web/package.json @@ -1,6 +1,6 @@ { "name": "auth-web", - "version": "2.5.13", + "version": "2.5.14", "appName": "Auth Web", "sbcName": "SBC Common Components", "private": true, diff --git a/auth-web/src/views/pay/RefundView.vue b/auth-web/src/views/pay/RefundView.vue index 6045040b55..9f10e9c6af 100644 --- a/auth-web/src/views/pay/RefundView.vue +++ b/auth-web/src/views/pay/RefundView.vue @@ -197,9 +197,13 @@ export default defineComponent({ refundResponse: '' }) - function fetchInvoice () { + function matchInvoiceId (invoiceId: string) { // Should resolve REG0031233 -> 31233 etc. - const invoiceId = state.invoiceId.match(/\d+/) + return invoiceId.match(/\d+/) + } + + function fetchInvoice () { + const invoiceId = matchInvoiceId(state.invoiceId) state.orgStore.getInvoice({ invoiceId: invoiceId }).then((invoice: Invoice) => { state.invoicePaid = invoice.paid state.paymentLineItems = invoice.lineItems ? invoice.lineItems.map(item => ({ @@ -239,7 +243,8 @@ export default defineComponent({ }) } - const response = await state.orgStore.refundInvoice(state.invoiceId, refundPayload) + const invoiceId = matchInvoiceId(state.invoiceId) + const response = await state.orgStore.refundInvoice(invoiceId, refundPayload) state.refundResponse = 'Refund successful.' console.log('Refund successful:', response) } catch (error) {