Skip to content

Commit 0fd8d54

Browse files
committed
MAGETWO-63460: Braintree saved credit card error for reorder between $2001-$3000 does not display error to customer
1 parent d7c7b6b commit 0fd8d54

File tree

2 files changed

+22
-1
lines changed
  • app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer

2 files changed

+22
-1
lines changed

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ define(
3636
braintreeDeviceData: null,
3737
paymentMethodNonce: null,
3838
lastBillingAddress: null,
39+
ccMessageContainer: null,
3940
validatorManager: validatorManager,
4041
code: 'braintree',
4142

@@ -138,9 +139,29 @@ define(
138139
return;
139140
}
140141

142+
this.restoreMessageContainer();
143+
/**
144+
* Define already callback
145+
*/
146+
braintree.onReady = function () {};
141147
this.initBraintree();
142148
},
143149

150+
/**
151+
* Restore original message container for cc-form component
152+
*/
153+
restoreMessageContainer: function () {
154+
this.messageContainer = this.ccMessageContainer;
155+
},
156+
157+
/** @inheritdoc */
158+
initChildren: function () {
159+
this._super();
160+
this.ccMessageContainer = this.messageContainer;
161+
162+
return this;
163+
},
164+
144165
/**
145166
* Init config
146167
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ define([
7777
self.hostedFields(function (formComponent) {
7878
formComponent.setPaymentMethodNonce(response.paymentMethodNonce);
7979
formComponent.additionalData['public_hash'] = self.publicHash;
80-
formComponent.code = self.code;
80+
formComponent.messageContainer = self.messageContainer;
8181
formComponent.placeOrder();
8282
});
8383
})

0 commit comments

Comments
 (0)