Skip to content

Commit 1640ad7

Browse files
Tweaks
1 parent 61aefba commit 1640ad7

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

auth-web/src/components/pay/common/PaymentErrorMessage.vue

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/>
2424
<div class="btns">
2525
<v-btn
26+
v-if="error.showOkbtn"
2627
large
2728
link
2829
color="primary"
@@ -32,6 +33,29 @@
3233
>
3334
Ok
3435
</v-btn>
36+
<v-btn
37+
v-else
38+
large
39+
link
40+
color="primary"
41+
class="error-btn"
42+
data-test="btn-pay-error-tryagain"
43+
@click="tryAgain"
44+
>
45+
Try Again
46+
</v-btn>
47+
<v-btn
48+
v-if="error.showCancelbtn"
49+
large
50+
outlined
51+
link
52+
color="primary"
53+
class="ml-3 error-btn"
54+
:href="backUrl"
55+
data-test="btn-pay-error-cancel"
56+
>
57+
Go Back
58+
</v-btn>
3559
</div>
3660
</v-col>
3761
</v-row>
@@ -40,19 +64,21 @@
4064

4165
<script lang="ts">
4266
import { Component, Prop } from 'vue-property-decorator'
43-
import { StringChain } from 'lodash'
4467
import Vue from 'vue'
4568
import { paymentErrorType } from '@/util/constants'
4669
4770
@Component
4871
export default class PaymentErrorMessage extends Vue {
4972
@Prop({ default: 'GENERIC_ERROR' }) errorType: string
50-
@Prop({ default: '' }) backUrl: StringChain
73+
@Prop({ default: '' }) backUrl: string
74+
@Prop({ default: '' }) tryAgainURL: string
5175
5276
public get error () {
5377
let errorTitle = ''
5478
let errorMessage = ''
5579
let errorIcon = 'mdi-alert-circle-outline'
80+
let showOkbtn = false
81+
let showCancelbtn = true
5682
5783
switch (this.errorType) {
5884
case paymentErrorType.GENERIC_ERROR:
@@ -62,6 +88,8 @@ export default class PaymentErrorMessage extends Vue {
6288
case paymentErrorType.PAYMENT_CANCELLED:
6389
errorTitle = this.$t('paymentCancelTitle').toString()
6490
errorMessage = this.$t('paymentCancelSubText').toString()
91+
showOkbtn = true
92+
showCancelbtn = false
6593
break
6694
case paymentErrorType.DECLINED:
6795
errorTitle = this.$t('paymentDeclinedTitle').toString()
@@ -78,6 +106,8 @@ export default class PaymentErrorMessage extends Vue {
78106
case paymentErrorType.DUPLICATE_ORDER_NUMBER:
79107
errorTitle = this.$t('paymentDuplicateErrorTitle').toString()
80108
errorMessage = this.$t('paymentDuplicateErrorSubText').toString()
109+
showOkbtn = true
110+
showCancelbtn = false
81111
break
82112
case paymentErrorType.TRANSACTION_TIMEOUT_NO_DEVICE:
83113
errorTitle = this.$t('paymentTimeoutErrorTitle').toString()
@@ -94,12 +124,17 @@ export default class PaymentErrorMessage extends Vue {
94124
break
95125
}
96126
97-
return { errorTitle, errorMessage, errorIcon }
127+
return { errorTitle, errorMessage, errorIcon, showOkbtn, showCancelbtn }
128+
}
129+
130+
tryAgain () {
131+
this.$router.push(this.tryAgainURL)
98132
}
99133
}
100134
</script>
101135

102136
<style lang="scss" scoped>
137+
@import "$assets/scss/theme.scss";
103138
.pay-error{
104139
.error-btn{
105140
min-width: 139px !important;

0 commit comments

Comments
 (0)