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
96bee34c
Commit
96bee34c
authored
Apr 11, 2019
by
cyattilakiss
Committed by
GitHub
Apr 11, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #427 from Adyen/PW-1199
[PW-1199] 3DS cancellation bug
parents
47d5b826
e469e3f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
Gateway/Validator/CancelResponseValidator.php
Gateway/Validator/CancelResponseValidator.php
+4
-1
Model/Cron.php
Model/Cron.php
+20
-1
No files found.
Gateway/Validator/CancelResponseValidator.php
View file @
96bee34c
...
...
@@ -58,7 +58,10 @@ class CancelResponseValidator extends AbstractValidator
$isValid
=
true
;
$errorMessages
=
[];
if
(
$response
[
'response'
]
!=
'[cancelOrRefund-received]'
)
{
// The available response codes that the API can return in case of successfull cancellation
$expectedResponses
=
[
'[cancelOrRefund-received]'
,
'[cancel-received]'
];
if
(
!
in_array
(
$response
[
'response'
],
$expectedResponses
))
{
$errorMsg
=
__
(
'Error with cancellation'
);
$this
->
adyenLogger
->
error
(
$errorMsg
);
$errorMessages
[]
=
$errorMsg
;
...
...
Model/Cron.php
View file @
96bee34c
...
...
@@ -214,8 +214,14 @@ class Cron
*/
private
$agreementResourceModel
;
/**
* @var \Magento\Sales\Model\Order\Payment\Transaction\Builder
*/
private
$transactionBuilder
;
/**
* Cron constructor.
*
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param ResourceModel\Notification\CollectionFactory $notificationFactory
...
...
@@ -235,6 +241,7 @@ class Cron
* @param SearchCriteriaBuilder $searchCriteriaBuilder
* @param OrderRepository $orderRepository
* @param ResourceModel\Billing\Agreement $agreementResourceModel
* @param \Magento\Sales\Model\Order\Payment\Transaction\Builder $transactionBuilder
*/
public
function
__construct
(
\Magento\Framework\App\Config\ScopeConfigInterface
$scopeConfig
,
...
...
@@ -255,7 +262,8 @@ class Cron
\Magento\Sales\Model\ResourceModel\Order\Status\CollectionFactory
$orderStatusCollection
,
SearchCriteriaBuilder
$searchCriteriaBuilder
,
OrderRepository
$orderRepository
,
\Adyen\Payment\Model\ResourceModel\Billing\Agreement
$agreementResourceModel
\Adyen\Payment\Model\ResourceModel\Billing\Agreement
$agreementResourceModel
,
\Magento\Sales\Model\Order\Payment\Transaction\Builder
$transactionBuilder
)
{
$this
->
_scopeConfig
=
$scopeConfig
;
$this
->
_adyenLogger
=
$adyenLogger
;
...
...
@@ -276,6 +284,7 @@ class Cron
$this
->
searchCriteriaBuilder
=
$searchCriteriaBuilder
;
$this
->
orderRepository
=
$orderRepository
;
$this
->
agreementResourceModel
=
$agreementResourceModel
;
$this
->
transactionBuilder
=
$transactionBuilder
;
}
/**
...
...
@@ -1235,6 +1244,16 @@ class Cron
// set transaction
$paymentObj
->
setTransactionId
(
$this
->
_pspReference
);
// Prepare transaction
$transaction
=
$this
->
transactionBuilder
->
setPayment
(
$paymentObj
)
->
setOrder
(
$this
->
_order
)
->
setTransactionId
(
$this
->
_pspReference
)
->
build
(
\Magento\Sales\Api\Data\TransactionInterface
::
TYPE_AUTH
);
$transaction
->
setIsClosed
(
false
);
$transaction
->
save
();
//capture mode
if
(
!
$this
->
_isAutoCapture
())
{
$this
->
_order
->
addStatusHistoryComment
(
__
(
'Capture Mode set to Manual'
));
...
...
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