Skip to content

Commit 9f6b5db

Browse files
committed
Reverting payment service changes for direct pay
1 parent 105e455 commit 9f6b5db

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

auth-web/src/routes/router.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,10 @@ import UnauthorizedView from '@/views/auth/UnauthorizedView.vue'
4545
import UserProfileView from '@/views/auth/UserProfileView.vue'
4646

4747
function mapReturnPayVars (route: any) {
48-
let payResponseUrl = window.location.search
49-
if (payResponseUrl && payResponseUrl.charAt(0) === '?') {
50-
payResponseUrl = payResponseUrl.substr(1)
51-
}
5248
return {
5349
paymentId: route.params.paymentId,
5450
transactionId: route.params.transactionId,
55-
payResponseUrl: payResponseUrl
51+
receiptNum: !route.query.receipt_number ? '' : route.query.receipt_number
5652
}
5753
}
5854

auth-web/src/services/payment.services.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export default class PaymentService {
1414
})
1515
}
1616

17-
static updateTransaction (paymentId: string, transactionId: string, payResponseUrl?: string): AxiosPromise<any> {
17+
static updateTransaction (paymentId: string, transactionId: string, receiptNum?: string): AxiosPromise<any> {
1818
const url = `${ConfigHelper.getPayAPIURL()}/payment-requests/${paymentId}/transactions/${transactionId}`
1919
return axios.patch(url, {
20-
payResponseUrl: payResponseUrl
20+
receipt_number: receiptNum
2121
})
2222
}
2323

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import SbcSystemError from 'sbc-common-components/src/components/SbcSystemError.
2525
export default class PaymentReturnView extends Vue {
2626
@Prop() paymentId: string
2727
@Prop() transactionId: string
28-
@Prop() payResponseUrl: string
28+
@Prop() receiptNum: string
2929
returnUrl:string
3030
errorMessage:string = ''
3131
// 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 {
3636
this.errorMessage = this.$t('payNoParams').toString()
3737
return
3838
}
39-
PaymentServices.updateTransaction(this.paymentId, this.transactionId, this.payResponseUrl)
39+
PaymentServices.updateTransaction(this.paymentId, this.transactionId, this.receiptNum)
4040
.then(response => {
4141
this.returnUrl = response.data.clientSystemUrl
4242
if (response.data.paySystemReasonCode && response.data.paySystemReasonCode === 'SERVICE_UNAVAILABLE') {

auth-web/tests/unit/views/PaymentReturnView.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ describe('PaymentReturnView.vue', () => {
2929
propsData: {
3030
paymentId: 'somepaymentId',
3131
transactionId: 'sometransactionId',
32-
payResponseUrl: 'someResponseUrl'
32+
receiptNum: 'somereceiptNum'
3333
},
3434
mocks: { $t }
3535
})
3636

37-
expect(PaymentServices.updateTransaction).toBeCalledWith('somepaymentId', 'sometransactionId', 'someResponseUrl')
37+
expect(PaymentServices.updateTransaction).toBeCalledWith('somepaymentId', 'sometransactionId', 'somereceiptNum')
3838
})
3939
it('service is not invoked when no params are present', () => {
4040
PaymentServices.updateTransaction = jest.fn().mockResolvedValue({})
@@ -56,7 +56,7 @@ describe('PaymentReturnView.vue', () => {
5656
propsData: {
5757
paymentId: 'somepaymentId',
5858
transactionId: 'sometransactionId',
59-
payResponseUrl: 'someResponseUrl'
59+
receiptNum: 'somereceiptNum'
6060
},
6161
mocks: { $t }
6262
})

0 commit comments

Comments
 (0)