Skip to content

Commit 78819ad

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

File tree

2 files changed

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

2 files changed

+14
-2
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ define(
3636
braintreeDeviceData: null,
3737
paymentMethodNonce: null,
3838
lastBillingAddress: null,
39+
ccCode: null,
3940
ccMessageContainer: null,
4041
validatorManager: validatorManager,
4142
code: 'braintree',
@@ -140,8 +141,10 @@ define(
140141
}
141142

142143
this.restoreMessageContainer();
144+
this.restoreCode();
145+
143146
/**
144-
* Define already callback
147+
* Define onReady callback
145148
*/
146149
braintree.onReady = function () {};
147150
this.initBraintree();
@@ -154,10 +157,18 @@ define(
154157
this.messageContainer = this.ccMessageContainer;
155158
},
156159

160+
/**
161+
* Restore original code for cc-form component
162+
*/
163+
restoreCode: function () {
164+
this.code = this.ccCode;
165+
},
166+
157167
/** @inheritdoc */
158168
initChildren: function () {
159169
this._super();
160170
this.ccMessageContainer = this.messageContainer;
171+
this.ccCode = this.code;
161172

162173
return this;
163174
},

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ define([
5252
var self = this;
5353

5454
/**
55-
* Define already callback
55+
* Define onReady callback
5656
*/
5757
Braintree.onReady = function () {
5858
self.getPaymentMethodNonce();
@@ -77,6 +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;
8081
formComponent.messageContainer = self.messageContainer;
8182
formComponent.placeOrder();
8283
});

0 commit comments

Comments
 (0)