Skip to content

Commit 2a606f2

Browse files
committed
Merge branch 'MAGETWO-72351' into MPI-PR-2.2.1
2 parents 0858323 + 5081702 commit 2a606f2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ define([
6161
},
6262

6363
/**
64-
* @returns {Bool}
64+
* @returns {Boolean}
6565
*/
6666
isVaultEnabled: function () {
6767
return this.vaultEnabler.isVaultEnabled();
@@ -144,10 +144,19 @@ define([
144144
},
145145

146146
/**
147-
* Trigger order placing
147+
* Returns state of place order button
148+
* @returns {Boolean}
149+
*/
150+
isButtonActive: function () {
151+
return this.isActive() && this.isPlaceOrderActionAllowed();
152+
},
153+
154+
/**
155+
* Triggers order placing
148156
*/
149157
placeOrderClick: function () {
150158
if (this.validateCardType()) {
159+
this.isPlaceOrderActionAllowed(false);
151160
$(this.getSelector('submit')).trigger('click');
152161
}
153162
},

app/code/Magento/Braintree/view/frontend/web/template/payment/form.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@
141141
data-bind="
142142
click: placeOrderClick,
143143
attr: {title: $t('Place Order')},
144-
css: {disabled: !isPlaceOrderActionAllowed()},
145-
enable: isActive()
144+
enable: isButtonActive()
146145
"
147146
disabled>
148147
<span data-bind="i18n: 'Place Order'"></span>

0 commit comments

Comments
 (0)