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
3040d1b0
Commit
3040d1b0
authored
Jan 08, 2018
by
basm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PW-338 Validation Additional fields
parent
3281c8ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
17 deletions
+28
-17
Block/Redirect/Redirect.php
Block/Redirect/Redirect.php
+1
-1
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
...d/web/js/view/payment/method-renderer/adyen-hpp-method.js
+14
-3
view/frontend/web/template/payment/hpp-form.html
view/frontend/web/template/payment/hpp-form.html
+13
-13
No files found.
Block/Redirect/Redirect.php
View file @
3040d1b0
...
@@ -303,7 +303,7 @@ class Redirect extends \Magento\Payment\Block\Form
...
@@ -303,7 +303,7 @@ class Redirect extends \Magento\Payment\Block\Form
$formFields
[
'deliveryAddressType'
]
=
"1"
;
$formFields
[
'deliveryAddressType'
]
=
"1"
;
// make setting to make this optional
// make setting to make this optional
$formFields
[
'shopperType'
]
=
"1"
;
//
$formFields['shopperType'] = "1";
}
}
if
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
"df_value"
)
!=
""
)
{
if
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
"df_value"
)
!=
""
)
{
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
View file @
3040d1b0
...
@@ -147,8 +147,11 @@ define(
...
@@ -147,8 +147,11 @@ define(
result
.
getCode
=
function
()
{
result
.
getCode
=
function
()
{
return
self
.
item
.
method
;
return
self
.
item
.
method
;
};
};
result
.
getBrandCode
=
function
()
{
return
value
.
brandCode
;
};
result
.
validate
=
function
()
{
result
.
validate
=
function
()
{
return
self
.
validate
();
return
self
.
validate
(
value
.
brandCode
);
};
};
result
.
isPaymentMethodOpenInvoiceMethod
=
function
()
{
result
.
isPaymentMethodOpenInvoiceMethod
=
function
()
{
return
value
.
isPaymentMethodOpenInvoiceMethod
;
return
value
.
isPaymentMethodOpenInvoiceMethod
;
...
@@ -234,7 +237,8 @@ define(
...
@@ -234,7 +237,8 @@ define(
if
(
brandCode
()
==
"
ideal
"
)
{
if
(
brandCode
()
==
"
ideal
"
)
{
additionalData
.
issuer_id
=
this
.
issuerId
();
additionalData
.
issuer_id
=
this
.
issuerId
();
}
else
if
(
self
.
isPaymentMethodOpenInvoiceMethod
())
{
}
else
if
(
self
.
isPaymentMethodOpenInvoiceMethod
())
{
additionalData
.
gender
=
this
.
gender
();
additionalData
.
gender
=
this
.
gender
();
additionalData
.
dob
=
this
.
dob
();
additionalData
.
dob
=
this
.
dob
();
additionalData
.
telephone
=
this
.
telephone
();
additionalData
.
telephone
=
this
.
telephone
();
...
@@ -292,7 +296,14 @@ define(
...
@@ -292,7 +296,14 @@ define(
isIconEnabled
:
function
()
{
isIconEnabled
:
function
()
{
return
window
.
checkoutConfig
.
payment
.
adyen
.
showLogo
;
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
;
return
true
;
},
},
getRatePayDeviceIdentToken
:
function
()
{
getRatePayDeviceIdentToken
:
function
()
{
...
...
view/frontend/web/template/payment/hpp-form.html
View file @
3040d1b0
...
@@ -52,8 +52,8 @@
...
@@ -52,8 +52,8 @@
<!--/ko-->
<!--/ko-->
</div>
</div>
<form
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_form_" + $parent.getCode() + "_" + value}'
>
<fieldset
class=
"fieldset"
data-bind=
'attr: {id: "payment_form_" + $parent.getCode() + "_" + value}'
>
<!-- ko if: value == 'ideal' -->
<!-- ko if: value == 'ideal' -->
<label
data-bind=
"attr: {'for': 'issuerId'}"
class=
"label"
>
<label
data-bind=
"attr: {'for': 'issuerId'}"
class=
"label"
>
<span>
<!-- ko text: $t('Select Your Bank') --><!-- /ko -->
</span>
<span>
<!-- ko text: $t('Select Your Bank') --><!-- /ko -->
</span>
...
@@ -68,7 +68,6 @@
...
@@ -68,7 +68,6 @@
</select>
</select>
<!--/ko-->
<!--/ko-->
<!-- ko if: isPaymentMethodOpenInvoiceMethod() -->
<!-- ko if: isPaymentMethodOpenInvoiceMethod() -->
<!-- ko if: showGender() -->
<!-- ko if: showGender() -->
<div
class=
"field gender type required"
>
<div
class=
"field gender type required"
>
...
@@ -78,7 +77,7 @@
...
@@ -78,7 +77,7 @@
<div
class=
"control"
>
<div
class=
"control"
>
<select
class=
"select select-gender-type"
<select
class=
"select select-gender-type"
name=
"payment[gender]"
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', 'data-container': getCode() + '-gender-type'},
options: $parent.getGenderTypes(),
options: $parent.getGenderTypes(),
optionsValue: 'key',
optionsValue: 'key',
optionsText: 'value',
optionsText: 'value',
...
@@ -98,14 +97,13 @@
...
@@ -98,14 +97,13 @@
<div
class=
"control"
>
<div
class=
"control"
>
<input
type=
"text"
class=
"input-text"
<input
type=
"text"
class=
"input-text"
name=
"payment[dob]"
name=
"payment[dob]"
data-bind=
"
data-bind=
" datepicker: { storage: datepickerValue, options: { showOn: 'both', changeYear: true, yearRange: '-99:-1', defaultDate: '-20y' } },
datepicker: { storage: datepickerValue, options: { showOn: 'both', changeYear: true, yearRange: '-99:-1', defaultDate: '-20y' } },
attr: {
attr: {
title: $t('Date of Birth'),
title: $t('Date of Birth'),
'data-container': getCode() + '-dob'
'data-container': getCode() + '-dob',
},
'data-validate': JSON.stringify({'required':true })
value: dob"
},
data-validate=
"{required:true}"
value: dob"
/>
/>
</div>
</div>
</div>
</div>
...
@@ -124,7 +122,7 @@
...
@@ -124,7 +122,7 @@
id: getCode() + '_telephone',
id: getCode() + '_telephone',
title: $t('Telephone'),
title: $t('Telephone'),
'data-container': getCode() + '-telephone',
'data-container': getCode() + '-telephone',
'data-validate': JSON.stringify({'required-number':true
})
'data-validate': JSON.stringify({'required-number':true})
},
},
value: telephone"
value: telephone"
data-validate=
"{required:true}"
data-validate=
"{required:true}"
...
@@ -146,7 +144,7 @@
...
@@ -146,7 +144,7 @@
id: getCode() + '_ssn',
id: getCode() + '_ssn',
title: $t('Social Security Number'),
title: $t('Social Security Number'),
'data-container': getCode() + '-ssn',
'data-container': getCode() + '-ssn',
'data-validate': JSON.stringify({'required-number':true
}),
'data-validate': JSON.stringify({'required-number':true}),
maxlength : getSsnLength()
maxlength : getSsnLength()
},
},
value: ssn"
value: ssn"
...
@@ -158,6 +156,8 @@
...
@@ -158,6 +156,8 @@
<!--/ko-->
<!--/ko-->
</fieldset>
</fieldset>
</form>
<div
class=
"checkout-agreements-block"
>
<div
class=
"checkout-agreements-block"
>
<!-- ko foreach: $parents[1].getRegion('before-place-order') -->
<!-- ko foreach: $parents[1].getRegion('before-place-order') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- 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