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
b82f2b05
Commit
b82f2b05
authored
Feb 05, 2019
by
cyattilakiss
Committed by
GitHub
Feb 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #390 from Adyen/PW-966
PW-966 Address verification iDeal
parents
1e54e4c8
2eeec278
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
12 deletions
+46
-12
view/frontend/web/css/styles.css
view/frontend/web/css/styles.css
+5
-4
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
...d/web/js/view/payment/method-renderer/adyen-hpp-method.js
+36
-7
view/frontend/web/template/payment/hpp-form.html
view/frontend/web/template/payment/hpp-form.html
+5
-1
No files found.
view/frontend/web/css/styles.css
View file @
b82f2b05
...
...
@@ -1011,10 +1011,11 @@
max-width
:
290px
;
}
#iDealContainer
.adyen-checkout__dropdown--large
{
margin-left
:
21px
;
}
#iDealContainer
.adyen-checkout__dropdown__element
{
margin-bottom
:
0
;
}
.message.error.hpp-message
{
margin-top
:
10px
;
display
:
none
;
}
\ No newline at end of file
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
View file @
b82f2b05
...
...
@@ -164,6 +164,12 @@ define(
result
.
value
=
value
.
brandCode
;
result
.
name
=
value
;
result
.
method
=
self
.
item
.
method
;
/**
* Observable to enable and disable place order buttons for payment methods
* Default value is true to be able to send the real hpp requiests that doesn't require any input
* @type {observable}
*/
result
.
placeOrderAllowed
=
ko
.
observable
(
true
);
result
.
getCode
=
function
()
{
return
self
.
item
.
method
;
};
...
...
@@ -176,6 +182,17 @@ define(
result
.
isPlaceOrderActionAllowed
=
function
(
bool
)
{
return
self
.
isPlaceOrderActionAllowed
(
bool
);
};
/**
* Set and get if the place order action is allowed
* Sets the placeOrderAllowed observable and the original isPlaceOrderActionAllowed as well
* @param bool
* @returns {*}
*/
result
.
isPlaceOrderAllowed
=
function
(
bool
)
{
self
.
isPlaceOrderActionAllowed
(
bool
);
return
result
.
placeOrderAllowed
(
bool
);
};
result
.
afterPlaceOrder
=
function
()
{
return
self
.
afterPlaceOrder
();
};
...
...
@@ -227,7 +244,7 @@ define(
* sets up the callbacks for ideal components and
*/
result
.
renderIdealComponent
=
function
()
{
self
.
isPlaceOrderAction
Allowed
(
false
);
result
.
isPlaceOrder
Allowed
(
false
);
var
secureFieldsNode
=
document
.
getElementById
(
'
iDealContainer
'
);
...
...
@@ -240,15 +257,15 @@ define(
onChange
:
function
(
state
)
{
// isValid is not present on start
if
(
typeof
state
.
isValid
!==
'
undefined
'
&&
state
.
isValid
===
false
)
{
self
.
isPlaceOrderAction
Allowed
(
false
);
result
.
isPlaceOrder
Allowed
(
false
);
}
},
onValid
:
function
(
state
)
{
result
.
issuerId
(
state
.
data
.
issuer
);
self
.
isPlaceOrderAction
Allowed
(
true
);
result
.
isPlaceOrder
Allowed
(
true
);
},
onError
:
function
(
state
)
{
self
.
isPlaceOrderAction
Allowed
(
false
);
result
.
isPlaceOrder
Allowed
(
false
);
}
});
...
...
@@ -373,18 +390,30 @@ define(
placeRedirectOrder
:
function
(
data
)
{
// Place Order but use our own redirect url after
var
self
=
this
;
fullScreenLoader
.
startLoader
();
var
messageContainer
=
this
.
messageContainer
;
if
(
brandCode
())
{
messageContainer
=
self
.
messageComponents
[
'
messages-
'
+
brandCode
()];
}
$
(
'
.hpp-message
'
).
slideUp
();
this
.
isPlaceOrderActionAllowed
(
false
);
fullScreenLoader
.
startLoader
();
$
.
when
(
placeOrderAction
(
data
,
messageContainer
)
).
fail
(
function
()
{
function
(
response
)
{
fullScreenLoader
.
stopLoader
();
if
(
!!
response
[
'
responseJSON
'
].
parameters
)
{
$
(
"
#messages-
"
+
brandCode
()).
text
((
response
[
'
responseJSON
'
].
message
).
replace
(
'
%1
'
,
response
[
'
responseJSON
'
].
parameters
[
0
])).
slideDown
();
}
else
{
$
(
"
#messages-
"
+
brandCode
()).
text
(
response
[
'
responseJSON
'
].
message
).
slideDown
();
}
setTimeout
(
function
(){
$
(
"
#messages-
"
+
brandCode
()).
slideUp
();
},
10000
);
self
.
isPlaceOrderActionAllowed
(
true
);
}
).
done
(
...
...
view/frontend/web/template/payment/hpp-form.html
View file @
b82f2b05
...
...
@@ -173,11 +173,15 @@
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
<div>
<span
class=
"message message-error error hpp-message"
data-bind=
"attr: {id: 'messages-' + value}"
></span>
</div>
<div
class=
"actions-toolbar"
>
<div
class=
"primary"
>
<button
class=
"action primary checkout"
type=
"submit"
data-bind=
"click: $parent.continueToAdyenBrandCode, enable: (value == $parent.isBrandCodeChecked())"
data-bind=
"click: $parent.continueToAdyenBrandCode, enable:
placeOrderAllowed() &&
(value == $parent.isBrandCodeChecked())"
disabled
>
<span
data-bind=
"text: $t('Place Order')"
></span>
</button>
...
...
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