diff --git a/auth-web/src/routes/router.ts b/auth-web/src/routes/router.ts index 07371db4e..788726149 100644 --- a/auth-web/src/routes/router.ts +++ b/auth-web/src/routes/router.ts @@ -45,14 +45,10 @@ import UnauthorizedView from '@/views/auth/UnauthorizedView.vue' import UserProfileView from '@/views/auth/UserProfileView.vue' function mapReturnPayVars (route: any) { - let payResponseUrl = window.location.search - if (payResponseUrl && payResponseUrl.charAt(0) === '?') { - payResponseUrl = payResponseUrl.substr(1) - } return { paymentId: route.params.paymentId, transactionId: route.params.transactionId, - payResponseUrl: payResponseUrl + receiptNum: !route.query.receipt_number ? '' : route.query.receipt_number } } diff --git a/auth-web/src/services/payment.services.ts b/auth-web/src/services/payment.services.ts index eeedddafc..bc818ab81 100644 --- a/auth-web/src/services/payment.services.ts +++ b/auth-web/src/services/payment.services.ts @@ -14,10 +14,10 @@ export default class PaymentService { }) } - static updateTransaction (paymentId: string, transactionId: string, payResponseUrl?: string): AxiosPromise { + static updateTransaction (paymentId: string, transactionId: string, receiptNum?: string): AxiosPromise { const url = `${ConfigHelper.getPayAPIURL()}/payment-requests/${paymentId}/transactions/${transactionId}` return axios.patch(url, { - payResponseUrl: payResponseUrl + receipt_number: receiptNum }) } diff --git a/auth-web/src/views/pay/PaymentReturnView.vue b/auth-web/src/views/pay/PaymentReturnView.vue index 614717a4b..be9cdb947 100644 --- a/auth-web/src/views/pay/PaymentReturnView.vue +++ b/auth-web/src/views/pay/PaymentReturnView.vue @@ -25,7 +25,7 @@ import SbcSystemError from 'sbc-common-components/src/components/SbcSystemError. export default class PaymentReturnView extends Vue { @Prop() paymentId: string @Prop() transactionId: string - @Prop() payResponseUrl: string + @Prop() receiptNum: string returnUrl:string errorMessage:string = '' // show modal when paybc is down..otherwise [all unhandled technical error , show plain text error message..] @@ -36,7 +36,7 @@ export default class PaymentReturnView extends Vue { this.errorMessage = this.$t('payNoParams').toString() return } - PaymentServices.updateTransaction(this.paymentId, this.transactionId, this.payResponseUrl) + PaymentServices.updateTransaction(this.paymentId, this.transactionId, this.receiptNum) .then(response => { this.returnUrl = response.data.clientSystemUrl if (response.data.paySystemReasonCode && response.data.paySystemReasonCode === 'SERVICE_UNAVAILABLE') { diff --git a/auth-web/tests/unit/views/PaymentReturnView.spec.ts b/auth-web/tests/unit/views/PaymentReturnView.spec.ts index b8281df9b..bcf8f60d9 100644 --- a/auth-web/tests/unit/views/PaymentReturnView.spec.ts +++ b/auth-web/tests/unit/views/PaymentReturnView.spec.ts @@ -29,12 +29,12 @@ describe('PaymentReturnView.vue', () => { propsData: { paymentId: 'somepaymentId', transactionId: 'sometransactionId', - payResponseUrl: 'someResponseUrl' + receiptNum: 'somereceiptNum' }, mocks: { $t } }) - expect(PaymentServices.updateTransaction).toBeCalledWith('somepaymentId', 'sometransactionId', 'someResponseUrl') + expect(PaymentServices.updateTransaction).toBeCalledWith('somepaymentId', 'sometransactionId', 'somereceiptNum') }) it('service is not invoked when no params are present', () => { PaymentServices.updateTransaction = jest.fn().mockResolvedValue({}) @@ -56,7 +56,7 @@ describe('PaymentReturnView.vue', () => { propsData: { paymentId: 'somepaymentId', transactionId: 'sometransactionId', - payResponseUrl: 'someResponseUrl' + receiptNum: 'somereceiptNum' }, mocks: { $t } })