File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ define(
36
36
braintreeDeviceData : null ,
37
37
paymentMethodNonce : null ,
38
38
lastBillingAddress : null ,
39
+ ccCode : null ,
39
40
ccMessageContainer : null ,
40
41
validatorManager : validatorManager ,
41
42
code : 'braintree' ,
@@ -140,8 +141,10 @@ define(
140
141
}
141
142
142
143
this . restoreMessageContainer ( ) ;
144
+ this . restoreCode ( ) ;
145
+
143
146
/**
144
- * Define already callback
147
+ * Define onReady callback
145
148
*/
146
149
braintree . onReady = function ( ) { } ;
147
150
this . initBraintree ( ) ;
@@ -154,10 +157,18 @@ define(
154
157
this . messageContainer = this . ccMessageContainer ;
155
158
} ,
156
159
160
+ /**
161
+ * Restore original code for cc-form component
162
+ */
163
+ restoreCode : function ( ) {
164
+ this . code = this . ccCode ;
165
+ } ,
166
+
157
167
/** @inheritdoc */
158
168
initChildren : function ( ) {
159
169
this . _super ( ) ;
160
170
this . ccMessageContainer = this . messageContainer ;
171
+ this . ccCode = this . code ;
161
172
162
173
return this ;
163
174
} ,
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ define([
52
52
var self = this ;
53
53
54
54
/**
55
- * Define already callback
55
+ * Define onReady callback
56
56
*/
57
57
Braintree . onReady = function ( ) {
58
58
self . getPaymentMethodNonce ( ) ;
@@ -77,6 +77,7 @@ define([
77
77
self . hostedFields ( function ( formComponent ) {
78
78
formComponent . setPaymentMethodNonce ( response . paymentMethodNonce ) ;
79
79
formComponent . additionalData [ 'public_hash' ] = self . publicHash ;
80
+ formComponent . code = self . code ;
80
81
formComponent . messageContainer = self . messageContainer ;
81
82
formComponent . placeOrder ( ) ;
82
83
} ) ;
You can’t perform that action at this time.
0 commit comments