File tree Expand file tree Collapse file tree 6 files changed +129
-0
lines changed Expand file tree Collapse file tree 6 files changed +129
-0
lines changed Original file line number Diff line number Diff line change
1
+ import ModalBase from 'open-event-frontend/components/modals/modal-base' ;
2
+ import FormMixin from 'open-event-frontend/mixins/form' ;
3
+
4
+ export default class extends ModalBase . extend ( FormMixin ) {
5
+ isSmall = true ;
6
+
7
+ getValidationRules ( ) {
8
+ return {
9
+ inline : true ,
10
+ delay : false ,
11
+ on : 'blur' ,
12
+ fields : {
13
+ otp : {
14
+ identifier : 'otp' ,
15
+ rules : [
16
+ {
17
+ type : 'empty' ,
18
+ prompt : this . l10n . t ( 'Please enter the OTP' )
19
+ }
20
+ ]
21
+ }
22
+ }
23
+ } ;
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ import ModalBase from 'open-event-frontend/components/modals/modal-base' ;
2
+ import FormMixin from 'open-event-frontend/mixins/form' ;
3
+ import { validPhoneNumber } from 'open-event-frontend/utils/validators' ;
4
+
5
+ export default class extends ModalBase . extend ( FormMixin ) {
6
+ isSmall = true ;
7
+ isWalletSelected = false ;
8
+
9
+ getValidationRules ( ) {
10
+ return {
11
+ inline : true ,
12
+ delay : false ,
13
+ on : 'blur' ,
14
+ fields : {
15
+ mobileNumber : {
16
+ identifier : 'mobile_number' ,
17
+ rules : [
18
+ {
19
+ type : 'empty' ,
20
+ prompt : this . l10n . t ( 'Please enter the Mobile Number' )
21
+ } ,
22
+ {
23
+ type : 'regExp' ,
24
+ value : validPhoneNumber ,
25
+ prompt : this . l10n . t ( 'Please enter a valid mobile number' )
26
+ }
27
+ ]
28
+ }
29
+ }
30
+ } ;
31
+ }
32
+
33
+ }
Original file line number Diff line number Diff line change @@ -51,6 +51,20 @@ export default Controller.extend({
51
51
this . notify . error ( this . l10n . t ( error . error ) ) ;
52
52
}
53
53
} ,
54
+ openPaytmModal ( ) {
55
+ // Model controller for PaytmModal
56
+ this . setProperties ( {
57
+ 'isPaytmModalOpen' : true
58
+ } ) ;
59
+ } ,
60
+
61
+ openOTPController ( ) {
62
+ // Modal controller for OTP step
63
+ this . setProperties ( {
64
+ 'isPaytmModalOpen' : false ,
65
+ 'isOTPModalOpen' : true
66
+ } ) ;
67
+ } ,
54
68
processStripeToken ( token ) {
55
69
// Send this token to server to process payment
56
70
this . set ( 'isLoading' , true ) ;
Original file line number Diff line number Diff line change
1
+ <div class =" header" >
2
+ {{ t ' Amount to be paid:' }} {{ currency-symbol currency }} {{ amount }}
3
+ </div >
4
+
5
+ <div class =" content" >
6
+ {{ t ' Enter OTP sent to mobile number' }}
7
+ <form class =" ui form" autocomplete =" off" >
8
+ <div class =" field" >
9
+ {{ input type =' number' id =' otp' value =otp required =true }}
10
+ </div >
11
+ </form >
12
+ </div >
13
+ <div class =" actions" >
14
+ <button type =" button" class =" ui black button" {{ action ' close' }} >
15
+ {{ t ' Cancel' }}
16
+ </button >
17
+ <button class =" ui green button" >
18
+ {{ t ' Verify' }}
19
+ </button >
20
+ </div >
Original file line number Diff line number Diff line change
1
+ <div class =" header" >
2
+ {{ t ' Amount to be paid:' }} {{ currency-symbol currency }} {{ amount }}
3
+ </div >
4
+
5
+ <div class =" content" >
6
+ <div class =" muted small text" >
7
+ {{ t ' Select an option to pay' }}
8
+ </div >
9
+ <form class =" ui form" autocomplete =" off" {{ action ' openOTPController' on =' submit' preventDefault =true }} >
10
+ <div class =" field" >
11
+ {{ ui-radio name =' payment_mode' value =' paytm' onChange = (action (mut isWalletSelected ))}}
12
+ {{ t ' Paytm Wallet' }} <img src =" /images/payment-logos/paytm.png" alt =" paytm" >
13
+ </div >
14
+ {{ #if isWalletSelected }}
15
+ <div class =" field" >
16
+ <div class =" label" >
17
+ {{ t ' Please enter your Paytm registered Mobile Number to continue' }}
18
+ </div >
19
+ {{ input type =' number' id =' mobile_number' value =mobileNumber required =true }}
20
+ </div >
21
+ {{ /if }}
22
+ </form >
23
+ </div >
24
+
25
+ <div class =" actions" >
26
+ <button type =" button" class =" ui black button" {{ action ' close' }} >
27
+ {{ t ' Cancel' }}
28
+ </button >
29
+ <button {{ action openOTPController }} class =" ui green button" disabled ={{ not isWalletSelected }} >
30
+ {{ t ' Proceed' }}
31
+ </button >
32
+ </div >
Original file line number Diff line number Diff line change 61
61
</form >
62
62
</div >
63
63
{{ /if }}
64
+ {{ #if isPaytm }}
65
+ <button class =" ui button primary" {{ action " openPaytmModal" }} >{{ t ' Pay with PayTM' }} </button >
66
+ {{ /if }}
64
67
{{ #if isAliPay }}
65
68
<button class =" ui button primary" {{ action alipayCheckout model.order.identifier }} >{{ t ' Pay with AliPay' }} </button >
66
69
{{ /if }}
77
80
</div >
78
81
</div >
79
82
</div >
83
+ {{ modals/paytm-payment-options isLoading =isLoading isOpen =isPaytmModalOpen amount =model.order.amount currency =model.order.event.paymentCurrency openOTPController = (action ' openOTPController' )}}
84
+ {{ modals/paytm-otp isLoading =isLoading isOpen =isOTPModalOpen amount =model.order.amount currency =model.order.event.paymentCurrency }}
You can’t perform that action at this time.
0 commit comments