Skip to content

Commit 8a74bc1

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-60359' into PR-11082016
2 parents 77e7a66 + 96535d6 commit 8a74bc1

File tree

2 files changed

+14
-6
lines changed
  • app/code/Magento

2 files changed

+14
-6
lines changed

app/code/Magento/Braintree/view/adminhtml/web/js/vault.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ define([
2828
self.$selector = $('#' + self.selector);
2929
self.$container = $('#' + self.container);
3030
self.$selector.on(
31-
'setVaultNotActive',
31+
'setVaultNotActive.' + self.getCode(),
3232
function () {
3333
self.$selector.off('submitOrder.' + self.getCode());
3434
}

app/code/Magento/Vault/view/adminhtml/web/js/vault.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ define([
3333
.observe(['active']);
3434

3535
// 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));
3838

3939
if (this.active()) {
4040
$('#' + this.fieldset + ' input:radio:first').trigger('click');
@@ -50,7 +50,7 @@ define([
5050
* @returns {exports.changePaymentMethod}
5151
*/
5252
changePaymentMethod: function (event, method) {
53-
this.active(method === this.code);
53+
this.active(method === this.getCode());
5454

5555
return this;
5656
},
@@ -61,13 +61,21 @@ define([
6161
*/
6262
onActiveChange: function (isActive) {
6363
if (!isActive) {
64-
this.$selector.trigger('setVaultNotActive');
64+
this.$selector.trigger('setVaultNotActive.' + this.getCode());
6565

6666
return;
6767
}
6868

6969
$('#' + 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;
7179
}
7280
});
7381
});

0 commit comments

Comments
 (0)