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
02f25d5a
Commit
02f25d5a
authored
Jan 09, 2018
by
Bas Maassen
Committed by
GitHub
Jan 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PW-338 Validation Additional fields (#233)
* PW-338 Validation Additional fields
parent
fc27e41c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
27 deletions
+33
-27
Block/Redirect/Redirect.php
Block/Redirect/Redirect.php
+0
-3
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
...d/web/js/view/payment/method-renderer/adyen-hpp-method.js
+11
-3
view/frontend/web/template/payment/hpp-form.html
view/frontend/web/template/payment/hpp-form.html
+22
-21
No files found.
Block/Redirect/Redirect.php
View file @
02f25d5a
...
...
@@ -301,9 +301,6 @@ class Redirect extends \Magento\Payment\Block\Form
// don't allow editable shipping/delivery address
$formFields
[
'billingAddressType'
]
=
"1"
;
$formFields
[
'deliveryAddressType'
]
=
"1"
;
// make setting to make this optional
$formFields
[
'shopperType'
]
=
"1"
;
}
if
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
"df_value"
)
!=
""
)
{
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
View file @
02f25d5a
...
...
@@ -148,7 +148,7 @@ define(
return
self
.
item
.
method
;
};
result
.
validate
=
function
()
{
return
self
.
validate
();
return
self
.
validate
(
value
.
brandCode
);
};
result
.
isPaymentMethodOpenInvoiceMethod
=
function
()
{
return
value
.
isPaymentMethodOpenInvoiceMethod
;
...
...
@@ -234,7 +234,8 @@ define(
if
(
brandCode
()
==
"
ideal
"
)
{
additionalData
.
issuer_id
=
this
.
issuerId
();
}
else
if
(
self
.
isPaymentMethodOpenInvoiceMethod
())
{
}
else
if
(
self
.
isPaymentMethodOpenInvoiceMethod
())
{
additionalData
.
gender
=
this
.
gender
();
additionalData
.
dob
=
this
.
dob
();
additionalData
.
telephone
=
this
.
telephone
();
...
...
@@ -292,7 +293,14 @@ define(
isIconEnabled
:
function
()
{
return
window
.
checkoutConfig
.
payment
.
adyen
.
showLogo
;
},
validate
:
function
()
{
validate
:
function
(
brandCode
)
{
var
form
=
'
#payment_form_
'
+
this
.
getCode
()
+
'
_
'
+
brandCode
;
var
validate
=
$
(
form
).
validation
()
&&
$
(
form
).
validation
(
'
isValid
'
);
if
(
!
validate
)
{
return
false
;
}
return
true
;
},
getRatePayDeviceIdentToken
:
function
()
{
...
...
view/frontend/web/template/payment/hpp-form.html
View file @
02f25d5a
...
...
@@ -52,8 +52,8 @@
<!--/ko-->
</div>
<f
ieldset
class=
"fieldset"
data-bind=
'attr: {id: "payment_form_" + $parent.getCode() + "_" + value}'
>
<f
orm
class=
"form"
data-role=
"adyen-hpp-form"
action=
"#"
method=
"post"
data-bind=
"mageInit: { 'validation':[]}, attr: {id: 'payment_form_' + $parent.getCode() + '_' + value}"
>
<fieldset
class=
"fieldset"
data-bind=
'attr: {id: "payment_fieldset_" + $parent.getCode() + "_" + value}'
>
<!-- ko if: value == 'ideal' -->
<label
data-bind=
"attr: {'for': 'issuerId'}"
class=
"label"
>
<span>
<!-- ko text: $t('Select Your Bank') --><!-- /ko -->
</span>
...
...
@@ -68,17 +68,16 @@
</select>
<!--/ko-->
<!-- ko if: isPaymentMethodOpenInvoiceMethod() -->
<!-- ko if: showGender() -->
<div
class=
"field gender type required"
>
<label
data-bind=
"attr: {for: getCode() + '_gender_type
'
}"
class=
"label"
>
<label
data-bind=
"attr: {for: getCode() + '_gender_type
_' + value
}"
class=
"label"
>
<span>
<!-- ko text: $t('Gender')--><!-- /ko -->
</span>
</label>
<div
class=
"control"
>
<select
class=
"select select-gender-type"
name=
"payment[gender]"
data-bind=
"attr: {id: getCode() + '_gender_type
', 'data-container': getCode() + '-gender-type', 'data-validate': JSON.stringify({required:true})
},
data-bind=
"attr: {id: getCode() + '_gender_type
_' + value, 'data-container': getCode() + '-gender-type'
},
options: $parent.getGenderTypes(),
optionsValue: 'key',
optionsText: 'value',
...
...
@@ -92,20 +91,20 @@
<!-- ko if: showDob() -->
<div
class=
"field dob type required"
>
<label
data-bind=
"attr: {for: getCode() + '_dob
'
}"
class=
"label"
>
<label
data-bind=
"attr: {for: getCode() + '_dob
_' + value
}"
class=
"label"
>
<span>
<!-- ko text: $t('Date of Birth')--><!-- /ko -->
</span>
</label>
<div
class=
"control"
>
<input
type=
"text"
class=
"input-text"
name=
"payment[dob]"
data-bind=
"
datepicker: { storage: datepickerValue, options: { showOn: 'both', changeYear: true, yearRange: '-99:-1', defaultDate: '-20y' } },
attr: {
title: $t('Date of Birth'),
'data-container': getCode() + '-dob',
'data-validate': JSON.stringify({'required':true })
},
value: dob
"
data-bind=
"
datepicker: { storage: datepickerValue, options: { showOn: 'both', changeYear: true, yearRange: '-99:-1', defaultDate: '-20y' } },
attr: {
id: getCode() + '_dob_' + value,
title: $t('Date of Birth'),
'data-container': getCode() + '-dob'
},
value: dob"
data-validate=
"{required:true}
"
/>
</div>
</div>
...
...
@@ -113,7 +112,7 @@
<!-- ko if: showTelephone() -->
<div
class=
"field telephone type required"
>
<label
data-bind=
"attr: {for: getCode() + '_telephone
'
}"
class=
"label"
>
<label
data-bind=
"attr: {for: getCode() + '_telephone
_' + value
}"
class=
"label"
>
<span>
<!-- ko text: $t('Telephone')--><!-- /ko -->
</span>
</label>
<div
class=
"control"
>
...
...
@@ -121,10 +120,10 @@
name=
"payment[telephone]"
data-bind=
"
attr: {
id: getCode() + '_telephone
'
,
id: getCode() + '_telephone
_' + value
,
title: $t('Telephone'),
'data-container': getCode() + '-telephone
'
,
'data-validate': JSON.stringify({'required-number':true
})
'data-container': getCode() + '-telephone
_' + value
,
'data-validate': JSON.stringify({'required-number':true})
},
value: telephone"
data-validate=
"{required:true}"
...
...
@@ -135,7 +134,7 @@
<!-- ko if: showSsn() -->
<div
class=
"field ssn type required"
>
<label
data-bind=
"attr: {for: getCode() + '_ssn
'
}"
class=
"label"
>
<label
data-bind=
"attr: {for: getCode() + '_ssn
_' + value
}"
class=
"label"
>
<span>
<!-- ko text: $t('Personal number (last digits)')--><!-- /ko -->
</span>
</label>
<div
class=
"control"
>
...
...
@@ -143,10 +142,10 @@
name=
"payment[ssn]"
data-bind=
"
attr: {
id: getCode() + '_ssn
'
,
id: getCode() + '_ssn
_' + value
,
title: $t('Social Security Number'),
'data-container': getCode() + '-ssn',
'data-validate': JSON.stringify({'required-number':true
}),
'data-validate': JSON.stringify({'required-number':true}),
maxlength : getSsnLength()
},
value: ssn"
...
...
@@ -158,6 +157,8 @@
<!--/ko-->
</fieldset>
</form>
<div
class=
"checkout-agreements-block"
>
<!-- ko foreach: $parents[1].getRegion('before-place-order') -->
<!-- ko template: getTemplate() --><!-- /ko -->
...
...
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