Skip to content

Commit 9e4e4ea

Browse files
leqtrungitnorbusan
andauthored
Enforcement of required billing info if payment gateways are selected #8779 (#8960)
* set isBillingInfoMandatory equal canPayByStripe * format code * disable isBillingInfoMandatory checkbox after checked --------- Co-authored-by: Norbert Preining <[email protected]>
1 parent eff5907 commit 9e4e4ea

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ testem.log
2323
.idea
2424
.vscode
2525
.eslintcache
26+
.yarnrc
27+
.yarn
2628

2729
/yarn-error.log
2830

app/components/forms/wizard/basic-details-step.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,10 @@ export default Component.extend(FormMixin, EventWizardMixin, {
436436
},
437437

438438
actions: {
439+
onStripeCheckboxChange() {
440+
this.data.event.canPayByStripe = !this.data.event.canPayByStripe;
441+
this.data.event.isBillingInfoMandatory = this.data.event.canPayByStripe;
442+
},
439443
connectStripe() {
440444
this.torii.open('stripe')
441445
.then(authorization => {

app/services/l10n.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ export default class L10nService extends L10n {
7676
this.setLocale(locale);
7777
if (locale !== 'en') {
7878

79-
if(locale === 'zh_Hans') {
80-
locale = 'zh-cn'
81-
} else if(locale === 'zh_Hant') {
82-
locale = 'zh-tw'
83-
} else if(locale === 'nb_NO') {
84-
locale = 'nb'
79+
if (locale === 'zh_Hans') {
80+
locale = 'zh-cn';
81+
} else if (locale === 'zh_Hant') {
82+
locale = 'zh-tw';
83+
} else if (locale === 'nb_NO') {
84+
locale = 'nb';
8585
}
8686

8787
getScript(`/assets/moment-locales/${locale}.js`)

app/templates/components/forms/wizard/basic-details-step.hbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,9 @@
591591
<Input
592592
@type="checkbox"
593593
@id="payment_by_stripe"
594-
@checked={{this.data.event.canPayByStripe}} />
594+
checked={{this.data.event.canPayByStripe}}
595+
@change={{action "onStripeCheckboxChange"}}
596+
/>
595597
<label for="payment_by_stripe">
596598
<span>{{t 'YES, accept payment through Stripe'}}</span>
597599
<br>
@@ -724,6 +726,7 @@
724726
@type="checkbox"
725727
@id="billing_info_mandatory"
726728
@checked={{this.data.event.isBillingInfoMandatory}}
729+
@disabled={{this.data.event.canPayByStripe}}
727730
/>
728731
<label for="billing_info">
729732
{{t 'Require billing information from ticket buyer.'}}

0 commit comments

Comments
 (0)