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
fcff0224
Commit
fcff0224
authored
Dec 21, 2020
by
Ángel Campos
Committed by
GitHub
Dec 21, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #916 from Adyen/develop
Release 6.6.7
parents
f2ded80d
9e7967cc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
58 deletions
+82
-58
.github/CODEOWNERS
.github/CODEOWNERS
+1
-1
Model/Cron.php
Model/Cron.php
+56
-20
Observer/BeforeShipmentObserver.php
Observer/BeforeShipmentObserver.php
+1
-1
etc/adminhtml/events.xml
etc/adminhtml/events.xml
+0
-29
etc/csp_whitelist.xml
etc/csp_whitelist.xml
+20
-0
etc/events.xml
etc/events.xml
+3
-0
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
...nd/web/js/view/payment/method-renderer/adyen-cc-method.js
+1
-7
No files found.
.github/CODEOWNERS
View file @
fcff0224
* @cyattilakiss @AlexandrosMor @msilvagarcia @acampos1916 @Aleffio @rikterbeek
* @cyattilakiss @AlexandrosMor @msilvagarcia @acampos1916 @Aleffio @rikterbeek
@peterojo
Model/Cron.php
View file @
fcff0224
...
...
@@ -382,26 +382,61 @@ class Cron
*/
private
function
shouldSkipProcessingNotification
(
$notification
)
{
// OFFER_CLOSED notifications needs to be at least 10 minutes old to be processed
$offerClosedMinDate
=
new
\DateTime
();
$offerClosedMinDate
->
modify
(
'-10 minutes'
);
// Remove OFFER_CLOSED notifications arrived in the last 10 minutes from the list to process to ensure it
// won't close any order which has an AUTHORISED notification arrived a bit later than the OFFER_CLOSED one.
$createdAt
=
\DateTime
::
createFromFormat
(
'Y-m-d H:i:s'
,
$notification
[
'created_at'
]);
// To get the difference between $offerClosedMinDate and $createdAt, $offerClosedMinDate time in seconds is
// deducted from $createdAt time in seconds, divided by 60 and rounded down to integer
$minutesUntilProcessing
=
floor
((
$createdAt
->
getTimestamp
()
-
$offerClosedMinDate
->
getTimestamp
())
/
60
);
if
(
$notification
[
'event_code'
]
==
Notification
::
OFFER_CLOSED
&&
$minutesUntilProcessing
>
0
)
{
$this
->
_adyenLogger
->
addAdyenNotificationCronjob
(
sprintf
(
'OFFER_CLOSED notification %s skipped! Wait %s minute(s) before processing.'
,
$notification
->
getEntityId
(),
$minutesUntilProcessing
)
);
switch
(
$notification
[
'event_code'
])
{
// Remove OFFER_CLOSED and AUTHORISATION success=false notifications for some time from the processing list
// to ensure they won't close any order which has an AUTHORISED notification arrived a bit later than the
// OFFER_CLOSED or the AUTHORISATION success=false one.
case
Notification
::
OFFER_CLOSED
:
// OFFER_CLOSED notifications needs to be at least 10 minutes old to be processed
$offerClosedMinDate
=
new
\DateTime
(
'-10 minutes'
);
$createdAt
=
\DateTime
::
createFromFormat
(
'Y-m-d H:i:s'
,
$notification
[
'created_at'
]);
return
true
;
$minutesUntilProcessing
=
$createdAt
->
diff
(
$offerClosedMinDate
)
->
i
;
if
(
$minutesUntilProcessing
>
0
)
{
$this
->
_adyenLogger
->
addAdyenNotificationCronjob
(
sprintf
(
'OFFER_CLOSED notification (entity_id: %s) for merchant_reference: %s is skipped! Wait %s minute(s) before processing.'
,
$notification
->
getEntityId
(),
$notification
->
getMerchantReference
(),
$minutesUntilProcessing
)
);
return
true
;
}
break
;
case
Notification
::
AUTHORISATION
:
// Only delay success=false notifications processing
if
(
strcmp
(
$notification
[
'success'
],
'true'
)
==
0
||
strcmp
(
$notification
[
'success'
],
'1'
)
==
0
)
{
// do not skip this notification but process it now
return
false
;
}
// AUTHORISATION success=false notifications needs to be at least 10 minutes old to be processed
$authorisationSuccessFalseMinDate
=
new
\DateTime
(
'-10 minutes'
);
$createdAt
=
\DateTime
::
createFromFormat
(
'Y-m-d H:i:s'
,
$notification
[
'created_at'
]);
$minutesUntilProcessing
=
$createdAt
->
diff
(
$authorisationSuccessFalseMinDate
)
->
i
;
if
(
$minutesUntilProcessing
>
0
)
{
$this
->
_adyenLogger
->
addAdyenNotificationCronjob
(
sprintf
(
'AUTHORISATION success=false notification (entity_id: %s) for merchant_reference: %s is skipped! Wait %s minute(s) before processing.'
,
$notification
->
getEntityId
(),
$notification
->
getMerchantReference
(),
$minutesUntilProcessing
)
);
return
true
;
}
break
;
}
return
false
;
...
...
@@ -753,7 +788,8 @@ class Cron
// if payment method is klarna, ratepay or openinvoice/afterpay show the reservartion number
if
(
$this
->
_adyenHelper
->
isPaymentMethodOpenInvoiceMethod
(
$this
->
_paymentMethod
)
&&
!
empty
(
$this
->
_klarnaReservationNumber
))
{
$this
->
_paymentMethod
)
&&
!
empty
(
$this
->
_klarnaReservationNumber
))
{
$klarnaReservationNumberText
=
"<br /> reservationNumber: "
.
$this
->
_klarnaReservationNumber
;
}
else
{
$klarnaReservationNumberText
=
""
;
...
...
Observer/
Adminhtml/
BeforeShipmentObserver.php
→
Observer/BeforeShipmentObserver.php
View file @
fcff0224
...
...
@@ -22,7 +22,7 @@
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Observer
\Adminhtml
;
namespace
Adyen\Payment\Observer
;
use
Adyen\Payment\Helper\Data
as
AdyenHelper
;
use
Adyen\Payment\Logger\AdyenLogger
;
...
...
etc/adminhtml/events.xml
deleted
100644 → 0
View file @
f2ded80d
<?xml version="1.0"?>
<!--
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
-->
<config
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"urn:magento:framework:Event/etc/events.xsd"
>
<event
name=
"sales_order_shipment_save_before"
>
<observer
name=
"adyen_shipment_save_before"
instance=
"Adyen\Payment\Observer\Adminhtml\BeforeShipmentObserver"
/>
</event>
</config>
etc/csp_whitelist.xml
0 → 100644
View file @
fcff0224
<?xml version="1.0"?>
<csp_whitelist
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"urn:magento:module:Magento_Csp/etc/csp_whitelist.xsd"
>
<policies>
<policy
id=
"script-src"
>
<values>
<value
id=
"adyen"
type=
"host"
>
*.adyen.com
</value>
</values>
</policy>
<policy
id=
"frame-src"
>
<values>
<value
id=
"adyen"
type=
"host"
>
*.adyen.com
</value>
</values>
</policy>
<policy
id=
"img-src"
>
<values>
<value
id=
"adyen"
type=
"host"
>
*.adyen.com
</value>
</values>
</policy>
</policies>
</csp_whitelist>
etc/events.xml
View file @
fcff0224
...
...
@@ -44,4 +44,7 @@
<event
name=
"payment_method_assign_data_adyen_google_pay"
>
<observer
name=
"adyen_google_pay_gateway_data_assign"
instance=
"Adyen\Payment\Observer\AdyenGooglePayDataAssignObserver"
/>
</event>
<event
name=
"sales_order_shipment_save_before"
>
<observer
name=
"adyen_shipment_save_before"
instance=
"Adyen\Payment\Observer\BeforeShipmentObserver"
/>
</event>
</config>
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
View file @
fcff0224
...
...
@@ -190,13 +190,7 @@ define(
self
.
installments
(
0
);
}
}
// for BCMC as this is not a core payment method inside magento use maestro as brand detection
if
(
creditCardType
==
"
BCMC
"
)
{
self
.
creditCardType
(
"
MI
"
);
}
else
{
self
.
creditCardType
(
creditCardType
);
}
self
.
creditCardType
(
creditCardType
);
}
else
{
self
.
creditCardType
(
""
)
self
.
installments
(
0
);
...
...
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