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
dbd8a60a
Commit
dbd8a60a
authored
Oct 22, 2020
by
attilak
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into generic-component
parents
26ed6556
6fadad65
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
164 additions
and
16 deletions
+164
-16
Gateway/Validator/CheckoutResponseValidator.php
Gateway/Validator/CheckoutResponseValidator.php
+4
-3
Plugin/GuestPaymentInformationResetOrderId.php
Plugin/GuestPaymentInformationResetOrderId.php
+81
-0
Plugin/PaymentInformationResetOrderId.php
Plugin/PaymentInformationResetOrderId.php
+70
-0
composer.json
composer.json
+1
-1
etc/config.xml
etc/config.xml
+0
-12
etc/di.xml
etc/di.xml
+8
-0
No files found.
Gateway/Validator/CheckoutResponseValidator.php
View file @
dbd8a60a
...
@@ -67,9 +67,10 @@ class CheckoutResponseValidator extends AbstractValidator
...
@@ -67,9 +67,10 @@ class CheckoutResponseValidator extends AbstractValidator
$payment
->
setAdditionalInformation
(
'3dActive'
,
false
);
$payment
->
setAdditionalInformation
(
'3dActive'
,
false
);
$isValid
=
true
;
$isValid
=
true
;
$errorMessages
=
[];
$errorMessages
=
[];
$resultCode
=
$response
[
'resultCode'
];
// validate result
// validate result
if
(
!
empty
(
$res
ponse
[
'resultCode'
]
))
{
if
(
!
empty
(
$res
ultCode
))
{
$payment
->
setAdditionalInformation
(
'resultCode'
,
$res
ponse
[
'resultCode'
]
);
$payment
->
setAdditionalInformation
(
'resultCode'
,
$res
ultCode
);
if
(
!
empty
(
$response
[
'action'
]))
{
if
(
!
empty
(
$response
[
'action'
]))
{
$payment
->
setAdditionalInformation
(
'action'
,
$response
[
'action'
]);
$payment
->
setAdditionalInformation
(
'action'
,
$response
[
'action'
]);
...
@@ -87,7 +88,7 @@ class CheckoutResponseValidator extends AbstractValidator
...
@@ -87,7 +88,7 @@ class CheckoutResponseValidator extends AbstractValidator
$payment
->
setAdditionalInformation
(
'adyenPaymentData'
,
$response
[
'paymentData'
]);
$payment
->
setAdditionalInformation
(
'adyenPaymentData'
,
$response
[
'paymentData'
]);
}
}
switch
(
$res
ponse
[
'resultCode'
]
)
{
switch
(
$res
ultCode
)
{
case
"Authorised"
:
case
"Authorised"
:
case
"Received"
:
case
"Received"
:
// TODO refactor since the full additionalData is stored in additionalInformation already
// TODO refactor since the full additionalData is stored in additionalInformation already
...
...
Plugin/GuestPaymentInformationResetOrderId.php
0 → 100644
View file @
dbd8a60a
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2019 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Plugin
;
use
Magento\Quote\Api\CartRepositoryInterface
;
class
GuestPaymentInformationResetOrderId
{
/**
* Quote repository.
*
* @var \Magento\Quote\Api\CartRepositoryInterface
*/
protected
$quoteRepository
;
/**
* @var \Adyen\Payment\Logger\AdyenLogger
*/
protected
$adyenLogger
;
/**
* @var \Magento\Quote\Model\QuoteIdMaskFactory
*/
protected
$quoteIdMaskFactory
;
/**
* GuestPaymentInformationResetOrderId constructor.
* @param CartRepositoryInterface $quoteRepository
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory
*/
public
function
__construct
(
CartRepositoryInterface
$quoteRepository
,
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
,
\Magento\Quote\Model\QuoteIdMaskFactory
$quoteIdMaskFactory
)
{
$this
->
quoteRepository
=
$quoteRepository
;
$this
->
adyenLogger
=
$adyenLogger
;
$this
->
quoteIdMaskFactory
=
$quoteIdMaskFactory
;
}
/**
* @param \Magento\Checkout\Api\GuestPaymentInformationManagementInterface $subject
* @param $cartId
* @return null
*/
public
function
beforeSavePaymentInformationAndPlaceOrder
(
\Magento\Checkout\Api\GuestPaymentInformationManagementInterface
$subject
,
$cartId
)
{
try
{
$quoteIdMask
=
$this
->
quoteIdMaskFactory
->
create
()
->
load
(
$cartId
,
'masked_id'
);
$quoteId
=
$quoteIdMask
->
getQuoteId
();
$this
->
quoteRepository
->
get
(
$quoteId
)
->
setReservedOrderId
(
null
);
}
catch
(
\Exception
$e
)
{
$this
->
adyenLogger
->
error
(
"Failed to reset reservedOrderId for guest shopper"
.
$e
->
getMessage
());
}
return
null
;
}
}
Plugin/PaymentInformationResetOrderId.php
0 → 100644
View file @
dbd8a60a
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2019 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Plugin
;
use
Magento\Quote\Api\CartRepositoryInterface
;
class
PaymentInformationResetOrderId
{
/**
* Quote repository.
*
* @var \Magento\Quote\Api\CartRepositoryInterface
*/
protected
$quoteRepository
;
/**
* @var \Adyen\Payment\Logger\AdyenLogger
*/
protected
$adyenLogger
;
/**
* PaymentInformationResetOrderId constructor.
* @param CartRepositoryInterface $quoteRepository
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
*/
public
function
__construct
(
CartRepositoryInterface
$quoteRepository
,
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
)
{
$this
->
quoteRepository
=
$quoteRepository
;
$this
->
adyenLogger
=
$adyenLogger
;
}
/**
* @param \Magento\Checkout\Api\PaymentInformationManagementInterface $subject
* @param $cartId
*/
public
function
beforeSavePaymentInformationAndPlaceOrder
(
\Magento\Checkout\Api\PaymentInformationManagementInterface
$subject
,
$cartId
)
{
try
{
$this
->
quoteRepository
->
get
(
$cartId
)
->
setReservedOrderId
(
null
);
}
catch
(
\Exception
$e
)
{
$this
->
adyenLogger
->
error
(
"Failed to reset reservedOrderId "
.
$e
->
getMessage
());
}
return
null
;
}
}
composer.json
View file @
dbd8a60a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"name"
:
"adyen/module-payment"
,
"name"
:
"adyen/module-payment"
,
"description"
:
"Official Magento2 Plugin to connect to Payment Service Provider Adyen."
,
"description"
:
"Official Magento2 Plugin to connect to Payment Service Provider Adyen."
,
"type"
:
"magento2-module"
,
"type"
:
"magento2-module"
,
"version"
:
"6.6.
0
"
,
"version"
:
"6.6.
1
"
,
"license"
:
[
"license"
:
[
"OSL-3.0"
,
"OSL-3.0"
,
"AFL-3.0"
"AFL-3.0"
...
...
etc/config.xml
View file @
dbd8a60a
...
@@ -230,17 +230,5 @@
...
@@ -230,17 +230,5 @@
<group>
adyen
</group>
<group>
adyen
</group>
</adyen_google_pay>
</adyen_google_pay>
</payment>
</payment>
<dev>
<js>
<minify_exclude>
<adyen_payment>
adyen.com/checkoutshopper
</adyen_payment>
</minify_exclude>
</js>
<css>
<minify_exclude>
<adyen_payment>
adyen.com/checkoutshopper
</adyen_payment>
</minify_exclude>
</css>
</dev>
</default>
</default>
</config>
</config>
etc/di.xml
View file @
dbd8a60a
...
@@ -1020,6 +1020,14 @@
...
@@ -1020,6 +1020,14 @@
<type
name=
"Magento\Vault\Api\PaymentTokenRepositoryInterface"
>
<type
name=
"Magento\Vault\Api\PaymentTokenRepositoryInterface"
>
<plugin
name=
"AdyenPaymentVaultDeleteToken"
type=
"Adyen\Payment\Plugin\PaymentVaultDeleteToken"
sortOrder=
"10"
/>
<plugin
name=
"AdyenPaymentVaultDeleteToken"
type=
"Adyen\Payment\Plugin\PaymentVaultDeleteToken"
sortOrder=
"10"
/>
</type>
</type>
<type
name=
"Magento\Checkout\Api\PaymentInformationManagementInterface"
>
<plugin
name=
"AdyenPaymentInformationResetOrderId"
type=
"Adyen\Payment\Plugin\PaymentInformationResetOrderId"
sortOrder=
"10"
/>
</type>
<type
name=
"Magento\Checkout\Api\GuestPaymentInformationManagementInterface"
>
<plugin
name=
"GuestAdyenPaymentInformationResetOrderId"
type=
"Adyen\Payment\Plugin\GuestPaymentInformationResetOrderId"
sortOrder=
"10"
/>
</type>
<!--Notifications overview-->
<!--Notifications overview-->
<type
name=
"Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory"
>
<type
name=
"Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory"
>
...
...
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