-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Design PayTM gateway modals (#3447)
* feat: add paytm checkout modals * feat: add validations to modals
- Loading branch information
1 parent
c9f3868
commit 56f93b0
Showing
6 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import ModalBase from 'open-event-frontend/components/modals/modal-base'; | ||
import FormMixin from 'open-event-frontend/mixins/form'; | ||
|
||
export default class extends ModalBase.extend(FormMixin) { | ||
isSmall = true; | ||
|
||
getValidationRules() { | ||
return { | ||
inline : true, | ||
delay : false, | ||
on : 'blur', | ||
fields : { | ||
otp: { | ||
identifier : 'otp', | ||
rules : [ | ||
{ | ||
type : 'empty', | ||
prompt : this.l10n.t('Please enter the OTP') | ||
} | ||
] | ||
} | ||
} | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import ModalBase from 'open-event-frontend/components/modals/modal-base'; | ||
import FormMixin from 'open-event-frontend/mixins/form'; | ||
import { validPhoneNumber } from 'open-event-frontend/utils/validators'; | ||
|
||
export default class extends ModalBase.extend(FormMixin) { | ||
isSmall = true; | ||
isWalletSelected = false; | ||
|
||
getValidationRules() { | ||
return { | ||
inline : true, | ||
delay : false, | ||
on : 'blur', | ||
fields : { | ||
mobileNumber: { | ||
identifier : 'mobile_number', | ||
rules : [ | ||
{ | ||
type : 'empty', | ||
prompt : this.l10n.t('Please enter the Mobile Number') | ||
}, | ||
{ | ||
type : 'regExp', | ||
value : validPhoneNumber, | ||
prompt : this.l10n.t('Please enter a valid mobile number') | ||
} | ||
] | ||
} | ||
} | ||
}; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="header"> | ||
{{t 'Amount to be paid:'}} {{currency-symbol currency}} {{amount}} | ||
</div> | ||
|
||
<div class="content"> | ||
{{t 'Enter OTP sent to mobile number'}} | ||
<form class="ui form" autocomplete="off"> | ||
<div class="field"> | ||
{{input type='number' id='otp' value=otp required=true}} | ||
</div> | ||
</form> | ||
</div> | ||
<div class="actions"> | ||
<button type="button" class="ui black button" {{action 'close'}}> | ||
{{t 'Cancel'}} | ||
</button> | ||
<button class="ui green button"> | ||
{{t 'Verify'}} | ||
</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<div class="header"> | ||
{{t 'Amount to be paid:'}} {{currency-symbol currency}} {{amount}} | ||
</div> | ||
|
||
<div class="content"> | ||
<div class="muted small text"> | ||
{{t 'Select an option to pay'}} | ||
</div> | ||
<form class="ui form" autocomplete="off" {{action 'openOTPController' on='submit' preventDefault=true}}> | ||
<div class="field"> | ||
{{ui-radio name='payment_mode' value='paytm' onChange=(action (mut isWalletSelected))}} | ||
{{t 'Paytm Wallet'}}<img src="/images/payment-logos/paytm.png" alt="paytm"> | ||
</div> | ||
{{#if isWalletSelected}} | ||
<div class="field"> | ||
<div class="label"> | ||
{{t 'Please enter your Paytm registered Mobile Number to continue'}} | ||
</div> | ||
{{input type='number' id='mobile_number' value=mobileNumber required=true}} | ||
</div> | ||
{{/if}} | ||
</form> | ||
</div> | ||
|
||
<div class="actions"> | ||
<button type="button" class="ui black button" {{action 'close'}}> | ||
{{t 'Cancel'}} | ||
</button> | ||
<button {{action openOTPController}} class="ui green button" disabled={{not isWalletSelected}}> | ||
{{t 'Proceed'}} | ||
</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters