File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Braintree/view/adminhtml/web/js
Vault/view/adminhtml/web/js Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ define([
28
28
self . $selector = $ ( '#' + self . selector ) ;
29
29
self . $container = $ ( '#' + self . container ) ;
30
30
self . $selector . on (
31
- 'setVaultNotActive' ,
31
+ 'setVaultNotActive.' + self . getCode ( ) ,
32
32
function ( ) {
33
33
self . $selector . off ( 'submitOrder.' + self . getCode ( ) ) ;
34
34
}
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ define([
33
33
. observe ( [ 'active' ] ) ;
34
34
35
35
// re-init payment method events
36
- self . $selector . off ( 'changePaymentMethod.' + this . code )
37
- . on ( 'changePaymentMethod.' + this . code , this . changePaymentMethod . bind ( this ) ) ;
36
+ self . $selector . off ( 'changePaymentMethod.' + this . getCode ( ) )
37
+ . on ( 'changePaymentMethod.' + this . getCode ( ) , this . changePaymentMethod . bind ( this ) ) ;
38
38
39
39
if ( this . active ( ) ) {
40
40
$ ( '#' + this . fieldset + ' input:radio:first' ) . trigger ( 'click' ) ;
@@ -50,7 +50,7 @@ define([
50
50
* @returns {exports.changePaymentMethod }
51
51
*/
52
52
changePaymentMethod : function ( event , method ) {
53
- this . active ( method === this . code ) ;
53
+ this . active ( method === this . getCode ( ) ) ;
54
54
55
55
return this ;
56
56
} ,
@@ -61,13 +61,21 @@ define([
61
61
*/
62
62
onActiveChange : function ( isActive ) {
63
63
if ( ! isActive ) {
64
- this . $selector . trigger ( 'setVaultNotActive' ) ;
64
+ this . $selector . trigger ( 'setVaultNotActive.' + this . getCode ( ) ) ;
65
65
66
66
return ;
67
67
}
68
68
69
69
$ ( '#' + this . fieldset + ' input:radio:first' ) . trigger ( 'click' ) ;
70
- window . order . addExcludedPaymentMethod ( this . code ) ;
70
+ window . order . addExcludedPaymentMethod ( this . getCode ( ) ) ;
71
+ } ,
72
+
73
+ /**
74
+ * Get payment method code
75
+ * @returns {String }
76
+ */
77
+ getCode : function ( ) {
78
+ return this . code ;
71
79
}
72
80
} ) ;
73
81
} ) ;
You can’t perform that action at this time.
0 commit comments