Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Adyen Magento2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shared Libs
Adyen Magento2
Commits
1b91df43
Commit
1b91df43
authored
Jan 16, 2018
by
Rik ter Beek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HPP use custom messageContainer
parent
4fccc01b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
...d/web/js/view/payment/method-renderer/adyen-hpp-method.js
+34
-2
No files found.
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
View file @
1b91df43
...
...
@@ -34,8 +34,10 @@ define(
'
Magento_Customer/js/model/customer
'
,
'
Magento_Checkout/js/model/full-screen-loader
'
,
'
Magento_Checkout/js/action/place-order
'
,
'
uiLayout
'
,
'
Magento_Ui/js/model/messages
'
],
function
(
ko
,
$
,
Component
,
selectPaymentMethodAction
,
quote
,
checkoutData
,
additionalValidators
,
storage
,
urlBuilder
,
adyenPaymentService
,
customer
,
fullScreenLoader
,
placeOrderAction
)
{
function
(
ko
,
$
,
Component
,
selectPaymentMethodAction
,
quote
,
checkoutData
,
additionalValidators
,
storage
,
urlBuilder
,
adyenPaymentService
,
customer
,
fullScreenLoader
,
placeOrderAction
,
layout
,
Messages
)
{
'
use strict
'
;
var
brandCode
=
ko
.
observable
(
null
);
var
paymentMethod
=
ko
.
observable
(
null
);
...
...
@@ -132,6 +134,29 @@ define(
console
.
log
(
JSON
.
stringify
(
error
));
fullScreenLoader
.
stopLoader
();
});
// create component needs to be in initialize method
var
messageComponents
=
{};
var
paymentMethods
=
adyenPaymentService
.
getAvailablePaymentMethods
();
_
.
map
(
paymentMethods
,
function
(
value
)
{
var
messageContainer
=
new
Messages
();
var
name
=
'
messages-
'
+
value
.
brandCode
;
var
messagesComponent
=
{
parent
:
self
.
name
,
name
:
'
messages-
'
+
value
.
brandCode
,
displayArea
:
'
messages-
'
+
value
.
brandCode
,
component
:
'
Magento_Ui/js/view/messages
'
,
config
:
{
messageContainer
:
messageContainer
}
};
layout
([
messagesComponent
]);
messageComponents
[
name
]
=
messageContainer
;
});
this
.
messageComponents
=
messageComponents
;
},
getAdyenHppPaymentMethods
:
function
()
{
var
self
=
this
;
...
...
@@ -286,11 +311,18 @@ define(
placeRedirectOrder
:
function
(
data
)
{
// Place Order but use our own redirect url after
var
self
=
this
;
var
messageContainer
=
this
.
messageContainer
;
if
(
brandCode
())
{
messageContainer
=
self
.
messageComponents
[
'
messages-
'
+
brandCode
()];
}
this
.
isPlaceOrderActionAllowed
(
false
);
fullScreenLoader
.
startLoader
();
$
.
when
(
placeOrderAction
(
data
,
this
.
messageContainer
)
placeOrderAction
(
data
,
messageContainer
)
).
fail
(
function
()
{
self
.
isPlaceOrderActionAllowed
(
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment