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
1166041b
Commit
1166041b
authored
Aug 21, 2017
by
Aleffio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PW-243: Do not send CSE token for recurring cards if the updated expiry date is not changed.
parent
3ff4c38b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
view/frontend/web/js/view/payment/method-renderer/adyen-oneclick-method.js
.../js/view/payment/method-renderer/adyen-oneclick-method.js
+13
-6
No files found.
view/frontend/web/js/view/payment/method-renderer/adyen-oneclick-method.js
View file @
1166041b
...
...
@@ -37,6 +37,7 @@ define(
],
function
(
ko
,
_
,
$
,
Component
,
placeOrderAction
,
$t
,
additionalValidators
,
selectPaymentMethodAction
,
quote
,
checkoutData
)
{
'
use strict
'
;
var
updatedExpiryDate
=
false
;
var
recurringDetailReference
=
ko
.
observable
(
null
);
var
paymentMethod
=
ko
.
observable
(
null
);
return
Component
.
extend
({
...
...
@@ -84,16 +85,14 @@ define(
"
method
"
:
self
.
method
,
"
additional_data
"
:
{
variant
:
self
.
agreement_data
.
variant
,
// recurring_detail_reference: "8315028947219783"
recurring_detail_reference
:
self
.
value
}
}
// only use CSE and installments for cards
if
(
self
.
agreement_data
.
card
)
{
var
cse_key
=
this
.
getCSEKey
();
var
options
=
{
enableValidations
:
false
};
var
cseInstance
=
adyen
.
encrypt
.
createEncryption
(
cse_key
,
options
);
var
generationtime
=
self
.
getGenerationTime
();
var
cardData
=
{
...
...
@@ -103,10 +102,17 @@ define(
generationtime
:
generationtime
};
var
encryptedData
=
cseInstance
.
encrypt
(
cardData
);
if
(
updatedExpiryDate
||
window
.
checkoutConfig
.
payment
.
adyenOneclick
.
hasCustomerInteraction
){
var
options
=
{
enableValidations
:
false
};
var
cse_key
=
this
.
getCSEKey
();
var
cseInstance
=
adyen
.
encrypt
.
createEncryption
(
cse_key
,
options
);
var
encryptedData
=
cseInstance
.
encrypt
(
cardData
);
data
.
additional_data
.
encrypted_data
=
encryptedData
;
}
// set payment method to adyen_hpp
data
.
additional_data
.
encrypted_data
=
encryptedData
;
data
.
additional_data
.
number_of_installments
=
self
.
installment
;
}
...
...
@@ -192,7 +198,7 @@ define(
// if oneclick or recurring is a card do validation on expiration date
if
(
this
.
agreement_data
.
card
)
{
// add extra validation because jq
eu
ry validation will not work on non name attributes
// add extra validation because jq
ue
ry validation will not work on non name attributes
var
expiration
=
Boolean
(
$
(
form
+
'
#
'
+
codeValue
+
'
_expiration
'
).
valid
());
var
expiration_yr
=
Boolean
(
$
(
form
+
'
#
'
+
codeValue
+
'
_expiration_yr
'
).
valid
());
...
...
@@ -214,6 +220,7 @@ define(
return
true
;
},
selectExpiry
:
function
()
{
updatedExpiryDate
=
true
;
var
self
=
this
;
self
.
expiry
(
true
);
return
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